mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
DDSCommandUI: include path argument in ChangeState
This commit is contained in:
parent
c3127f22e5
commit
adc4688f9b
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user