mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +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;
|
cout << d.taskId << " : " << d.state << endl;
|
||||||
}
|
}
|
||||||
} else if (command == "o") {
|
} 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.
|
// 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));
|
auto const result = topo.GetProperties("^(session|id)$", path, std::chrono::milliseconds(timeout));
|
||||||
for (const auto& d : result.second.devices) {
|
for (const auto& d : result.second.devices) {
|
||||||
|
@ -79,43 +79,43 @@ void handleCommand(const string& command, const string& path, unsigned int timeo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const DeviceProperties props{{pKey, pVal}};
|
const DeviceProperties props{{pKey, pVal}};
|
||||||
cout << "> sending property" << endl;
|
cout << "> sending property (" << path << ")" << endl;
|
||||||
topo.SetProperties(props, path);
|
topo.SetProperties(props, path);
|
||||||
// give dds time to complete request
|
// give dds time to complete request
|
||||||
this_thread::sleep_for(chrono::milliseconds(100));
|
this_thread::sleep_for(chrono::milliseconds(100));
|
||||||
} else if (command == "i") {
|
} else if (command == "i") {
|
||||||
cout << "> init devices" << endl;
|
cout << "> init devices (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::InitDevice, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::InitDevice, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "k") {
|
} else if (command == "k") {
|
||||||
cout << "> complete init" << endl;
|
cout << "> complete init (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::CompleteInit, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::CompleteInit, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "b") {
|
} else if (command == "b") {
|
||||||
cout << "> bind devices" << endl;
|
cout << "> bind devices (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::Bind, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::Bind, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "x") {
|
} else if (command == "x") {
|
||||||
cout << "> connect devices" << endl;
|
cout << "> connect devices (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::Connect, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::Connect, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "j") {
|
} else if (command == "j") {
|
||||||
cout << "> init tasks" << endl;
|
cout << "> init tasks (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::InitTask, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::InitTask, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "r") {
|
} else if (command == "r") {
|
||||||
cout << "> run tasks" << endl;
|
cout << "> run tasks (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::Run, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::Run, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "s") {
|
} else if (command == "s") {
|
||||||
cout << "> stop devices" << endl;
|
cout << "> stop devices (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::Stop, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::Stop, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "t") {
|
} else if (command == "t") {
|
||||||
cout << "> reset tasks" << endl;
|
cout << "> reset tasks (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::ResetTask, std::chrono::milliseconds(timeout));
|
topo.ChangeState(TopologyTransition::ResetTask, path, std::chrono::milliseconds(timeout));
|
||||||
} else if (command == "d") {
|
} else if (command == "d") {
|
||||||
cout << "> reset devices" << endl;
|
cout << "> reset devices (" << path << ")" << endl;
|
||||||
topo.ChangeState(TopologyTransition::ResetDevice, std::chrono::milliseconds(timeout));
|
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") {
|
} else if (command == "h") {
|
||||||
cout << "> help" << endl;
|
cout << "> help" << endl;
|
||||||
printControlsHelp();
|
printControlsHelp();
|
||||||
} else if (command == "q") {
|
|
||||||
cout << "> end" << endl;
|
|
||||||
topo.ChangeState(TopologyTransition::End, std::chrono::milliseconds(timeout));
|
|
||||||
} else {
|
} else {
|
||||||
cout << "\033[01;32mInvalid input: [" << command << "]\033[0m" << endl;
|
cout << "\033[01;32mInvalid input: [" << command << "]\033[0m" << endl;
|
||||||
printControlsHelp();
|
printControlsHelp();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user