mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 00:07:13 +02:00
module id instead of serial number
This commit is contained in:
@ -257,33 +257,6 @@ 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 and "
|
||||
"is sent out as mod_id in sls_detector_header in header of UDP "
|
||||
"data packet streamed out from detector."
|
||||
<< '\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 << ' ';
|
||||
|
@ -758,7 +758,8 @@ class CmdProxy {
|
||||
{"firmwareversion", &CmdProxy::FirmwareVersion},
|
||||
{"detectorserverversion", &CmdProxy::detectorserverversion},
|
||||
{"rx_version", &CmdProxy::rx_version},
|
||||
{"serialnumber", &CmdProxy::SerialNumber},
|
||||
{"serialnumber", &CmdProxy::serialnumber},
|
||||
{"moduleid", &CmdProxy::moduleid},
|
||||
{"type", &CmdProxy::type},
|
||||
{"nmod", &CmdProxy::nmod},
|
||||
{"detsize", &CmdProxy::DetectorSize},
|
||||
@ -1078,7 +1079,6 @@ class CmdProxy {
|
||||
std::string Hostname(int action);
|
||||
std::string VirtualServer(int action);
|
||||
std::string FirmwareVersion(int action);
|
||||
std::string SerialNumber(int action);
|
||||
std::string Versions(int action);
|
||||
std::string PackageVersion(int action);
|
||||
std::string ClientVersion(int action);
|
||||
@ -1192,6 +1192,14 @@ class CmdProxy {
|
||||
GET_COMMAND_HEX(rx_version, getReceiverVersion,
|
||||
"\n\tReceiver version in format [0xYYMMDD].");
|
||||
|
||||
GET_COMMAND_HEX(serialnumber, getSerialNumber,
|
||||
"\n\tSerial number of detector.");
|
||||
|
||||
INTEGER_COMMAND_HEX(
|
||||
moduleid, getModuleId, setModuleId, StringTo<int>,
|
||||
"[value]\n\t[Gotthard2] 16 bit value (ideally unique) that is "
|
||||
"streamed out in the UDP header of the detector. Default is 0.");
|
||||
|
||||
GET_COMMAND(type, getDetectorType,
|
||||
"\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, "
|
||||
"Moench, Mythen3, Gotthard2, ChipTestBoard");
|
||||
|
@ -119,8 +119,12 @@ Result<int64_t> Detector::getSerialNumber(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getSerialNumber, pos);
|
||||
}
|
||||
|
||||
void Detector::setSerialNumber(const int64_t value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setSerialNumber, pos, value);
|
||||
Result<int> Detector::getModuleId(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getModuleId, pos);
|
||||
}
|
||||
|
||||
void Detector::setModuleId(const int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setModuleId, pos, value);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getReceiverVersion(Positions pos) const {
|
||||
|
@ -94,8 +94,10 @@ int64_t Module::getSerialNumber() const {
|
||||
return sendToDetector<int64_t>(F_GET_SERIAL_NUMBER);
|
||||
}
|
||||
|
||||
void Module::setSerialNumber(const int64_t value) {
|
||||
return sendToDetector(F_SET_SERIAL_NUMBER, value, nullptr);
|
||||
int Module::getModuleId() const { return sendToDetector<int>(F_GET_MODULE_ID); }
|
||||
|
||||
void Module::setModuleId(const int value) {
|
||||
return sendToDetector(F_SET_MODULE_ID, value, nullptr);
|
||||
}
|
||||
|
||||
int64_t Module::getReceiverSoftwareVersion() const {
|
||||
|
@ -90,7 +90,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
int64_t getFirmwareVersion() const;
|
||||
int64_t getDetectorServerVersion() const;
|
||||
int64_t getSerialNumber() const;
|
||||
void setSerialNumber(const int64_t value);
|
||||
int getModuleId() const;
|
||||
void setModuleId(const int value);
|
||||
int64_t getReceiverSoftwareVersion() const;
|
||||
static detectorType getTypeFromDetector(const std::string &hostname,
|
||||
int cport = DEFAULT_PORTNO);
|
||||
|
Reference in New Issue
Block a user