18 std::string command,
DeviceModule& deviceModule, std::string outputName,
unsigned int errorGracePeriod)
20 _deviceAlias(deviceModule.getDeviceAliasOrURI()), _outputName(std::move(outputName)),
21 _errorGracePeriod(errorGracePeriod) {
33 bp::child initScript(
_command, (bp::std_out & bp::std_err) > out);
39 while(std::getline(out, line)) {
40 output += line +
"\n";
46 if(initScript.exit_code() != 0) {
47 output +=
"!!! " +
_deviceAlias +
" initialisation FAILED!";
55 throw ChimeraTK::runtime_error(
_deviceAlias +
" initialisation failed.");
63 catch(bp::process_error& e) {
65 throw ChimeraTK::logic_error(
"Caught boost::process::process_error while executing \"" +
_command +
ScriptedInitHandler(ModuleGroup *owner, const std::string &name, const std::string &description, std::string command, DeviceModule &deviceModule, std::string outputName="initScriptOutput", unsigned int errorGracePeriod=10)
Constructor.