This commit is contained in:
Erik Frojdh 2020-09-17 12:18:34 +02:00
parent 5d648443fa
commit 2d2e80469c
2 changed files with 235 additions and 176 deletions

View File

@ -603,14 +603,16 @@ std::string CmdProxy::Adcphase(int action) {
} }
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() == 1) { if (args.size() == 1) {
det->setADCPhase(StringTo<int>(args[0]), std::vector<int>{det_id}); det->setADCPhase(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << args.front() << '\n'; os << args.front() << '\n';
} else if (args.size() == 2) { } else if (args.size() == 2) {
if (args[1] != "deg") { if (args[1] != "deg") {
throw sls::RuntimeError("Unknown adcphase 2nd argument " + throw sls::RuntimeError("Unknown adcphase 2nd argument " +
args[1] + ". Did you mean deg?"); args[1] + ". Did you mean deg?");
} }
det->setADCPhaseInDegrees(StringTo<int>(args[0]), std::vector<int>{det_id}); det->setADCPhaseInDegrees(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << args[0] << " " << args[1] << '\n'; os << args[0] << " " << args[1] << '\n';
} else { } else {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
@ -655,14 +657,16 @@ std::string CmdProxy::Dbitphase(int action) {
} }
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() == 1) { if (args.size() == 1) {
det->setDBITPhase(StringTo<int>(args[0]), std::vector<int>{det_id}); det->setDBITPhase(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << args.front() << '\n'; os << args.front() << '\n';
} else if (args.size() == 2) { } else if (args.size() == 2) {
if (args[1] != "deg") { if (args[1] != "deg") {
throw sls::RuntimeError("Unknown dbitphase 2nd argument " + throw sls::RuntimeError("Unknown dbitphase 2nd argument " +
args[1] + ". Did you mean deg? "); args[1] + ". Did you mean deg? ");
} }
det->setDBITPhaseInDegrees(StringTo<int>(args[0]), std::vector<int>{det_id}); det->setDBITPhaseInDegrees(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << args[0] << " " << args[1] << '\n'; os << args[0] << " " << args[1] << '\n';
} else { } else {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
@ -691,14 +695,16 @@ std::string CmdProxy::ClockFrequency(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = det->getClockFrequency(StringTo<int>(args[0]), std::vector<int>{det_id}); auto t = det->getClockFrequency(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << OutString(t) << '\n'; os << OutString(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 2) { if (args.size() != 2) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
det->setClockFrequency(StringTo<int>(args[0]), det->setClockFrequency(StringTo<int>(args[0]),
StringTo<int>(args[1]), std::vector<int>{det_id}); StringTo<int>(args[1]),
std::vector<int>{det_id});
os << StringTo<int>(args[1]) << '\n'; os << StringTo<int>(args[1]) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -724,7 +730,8 @@ std::string CmdProxy::ClockPhase(int action) {
} }
if (action == defs::GET_ACTION) { if (action == defs::GET_ACTION) {
if (args.size() == 1) { if (args.size() == 1) {
auto t = det->getClockPhase(StringTo<int>(args[0]), std::vector<int>{det_id}); auto t = det->getClockPhase(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << OutString(t) << '\n'; os << OutString(t) << '\n';
} else if (args.size() == 2) { } else if (args.size() == 2) {
if (args[1] != "deg") { if (args[1] != "deg") {
@ -740,7 +747,8 @@ std::string CmdProxy::ClockPhase(int action) {
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() == 2) { if (args.size() == 2) {
det->setClockPhase(StringTo<int>(args[0]), det->setClockPhase(StringTo<int>(args[0]),
StringTo<int>(args[1]), std::vector<int>{det_id}); StringTo<int>(args[1]),
std::vector<int>{det_id});
os << args[1] << '\n'; os << args[1] << '\n';
} else if (args.size() == 3) { } else if (args.size() == 3) {
if (args[2] != "deg") { if (args[2] != "deg") {
@ -748,7 +756,8 @@ std::string CmdProxy::ClockPhase(int action) {
". Did you mean deg?"); ". Did you mean deg?");
} }
det->setClockPhaseinDegrees(StringTo<int>(args[0]), det->setClockPhaseinDegrees(StringTo<int>(args[0]),
StringTo<int>(args[1]), std::vector<int>{det_id}); StringTo<int>(args[1]),
std::vector<int>{det_id});
os << args[1] << " " << args[2] << '\n'; os << args[1] << " " << args[2] << '\n';
} else { } else {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
@ -777,8 +786,8 @@ std::string CmdProxy::MaxClockPhaseShift(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = auto t = det->getMaxClockPhaseShift(StringTo<int>(args[0]),
det->getMaxClockPhaseShift(StringTo<int>(args[0]), std::vector<int>{det_id}); std::vector<int>{det_id});
os << OutString(t) << '\n'; os << OutString(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
throw sls::RuntimeError("Cannot put"); throw sls::RuntimeError("Cannot put");
@ -806,7 +815,8 @@ std::string CmdProxy::ClockDivider(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = det->getClockDivider(StringTo<int>(args[0]), std::vector<int>{det_id}); auto t = det->getClockDivider(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << OutString(t) << '\n'; os << OutString(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 2) { if (args.size() != 2) {
@ -840,7 +850,8 @@ std::string CmdProxy::ExternalSignal(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = det->getExternalSignalFlags(StringTo<int>(args[0]), std::vector<int>{det_id}); auto t = det->getExternalSignalFlags(StringTo<int>(args[0]),
std::vector<int>{det_id});
os << args[0] << " " << OutString(t) << '\n'; os << args[0] << " " << OutString(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 2) { if (args.size() != 2) {
@ -848,7 +859,8 @@ std::string CmdProxy::ExternalSignal(int action) {
} }
det->setExternalSignalFlags( det->setExternalSignalFlags(
StringTo<int>(args[0]), StringTo<int>(args[0]),
StringTo<slsDetectorDefs::externalSignalFlag>(args[1]), std::vector<int>{det_id}); StringTo<slsDetectorDefs::externalSignalFlag>(args[1]),
std::vector<int>{det_id});
os << args[0] << " " << args[1] << '\n'; os << args[0] << " " << args[1] << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -872,10 +884,14 @@ std::string CmdProxy::TemperatureValues(int action) {
if (t.size() > 0) { if (t.size() > 0) {
auto it = t.cbegin(); auto it = t.cbegin();
os << ToString(*it) << ' '; os << ToString(*it) << ' ';
os << OutString(det->getTemperature(*it++, std::vector<int>{det_id})) << " °C"; os << OutString(
det->getTemperature(*it++, std::vector<int>{det_id}))
<< " °C";
while (it != t.cend()) { while (it != t.cend()) {
os << ", " << ToString(*it) << ' '; os << ", " << ToString(*it) << ' ';
os << OutString(det->getTemperature(*it++, std::vector<int>{det_id})) << " °C"; os << OutString(
det->getTemperature(*it++, std::vector<int>{det_id}))
<< " °C";
} }
} }
os << "]\n"; os << "]\n";
@ -911,8 +927,9 @@ std::string CmdProxy::Dac(int action) {
} else if (args.size() > 2) { } else if (args.size() > 2) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = det->getDAC( auto t =
static_cast<defs::dacIndex>(StringTo<int>(args[0])), mv, std::vector<int>{det_id}); det->getDAC(static_cast<defs::dacIndex>(StringTo<int>(args[0])), mv,
std::vector<int>{det_id});
os << args[0] << ' ' << OutString(t) os << args[0] << ' ' << OutString(t)
<< (args.size() > 1 ? " mV\n" : "\n"); << (args.size() > 1 ? " mV\n" : "\n");
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
@ -1241,9 +1258,10 @@ std::string CmdProxy::Threshold(int action) {
os << OutString(t) << '\n'; os << OutString(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() == 1) { if (args.size() == 1) {
auto t = det->getSettings(std::vector<int>{det_id}).tsquash( auto t = det->getSettings(std::vector<int>{det_id})
"Inconsistent settings between detectors"); .tsquash("Inconsistent settings between detectors");
det->setThresholdEnergy(StringTo<int>(args[0]), t, true, std::vector<int>{det_id}); det->setThresholdEnergy(StringTo<int>(args[0]), t, true,
std::vector<int>{det_id});
} else if (args.size() == 2) { } else if (args.size() == 2) {
det->setThresholdEnergy( det->setThresholdEnergy(
StringTo<int>(args[0]), StringTo<int>(args[0]),
@ -1271,9 +1289,10 @@ std::string CmdProxy::ThresholdNoTb(int action) {
throw sls::RuntimeError("cannot get"); throw sls::RuntimeError("cannot get");
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() == 1) { if (args.size() == 1) {
auto t = det->getSettings(std::vector<int>{det_id}).tsquash( auto t = det->getSettings(std::vector<int>{det_id})
"Inconsistent settings between detectors"); .tsquash("Inconsistent settings between detectors");
det->setThresholdEnergy(StringTo<int>(args[0]), t, false, std::vector<int>{det_id}); det->setThresholdEnergy(StringTo<int>(args[0]), t, false,
std::vector<int>{det_id});
} else if (args.size() == 2) { } else if (args.size() == 2) {
det->setThresholdEnergy( det->setThresholdEnergy(
StringTo<int>(args[0]), StringTo<int>(args[0]),
@ -1632,14 +1651,16 @@ std::string CmdProxy::VetoPhoton(int action) {
if (args.size() != 2) { if (args.size() != 2) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
det->getVetoPhoton(StringTo<int>(args[0]), args[1], std::vector<int>{det_id}); det->getVetoPhoton(StringTo<int>(args[0]), args[1],
std::vector<int>{det_id});
os << "saved to file " << args[1] << '\n'; os << "saved to file " << args[1] << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 4) { if (args.size() != 4) {
WrongNumberOfParameters(4); WrongNumberOfParameters(4);
} }
det->setVetoPhoton(StringTo<int>(args[0]), StringTo<int>(args[1]), det->setVetoPhoton(StringTo<int>(args[0]), StringTo<int>(args[1]),
StringTo<int>(args[2]), args[3], std::vector<int>{det_id}); StringTo<int>(args[2]), args[3],
std::vector<int>{det_id});
os << sls::ToString(args) << '\n'; os << sls::ToString(args) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -1684,7 +1705,8 @@ std::string CmdProxy::VetoFile(int action) {
if (args.size() != 2) { if (args.size() != 2) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
det->setVetoFile(StringTo<int>(args[0]), args[1], std::vector<int>{det_id}); det->setVetoFile(StringTo<int>(args[0]), args[1],
std::vector<int>{det_id});
os << sls::ToString(args) << '\n'; os << sls::ToString(args) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -1755,7 +1777,8 @@ std::string CmdProxy::ConfigureADC(int action) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
auto t = det->getADCConfiguration(StringTo<int>(args[0]), auto t = det->getADCConfiguration(StringTo<int>(args[0]),
StringTo<int>(args[1]), std::vector<int>{det_id}); StringTo<int>(args[1]),
std::vector<int>{det_id});
os << OutStringHex(t) << '\n'; os << OutStringHex(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 3) { if (args.size() != 3) {
@ -1948,10 +1971,12 @@ std::string CmdProxy::Samples(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
det->setNumberOfAnalogSamples(StringTo<int>(args[0]), std::vector<int>{det_id}); det->setNumberOfAnalogSamples(StringTo<int>(args[0]),
std::vector<int>{det_id});
// set also digital samples for ctb // set also digital samples for ctb
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) { if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
det->setNumberOfDigitalSamples(StringTo<int>(args[0]), std::vector<int>{det_id}); det->setNumberOfDigitalSamples(StringTo<int>(args[0]),
std::vector<int>{det_id});
} }
os << args.front() << '\n'; os << args.front() << '\n';
} else { } else {
@ -1978,7 +2003,8 @@ std::string CmdProxy::SlowAdc(int action) {
throw sls::RuntimeError("Unknown adc argument " + args[0]); throw sls::RuntimeError("Unknown adc argument " + args[0]);
} }
auto t = det->getSlowADC( auto t = det->getSlowADC(
static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0), std::vector<int>{det_id}); static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0),
std::vector<int>{det_id});
Result<double> result(t.size()); Result<double> result(t.size());
for (unsigned int i = 0; i < t.size(); ++i) { for (unsigned int i = 0; i < t.size(); ++i) {
result[i] = t[i] / 1000.00; result[i] = t[i] / 1000.00;
@ -2048,7 +2074,8 @@ std::string CmdProxy::DigitalIODelay(int action) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
det->setDigitalIODelay(StringTo<uint64_t>(args[0]), det->setDigitalIODelay(StringTo<uint64_t>(args[0]),
StringTo<int>(args[1]), std::vector<int>{det_id}); StringTo<int>(args[1]),
std::vector<int>{det_id});
os << sls::ToString(args) << '\n'; os << sls::ToString(args) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -2152,7 +2179,8 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
if (!args.empty()) { if (!args.empty()) {
WrongNumberOfParameters(0); WrongNumberOfParameters(0);
} }
auto t = det->getPatternLoopAddresses(level, std::vector<int>{det_id}); auto t =
det->getPatternLoopAddresses(level, std::vector<int>{det_id});
os << OutStringHex(t, 4) << '\n'; os << OutStringHex(t, 4) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 2) { if (args.size() != 2) {
@ -2160,7 +2188,8 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
} }
int start = StringTo<int>(args[0]); int start = StringTo<int>(args[0]);
int stop = StringTo<int>(args[1]); int stop = StringTo<int>(args[1]);
det->setPatternLoopAddresses(level, start, stop, std::vector<int>{det_id}); det->setPatternLoopAddresses(level, start, stop,
std::vector<int>{det_id});
os << '[' << ToStringHex(start, 4) << ", " << ToStringHex(stop, 4) os << '[' << ToStringHex(start, 4) << ", " << ToStringHex(stop, 4)
<< "]\n"; << "]\n";
} else { } else {
@ -2212,7 +2241,8 @@ std::string CmdProxy::PatternLoopCycles(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
det->setPatternLoopCycles(level, StringTo<int>(args[0]), std::vector<int>{det_id}); det->setPatternLoopCycles(level, StringTo<int>(args[0]),
std::vector<int>{det_id});
os << args.front() << '\n'; os << args.front() << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -2370,15 +2400,18 @@ std::string CmdProxy::JsonParameter(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = det->getAdditionalJsonParameter(args[0], std::vector<int>{det_id}); auto t =
det->getAdditionalJsonParameter(args[0], std::vector<int>{det_id});
os << OutString(t) << '\n'; os << OutString(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
switch (args.size()) { switch (args.size()) {
case 1: case 1:
det->setAdditionalJsonParameter(args[0], "", std::vector<int>{det_id}); det->setAdditionalJsonParameter(args[0], "",
std::vector<int>{det_id});
break; break;
case 2: case 2:
det->setAdditionalJsonParameter(args[0], args[1], std::vector<int>{det_id}); det->setAdditionalJsonParameter(args[0], args[1],
std::vector<int>{det_id});
break; break;
default: default:
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
@ -2460,7 +2493,8 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) {
if (args[2].find(".pof") == std::string::npos) { if (args[2].find(".pof") == std::string::npos) {
throw sls::RuntimeError("Programming file must be a pof file."); throw sls::RuntimeError("Programming file must be a pof file.");
} }
det->updateFirmwareAndServer(args[0], args[1], args[2], std::vector<int>{det_id}); det->updateFirmwareAndServer(args[0], args[1], args[2],
std::vector<int>{det_id});
os << "successful\n"; os << "successful\n";
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -2480,14 +2514,16 @@ std::string CmdProxy::Register(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
auto t = det->readRegister(StringTo<uint32_t>(args[0]), std::vector<int>{det_id}); auto t = det->readRegister(StringTo<uint32_t>(args[0]),
std::vector<int>{det_id});
os << OutStringHex(t) << '\n'; os << OutStringHex(t) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (args.size() != 2) { if (args.size() != 2) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
det->writeRegister(StringTo<uint32_t>(args[0]), det->writeRegister(StringTo<uint32_t>(args[0]),
StringTo<uint32_t>(args[1]), std::vector<int>{det_id}); StringTo<uint32_t>(args[1]),
std::vector<int>{det_id});
os << sls::ToString(args) << '\n'; os << sls::ToString(args) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
@ -2510,7 +2546,8 @@ std::string CmdProxy::AdcRegister(int action) {
WrongNumberOfParameters(2); WrongNumberOfParameters(2);
} }
det->writeAdcRegister(StringTo<uint32_t>(args[0]), det->writeAdcRegister(StringTo<uint32_t>(args[0]),
StringTo<uint32_t>(args[1]), std::vector<int>{det_id}); StringTo<uint32_t>(args[1]),
std::vector<int>{det_id});
os << sls::ToString(args) << '\n'; os << sls::ToString(args) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");

View File

@ -183,7 +183,6 @@
return os.str(); \ return os.str(); \
} }
/** int or enum */ /** int or enum */
#define INTEGER_COMMAND_VEC_ID_GET(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \ #define INTEGER_COMMAND_VEC_ID_GET(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
std::string CMDNAME(const int action) { \ std::string CMDNAME(const int action) { \
@ -1189,7 +1188,8 @@ class CmdProxy {
GET_COMMAND_NOID(settingslist, getSettingsList, GET_COMMAND_NOID(settingslist, getSettingsList,
"\n\tList of settings implemented for this detector."); "\n\tList of settings implemented for this detector.");
INTEGER_COMMAND_VEC_ID(settings, getSettings, setSettings, INTEGER_COMMAND_VEC_ID(
settings, getSettings, setSettings,
sls::StringTo<slsDetectorDefs::detectorSettings>, sls::StringTo<slsDetectorDefs::detectorSettings>,
"[standard, fast, highgain, dynamicgain, lowgain, " "[standard, fast, highgain, dynamicgain, lowgain, "
"mediumgain, veryhighgain, dynamichg0, " "mediumgain, veryhighgain, dynamichg0, "
@ -1212,7 +1212,8 @@ class CmdProxy {
"[fname]\n\t[Eiger][Mythen3] Loads the trimbit file to detector. If no " "[fname]\n\t[Eiger][Mythen3] Loads the trimbit file to detector. If no "
"extension specified, serial number of each module is attached."); "extension specified, serial number of each module is attached.");
INTEGER_COMMAND_VEC_ID(trimval, getAllTrimbits, setAllTrimbits, StringTo<int>, INTEGER_COMMAND_VEC_ID(
trimval, getAllTrimbits, setAllTrimbits, StringTo<int>,
"[n_trimval]\n\t[Eiger][Mythen3] All trimbits set to this " "[n_trimval]\n\t[Eiger][Mythen3] All trimbits set to this "
"value. Returns -1 if all trimbits are different values."); "value. Returns -1 if all trimbits are different values.");
@ -1262,7 +1263,8 @@ class CmdProxy {
GET_COMMAND_NOID(drlist, getDynamicRangeList, GET_COMMAND_NOID(drlist, getDynamicRangeList,
"\n\tGets the list of dynamic ranges for this detector."); "\n\tGets the list of dynamic ranges for this detector.");
INTEGER_COMMAND_VEC_ID(timing, getTimingMode, setTimingMode, INTEGER_COMMAND_VEC_ID(
timing, getTimingMode, setTimingMode,
sls::StringTo<slsDetectorDefs::timingMode>, sls::StringTo<slsDetectorDefs::timingMode>,
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of " "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of "
"detector.\n\t[Jungfrau][Gotthard][Ctb][Moench][Gotthard2] " "detector.\n\t[Jungfrau][Gotthard][Ctb][Moench][Gotthard2] "
@ -1281,13 +1283,15 @@ class CmdProxy {
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the " "\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the "
"clock to latch digital bits."); "clock to latch digital bits.");
INTEGER_COMMAND_VEC_ID(highvoltage, getHighVoltage, setHighVoltage, StringTo<int>, INTEGER_COMMAND_VEC_ID(highvoltage, getHighVoltage, setHighVoltage,
StringTo<int>,
"[n_value]\n\tHigh voltage to the sensor in Voltage." "[n_value]\n\tHigh voltage to the sensor in Voltage."
"\n\t[Gotthard] [0|90|110|120|150|180|200]" "\n\t[Gotthard] [0|90|110|120|150|180|200]"
"\n\t[Eiger][Mythen3][Gotthard2] 0-200" "\n\t[Eiger][Mythen3][Gotthard2] 0-200"
"\n\t[Jungfrau][Ctb][Moench] [0|60-200]"); "\n\t[Jungfrau][Ctb][Moench] [0|60-200]");
INTEGER_COMMAND_VEC_ID(powerchip, getPowerChip, setPowerChip, StringTo<int>, INTEGER_COMMAND_VEC_ID(
powerchip, getPowerChip, setPowerChip, StringTo<int>,
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power " "[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power "
"the chip. Default 0." "the chip. Default 0."
"\n\t[Jungfrau] Get will return power status." "\n\t[Jungfrau] Get will return power status."
@ -1305,7 +1309,8 @@ class CmdProxy {
"\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel " "\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel "
"intensity incremented by 1. If 1, all pixels almost saturated."); "intensity incremented by 1. If 1, all pixels almost saturated.");
INTEGER_COMMAND_VEC_ID(parallel, getParallelMode, setParallelMode, StringTo<int>, INTEGER_COMMAND_VEC_ID(
parallel, getParallelMode, setParallelMode, StringTo<int>,
"[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel " "[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel "
"mode.\n\t[Mythen3] If exptime is too short, the " "mode.\n\t[Mythen3] If exptime is too short, the "
"acquisition will return ERROR status and take fewer " "acquisition will return ERROR status and take fewer "
@ -1693,8 +1698,9 @@ class CmdProxy {
GET_COMMAND(rx_missingpackets, getNumMissingPackets, GET_COMMAND(rx_missingpackets, getNumMissingPackets,
"\n\tNumber of missing packets for each port in receiver."); "\n\tNumber of missing packets for each port in receiver.");
INTEGER_COMMAND_VEC_ID(startingfnum, getStartingFrameNumber, INTEGER_COMMAND_VEC_ID(
setStartingFrameNumber, StringTo<uint64_t>, startingfnum, getStartingFrameNumber, setStartingFrameNumber,
StringTo<uint64_t>,
"[n_value]\n\t[Eiger][Jungfrau] Starting frame number for " "[n_value]\n\t[Eiger][Jungfrau] Starting frame number for "
"next acquisition. Stopping acquiistion might result in " "next acquisition. Stopping acquiistion might result in "
"different frame numbers for different modules."); "different frame numbers for different modules.");
@ -1726,7 +1732,8 @@ class CmdProxy {
"[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. " "[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. "
"Effective only when number of interfaces is 1. Default: 0 (outer)"); "Effective only when number of interfaces is 1. Default: 0 (outer)");
INTEGER_COMMAND_VEC_ID(udp_srcip, getSourceUDPIP, setSourceUDPIP, IpAddr, INTEGER_COMMAND_VEC_ID(
udp_srcip, getSourceUDPIP, setSourceUDPIP, IpAddr,
"[x.x.x.x]\n\tIp address of the detector (source) udp " "[x.x.x.x]\n\tIp address of the detector (source) udp "
"interface. Must be same subnet as destination udp " "interface. Must be same subnet as destination udp "
"ip.\n\t[Eiger] Set only for 10G. For 1G, detector will " "ip.\n\t[Eiger] Set only for 10G. For 1G, detector will "
@ -1744,7 +1751,8 @@ class CmdProxy {
"interface. \n\t[Eiger] Do not set as detector will replace with its " "interface. \n\t[Eiger] Do not set as detector will replace with its "
"own DHCP Mac (1G) or DHCP Mac + 1 (10G)."); "own DHCP Mac (1G) or DHCP Mac + 1 (10G).");
INTEGER_COMMAND_VEC_ID(udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr, INTEGER_COMMAND_VEC_ID(
udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr,
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the bottom " "[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the bottom "
"half of detector (source) udp interface. "); "half of detector (source) udp interface. ");
@ -1770,8 +1778,9 @@ class CmdProxy {
"interface. Default is 50001. \n\tIf multi command, ports for each " "interface. Default is 50001. \n\tIf multi command, ports for each "
"module is calculated (incremented by 1 if no 2nd interface)"); "module is calculated (incremented by 1 if no 2nd interface)");
INTEGER_COMMAND_VEC_ID_GET(udp_dstport2, getDestinationUDPPort2, INTEGER_COMMAND_VEC_ID_GET(
setDestinationUDPPort2, StringTo<int>, udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2,
StringTo<int>,
"[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the " "[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the "
"receiver (destination) udp interface 2. Default is 50002. " "receiver (destination) udp interface 2. Default is 50002. "
"\n\tIf multi command, ports for each module is calculated " "\n\tIf multi command, ports for each module is calculated "
@ -1793,7 +1802,8 @@ class CmdProxy {
GET_COMMAND(rx_printconfig, printRxConfiguration, GET_COMMAND(rx_printconfig, printRxConfiguration,
"\n\tPrints the receiver configuration."); "\n\tPrints the receiver configuration.");
INTEGER_COMMAND_VEC_ID(tengiga, getTenGiga, setTenGiga, StringTo<int>, INTEGER_COMMAND_VEC_ID(
tengiga, getTenGiga, setTenGiga, StringTo<int>,
"[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable."); "[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable.");
INTEGER_COMMAND_VEC_ID(flowcontrol10g, getTenGigaFlowControl, INTEGER_COMMAND_VEC_ID(flowcontrol10g, getTenGigaFlowControl,
@ -1834,7 +1844,8 @@ class CmdProxy {
"first command to set a receiver parameter. Multi command will " "first command to set a receiver parameter. Multi command will "
"automatically increment for individual modules."); "automatically increment for individual modules.");
INTEGER_COMMAND_VEC_ID(rx_fifodepth, getRxFifoDepth, setRxFifoDepth, StringTo<int>, INTEGER_COMMAND_VEC_ID(
rx_fifodepth, getRxFifoDepth, setRxFifoDepth, StringTo<int>,
"[n_frames]\n\tSet the number of frames in the receiver " "[n_frames]\n\tSet the number of frames in the receiver "
"fifo depth (buffer between listener and writer threads)."); "fifo depth (buffer between listener and writer threads).");
@ -1865,7 +1876,8 @@ class CmdProxy {
"\n\tActual udp socket buffer size. Double the size of " "\n\tActual udp socket buffer size. Double the size of "
"rx_udpsocksize due to kernel bookkeeping."); "rx_udpsocksize due to kernel bookkeeping.");
INTEGER_COMMAND_VEC_ID(rx_lock, getRxLock, setRxLock, StringTo<int>, INTEGER_COMMAND_VEC_ID(
rx_lock, getRxLock, setRxLock, StringTo<int>,
"[0, 1]\n\tLock receiver to one client IP, 1 locks, 0 " "[0, 1]\n\tLock receiver to one client IP, 1 locks, 0 "
"unlocks. Default is unlocked. 1: locks"); "unlocks. Default is unlocked. 1: locks");
@ -1915,8 +1927,8 @@ class CmdProxy {
foverwrite, getFileOverWrite, setFileOverWrite, StringTo<int>, foverwrite, getFileOverWrite, setFileOverWrite, StringTo<int>,
"[0, 1]\n\tEnable or disable file overwriting. Default is 1."); "[0, 1]\n\tEnable or disable file overwriting. Default is 1.");
INTEGER_COMMAND_VEC_ID(rx_framesperfile, getFramesPerFile, setFramesPerFile, INTEGER_COMMAND_VEC_ID(
StringTo<int>, rx_framesperfile, getFramesPerFile, setFramesPerFile, StringTo<int>,
"[n_frames]\n\tNumber of frames per file in receiver. 0 is " "[n_frames]\n\tNumber of frames per file in receiver. 0 is "
"infinite or all frames in single file."); "infinite or all frames in single file.");
@ -1939,8 +1951,9 @@ class CmdProxy {
"timeout, after which current frame is sent out. (default timeout is " "timeout, after which current frame is sent out. (default timeout is "
"200 ms). Usually used for gui purposes."); "200 ms). Usually used for gui purposes.");
INTEGER_COMMAND_VEC_ID(rx_zmqstartfnum, getRxZmqStartingFrame, INTEGER_COMMAND_VEC_ID(
setRxZmqStartingFrame, StringTo<int>, rx_zmqstartfnum, getRxZmqStartingFrame, setRxZmqStartingFrame,
StringTo<int>,
"[fnum]\n\tThe starting frame index to stream out. 0 by " "[fnum]\n\tThe starting frame index to stream out. 0 by "
"default, which streams the first frame in an acquisition, " "default, which streams the first frame in an acquisition, "
"and then depending on the rx zmq frequency/ timer"); "and then depending on the rx zmq frequency/ timer");
@ -1993,7 +2006,8 @@ class CmdProxy {
settingspath, getSettingsPath, setSettingsPath, settingspath, getSettingsPath, setSettingsPath,
"[path]\n\t[Eiger] Directory where settings files are loaded from/to."); "[path]\n\t[Eiger] Directory where settings files are loaded from/to.");
INTEGER_COMMAND_VEC_ID(overflow, getOverFlowMode, setOverFlowMode, StringTo<int>, INTEGER_COMMAND_VEC_ID(
overflow, getOverFlowMode, setOverFlowMode, StringTo<int>,
"[0, 1]\n\t[Eiger] Enable or disable show overflow flag in " "[0, 1]\n\t[Eiger] Enable or disable show overflow flag in "
"32 bit mode. Default is disabled."); "32 bit mode. Default is disabled.");
@ -2009,8 +2023,9 @@ class CmdProxy {
"starting from the centre. 256 is default. The permissible values " "starting from the centre. 256 is default. The permissible values "
"depend on dynamic range and 10Gbe enabled."); "depend on dynamic range and 10Gbe enabled.");
INTEGER_COMMAND_VEC_ID(interruptsubframe, getInterruptSubframe, INTEGER_COMMAND_VEC_ID(
setInterruptSubframe, StringTo<int>, interruptsubframe, getInterruptSubframe, setInterruptSubframe,
StringTo<int>,
"[0, 1]\n\t[Eiger] 1 interrupts last subframe at required " "[0, 1]\n\t[Eiger] 1 interrupts last subframe at required "
"exposure time. 0 will wait for last sub frame to finish " "exposure time. 0 will wait for last sub frame to finish "
"exposing. 0 is default."); "exposing. 0 is default.");
@ -2096,7 +2111,8 @@ class CmdProxy {
"[duration] [(optional unit) ns|us|ms|s]\n\t[Gotthard2] Burst " "[duration] [(optional unit) ns|us|ms|s]\n\t[Gotthard2] Burst "
"period. Only in burst mode and auto timing mode."); "period. Only in burst mode and auto timing mode.");
INTEGER_COMMAND_VEC_ID(cdsgain, getCDSGain, setCDSGain, StringTo<bool>, INTEGER_COMMAND_VEC_ID(
cdsgain, getCDSGain, setCDSGain, StringTo<bool>,
"[0, 1]\n\t[Gotthard2] Enable or disable CDS gain. Default " "[0, 1]\n\t[Gotthard2] Enable or disable CDS gain. Default "
"is disabled."); "is disabled.");
@ -2104,8 +2120,8 @@ class CmdProxy {
filter, getFilter, setFilter, StringTo<int>, filter, getFilter, setFilter, StringTo<int>,
"[0|1|2|3]\n\t[Gotthard2] Set filter resistor. Default is 0."); "[0|1|2|3]\n\t[Gotthard2] Set filter resistor. Default is 0.");
INTEGER_COMMAND_VEC_ID(currentsource, getCurrentSource, setCurrentSource, INTEGER_COMMAND_VEC_ID(
StringTo<int>, currentsource, getCurrentSource, setCurrentSource, StringTo<int>,
"[0, 1]\n\t[Gotthard2] Enable or disable current source. " "[0, 1]\n\t[Gotthard2] Enable or disable current source. "
"Default is disabled."); "Default is disabled.");
@ -2121,7 +2137,8 @@ class CmdProxy {
/* Mythen3 Specific */ /* Mythen3 Specific */
INTEGER_COMMAND_VEC_ID(gates, getNumberOfGates, setNumberOfGates, StringTo<int>, INTEGER_COMMAND_VEC_ID(
gates, getNumberOfGates, setNumberOfGates, StringTo<int>,
"[n_gates]\n\t[Mythen3] Number of external gates in gating " "[n_gates]\n\t[Mythen3] Number of external gates in gating "
"or trigger_gating mode (external gating)."); "or trigger_gating mode (external gating).");
@ -2142,7 +2159,8 @@ class CmdProxy {
GET_COMMAND(syncclk, getSYNCClock, GET_COMMAND(syncclk, getSYNCClock,
"[n_clk in MHz]\n\t[Ctb][Moench] Sync clock in MHz."); "[n_clk in MHz]\n\t[Ctb][Moench] Sync clock in MHz.");
INTEGER_COMMAND_VEC_ID(adcpipeline, getADCPipeline, setADCPipeline, StringTo<int>, INTEGER_COMMAND_VEC_ID(
adcpipeline, getADCPipeline, setADCPipeline, StringTo<int>,
"[n_value]\n\t[Ctb][Moench] Pipeline for ADC clock."); "[n_value]\n\t[Ctb][Moench] Pipeline for ADC clock.");
INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo<int>, INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo<int>,
@ -2164,11 +2182,13 @@ class CmdProxy {
/* CTB Specific */ /* CTB Specific */
INTEGER_COMMAND_VEC_ID(dsamples, getNumberOfDigitalSamples, INTEGER_COMMAND_VEC_ID(
setNumberOfDigitalSamples, StringTo<int>, dsamples, getNumberOfDigitalSamples, setNumberOfDigitalSamples,
StringTo<int>,
"[n_value]\n\t[CTB] Number of digital samples expected."); "[n_value]\n\t[CTB] Number of digital samples expected.");
INTEGER_COMMAND_VEC_ID(romode, getReadoutMode, setReadoutMode, INTEGER_COMMAND_VEC_ID(
romode, getReadoutMode, setReadoutMode,
sls::StringTo<slsDetectorDefs::readoutMode>, sls::StringTo<slsDetectorDefs::readoutMode>,
"[analog|digital|analog_digital]\n\t[CTB] Readout mode. " "[analog|digital|analog_digital]\n\t[CTB] Readout mode. "
"Default is analog."); "Default is analog.");
@ -2243,13 +2263,14 @@ class CmdProxy {
"[0, 1]\n\t[Ctb] Enable for external sampling signal to extsamplingsrc " "[0, 1]\n\t[Ctb] Enable for external sampling signal to extsamplingsrc "
"signal for digital data. For advanced users only."); "signal for digital data. For advanced users only.");
INTEGER_COMMAND_VEC_ID(extsamplingsrc, getExternalSamplingSource, INTEGER_COMMAND_VEC_ID(
setExternalSamplingSource, StringTo<int>, extsamplingsrc, getExternalSamplingSource, setExternalSamplingSource,
StringTo<int>,
"[0-63]\n\t[Ctb] Sampling source signal for digital data. " "[0-63]\n\t[Ctb] Sampling source signal for digital data. "
"For advanced users only."); "For advanced users only.");
INTEGER_COMMAND_VEC_ID(rx_dbitoffset, getRxDbitOffset, setRxDbitOffset, INTEGER_COMMAND_VEC_ID(
StringTo<int>, rx_dbitoffset, getRxDbitOffset, setRxDbitOffset, StringTo<int>,
"[n_bytes]\n\t[Ctb] Offset in bytes in digital data to " "[n_bytes]\n\t[Ctb] Offset in bytes in digital data to "
"skip in receiver."); "skip in receiver.");
@ -2319,7 +2340,8 @@ class CmdProxy {
"[n]\n\tPort number of the stop server on detector for detector-client " "[n]\n\tPort number of the stop server on detector for detector-client "
"tcp interface. Default is 1953. Normally unchanged."); "tcp interface. Default is 1953. Normally unchanged.");
INTEGER_COMMAND_VEC_ID(lock, getDetectorLock, setDetectorLock, StringTo<int>, INTEGER_COMMAND_VEC_ID(lock, getDetectorLock, setDetectorLock,
StringTo<int>,
"[0, 1]\n\tLock detector to one IP, 1: locks"); "[0, 1]\n\tLock detector to one IP, 1: locks");
GET_COMMAND( GET_COMMAND(