This commit is contained in:
Erik Frojdh 2020-09-10 11:53:17 +02:00
parent 9d1cd09fd4
commit da9c7c354e
2 changed files with 12 additions and 15 deletions

View File

@ -1957,21 +1957,17 @@ std::string CmdProxy::SlowAdc(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_channel (0-7 for channel|8 for temperature)]\n\t[Ctb] Slow "
"ADC channel in mV or °C."
os << "[n_channel (0-7 for channel]\n\t[Ctb] Slow "
"ADC channel in mV"
<< '\n';
} else if (action == defs::GET_ACTION) {
if (args.size() != 1) {
WrongNumberOfParameters(0);
}
int nchan = StringTo<int>(args[0]);
if (nchan < 0 || nchan > defs::SLOW_ADC_TEMP - defs::SLOW_ADC0) {
if (nchan < 0 || nchan > 7) {
throw sls::RuntimeError("Unknown adc argument " + args[0]);
}
if (nchan == 8) {
auto t = det->getTemperature(defs::SLOW_ADC_TEMP, {det_id});
os << OutString(t) << " °C\n";
} else {
auto t = det->getSlowADC(
static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0), {det_id});
Result<double> result(t.size());
@ -1979,7 +1975,7 @@ std::string CmdProxy::SlowAdc(int action) {
result[i] = t[i] / 1000.00;
}
os << OutString(result) << " mV\n";
}
} else if (action == defs::PUT_ACTION) {
throw sls::RuntimeError("cannot put");
} else {

View File

@ -614,6 +614,7 @@ class CmdProxy {
/* Gotthard2 Specific */
/* Mythen3 Specific */
/* CTB Specific */
{"adc", "slowadc"},
{"flags", "romode"},
{"i_a", "im_a"},
{"i_b", "im_b"},
@ -938,7 +939,7 @@ class CmdProxy {
{"im_c", &CmdProxy::im_c},
{"im_d", &CmdProxy::im_d},
{"im_io", &CmdProxy::im_io},
{"adc", &CmdProxy::SlowAdc},
{"slowadc", &CmdProxy::SlowAdc},
{"extsampling", &CmdProxy::extsampling},
{"extsamplingsrc", &CmdProxy::extsamplingsrc},
{"rx_dbitlist", &CmdProxy::ReceiverDbitList},