diff --git a/examples/dds/fairmq-start-ex-dds.sh.in b/examples/dds/fairmq-start-ex-dds.sh.in index 77d36451..159a10a4 100755 --- a/examples/dds/fairmq-start-ex-dds.sh.in +++ b/examples/dds/fairmq-start-ex-dds.sh.in @@ -62,6 +62,7 @@ fairmq-dds-command-ui -c x -w "DEVICE READY" -n ${requiredNofAgents} fairmq-dds-command-ui -c j -w "READY" -n ${requiredNofAgents} fairmq-dds-command-ui -c r sampler_and_sink="main/(Sampler|Sink)" +# processors="main/ProcessorGroup/Processor" fairmq-dds-command-ui -p $sampler_and_sink -w "RUNNING->READY" -n 2 echo "...$sampler_and_sink are READY, sending shutdown..." fairmq-dds-command-ui -c s -w "RUNNING->READY" -n ${requiredNofAgents} diff --git a/fairmq/plugins/DDS/runDDSCommandUI.cxx b/fairmq/plugins/DDS/runDDSCommandUI.cxx index 77009fbc..22a7c5b5 100644 --- a/fairmq/plugins/DDS/runDDSCommandUI.cxx +++ b/fairmq/plugins/DDS/runDDSCommandUI.cxx @@ -74,7 +74,8 @@ void printControlsHelp() cout << "To quit press Ctrl+C" << endl; } -void sendCommand(const string& commandIn, const string& topologyPath, CCustomCmd& ddsCustomCmd) { +void sendCommand(const string& commandIn, const string& topologyPath, CCustomCmd& ddsCustomCmd) +{ char c; string command(commandIn); TerminalConfig tconfig; @@ -159,8 +160,6 @@ struct WaitMode void Run(const chrono::milliseconds& timeout, const string& topologyPath, CCustomCmd& ddsCustomCmd, unsigned int numDevices, const string& command = "") { - StateSubscription stateSubscription(topologyPath, ddsCustomCmd); - if (command != "") { sendCommand(command, topologyPath, ddsCustomCmd); } @@ -288,13 +287,19 @@ int main(int argc, char* argv[]) } break; case Type::transition_status: { - // if (static_cast(*cmd).GetResult() == Result::Ok) { - // cout << "Device " << static_cast(*cmd).GetDeviceId() << " started to transition with " << static_cast(*cmd).GetTransition() << endl; - // } else { - // cout << "Device " << static_cast(*cmd).GetDeviceId() << " cannot transition with " << static_cast(*cmd).GetTransition() << endl; - // } + if (static_cast(*cmd).GetResult() == Result::Ok) { + cout << "Device " << static_cast(*cmd).GetDeviceId() << " started to transition with " << static_cast(*cmd).GetTransition() << endl; + } else { + cout << "Device " << static_cast(*cmd).GetDeviceId() << " cannot transition with " << static_cast(*cmd).GetTransition() << endl; + } } break; + case Type::current_state: + cout << "Device " << static_cast(*cmd).GetDeviceId() << " is in " << static_cast(*cmd).GetCurrentState() << " state" << endl; + break; + case Type::config: + cout << "Received config for device " << static_cast(*cmd).GetDeviceId() << ":\n" << static_cast(*cmd).GetConfig() << endl; + break; default: cout << "Unexpected/unknown command received: " << cmd->GetType() << endl; cout << "Origin: " << senderId << endl; @@ -305,6 +310,8 @@ int main(int argc, char* argv[]) service.start(sessionID); + StateSubscription stateSubscription(topologyPath, ddsCustomCmd); + if (targetState == "") { sendCommand(command, topologyPath, ddsCustomCmd); } else {