mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 08:17:13 +02:00
g2: setting serialnumber allowed
This commit is contained in:
@ -257,6 +257,32 @@ std::string CmdProxy::FirmwareVersion(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::SerialNumber(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == slsDetectorDefs::HELP_ACTION)
|
||||
os << "\n\tSerial number of detector.\n\t[Gotthard2] Can overwrite, "
|
||||
"but must do so for every detector server restart."
|
||||
<< '\n';
|
||||
else if (action == slsDetectorDefs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getSerialNumber(std::vector<int>{det_id});
|
||||
os << OutStringHex(t) << '\n';
|
||||
} else if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
WrongNumberOfParameters(1);
|
||||
}
|
||||
det->setSerialNumber(StringTo<int64_t>(args[0]),
|
||||
std::vector<int>{det_id});
|
||||
os << args[0] << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::Versions(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
|
Reference in New Issue
Block a user