From adc4688f9bc74536e17c0a87be1041d8f52e3601 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Mon, 30 Mar 2020 11:59:25 +0200 Subject: [PATCH] DDSCommandUI: include path argument in ChangeState --- fairmq/plugins/DDS/runDDSCommandUI.cxx | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/fairmq/plugins/DDS/runDDSCommandUI.cxx b/fairmq/plugins/DDS/runDDSCommandUI.cxx index de11c89f..5fe17179 100644 --- a/fairmq/plugins/DDS/runDDSCommandUI.cxx +++ b/fairmq/plugins/DDS/runDDSCommandUI.cxx @@ -65,7 +65,7 @@ void handleCommand(const string& command, const string& path, unsigned int timeo cout << d.taskId << " : " << d.state << endl; } } else if (command == "o") { - cout << "> dumping config of the devices" << endl; + cout << "> dumping config of the devices (" << path << ")" << endl; // TODO: extend this regex to return all properties, once command size limitation is removed. auto const result = topo.GetProperties("^(session|id)$", path, std::chrono::milliseconds(timeout)); for (const auto& d : result.second.devices) { @@ -79,43 +79,43 @@ void handleCommand(const string& command, const string& path, unsigned int timeo return; } const DeviceProperties props{{pKey, pVal}}; - cout << "> sending property" << endl; + cout << "> sending property (" << path << ")" << endl; topo.SetProperties(props, path); // give dds time to complete request this_thread::sleep_for(chrono::milliseconds(100)); } else if (command == "i") { - cout << "> init devices" << endl; - topo.ChangeState(TopologyTransition::InitDevice, std::chrono::milliseconds(timeout)); + cout << "> init devices (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::InitDevice, path, std::chrono::milliseconds(timeout)); } else if (command == "k") { - cout << "> complete init" << endl; - topo.ChangeState(TopologyTransition::CompleteInit, std::chrono::milliseconds(timeout)); + cout << "> complete init (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::CompleteInit, path, std::chrono::milliseconds(timeout)); } else if (command == "b") { - cout << "> bind devices" << endl; - topo.ChangeState(TopologyTransition::Bind, std::chrono::milliseconds(timeout)); + cout << "> bind devices (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::Bind, path, std::chrono::milliseconds(timeout)); } else if (command == "x") { - cout << "> connect devices" << endl; - topo.ChangeState(TopologyTransition::Connect, std::chrono::milliseconds(timeout)); + cout << "> connect devices (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::Connect, path, std::chrono::milliseconds(timeout)); } else if (command == "j") { - cout << "> init tasks" << endl; - topo.ChangeState(TopologyTransition::InitTask, std::chrono::milliseconds(timeout)); + cout << "> init tasks (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::InitTask, path, std::chrono::milliseconds(timeout)); } else if (command == "r") { - cout << "> run tasks" << endl; - topo.ChangeState(TopologyTransition::Run, std::chrono::milliseconds(timeout)); + cout << "> run tasks (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::Run, path, std::chrono::milliseconds(timeout)); } else if (command == "s") { - cout << "> stop devices" << endl; - topo.ChangeState(TopologyTransition::Stop, std::chrono::milliseconds(timeout)); + cout << "> stop devices (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::Stop, path, std::chrono::milliseconds(timeout)); } else if (command == "t") { - cout << "> reset tasks" << endl; - topo.ChangeState(TopologyTransition::ResetTask, std::chrono::milliseconds(timeout)); + cout << "> reset tasks (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::ResetTask, path, std::chrono::milliseconds(timeout)); } else if (command == "d") { - cout << "> reset devices" << endl; - topo.ChangeState(TopologyTransition::ResetDevice, std::chrono::milliseconds(timeout)); + cout << "> reset devices (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::ResetDevice, path, std::chrono::milliseconds(timeout)); + } else if (command == "q") { + cout << "> end (" << path << ")" << endl; + topo.ChangeState(TopologyTransition::End, path, std::chrono::milliseconds(timeout)); } else if (command == "h") { cout << "> help" << endl; printControlsHelp(); - } else if (command == "q") { - cout << "> end" << endl; - topo.ChangeState(TopologyTransition::End, std::chrono::milliseconds(timeout)); } else { cout << "\033[01;32mInvalid input: [" << command << "]\033[0m" << endl; printControlsHelp();