mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-06 04:40:02 +02:00
adc-
This commit is contained in:
parent
9d1cd09fd4
commit
da9c7c354e
@ -1957,29 +1957,25 @@ std::string CmdProxy::SlowAdc(int action) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[n_channel (0-7 for channel|8 for temperature)]\n\t[Ctb] Slow "
|
os << "[n_channel (0-7 for channel]\n\t[Ctb] Slow "
|
||||||
"ADC channel in mV or °C."
|
"ADC channel in mV"
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (args.size() != 1) {
|
if (args.size() != 1) {
|
||||||
WrongNumberOfParameters(0);
|
WrongNumberOfParameters(0);
|
||||||
}
|
}
|
||||||
int nchan = StringTo<int>(args[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]);
|
throw sls::RuntimeError("Unknown adc argument " + args[0]);
|
||||||
}
|
}
|
||||||
if (nchan == 8) {
|
auto t = det->getSlowADC(
|
||||||
auto t = det->getTemperature(defs::SLOW_ADC_TEMP, {det_id});
|
static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0), {det_id});
|
||||||
os << OutString(t) << " °C\n";
|
Result<double> result(t.size());
|
||||||
} else {
|
for (unsigned int i = 0; i < t.size(); ++i) {
|
||||||
auto t = det->getSlowADC(
|
result[i] = t[i] / 1000.00;
|
||||||
static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0), {det_id});
|
|
||||||
Result<double> result(t.size());
|
|
||||||
for (unsigned int i = 0; i < t.size(); ++i) {
|
|
||||||
result[i] = t[i] / 1000.00;
|
|
||||||
}
|
|
||||||
os << OutString(result) << " mV\n";
|
|
||||||
}
|
}
|
||||||
|
os << OutString(result) << " mV\n";
|
||||||
|
|
||||||
} else if (action == defs::PUT_ACTION) {
|
} else if (action == defs::PUT_ACTION) {
|
||||||
throw sls::RuntimeError("cannot put");
|
throw sls::RuntimeError("cannot put");
|
||||||
} else {
|
} else {
|
||||||
|
@ -614,6 +614,7 @@ class CmdProxy {
|
|||||||
/* Gotthard2 Specific */
|
/* Gotthard2 Specific */
|
||||||
/* Mythen3 Specific */
|
/* Mythen3 Specific */
|
||||||
/* CTB Specific */
|
/* CTB Specific */
|
||||||
|
{"adc", "slowadc"},
|
||||||
{"flags", "romode"},
|
{"flags", "romode"},
|
||||||
{"i_a", "im_a"},
|
{"i_a", "im_a"},
|
||||||
{"i_b", "im_b"},
|
{"i_b", "im_b"},
|
||||||
@ -938,7 +939,7 @@ class CmdProxy {
|
|||||||
{"im_c", &CmdProxy::im_c},
|
{"im_c", &CmdProxy::im_c},
|
||||||
{"im_d", &CmdProxy::im_d},
|
{"im_d", &CmdProxy::im_d},
|
||||||
{"im_io", &CmdProxy::im_io},
|
{"im_io", &CmdProxy::im_io},
|
||||||
{"adc", &CmdProxy::SlowAdc},
|
{"slowadc", &CmdProxy::SlowAdc},
|
||||||
{"extsampling", &CmdProxy::extsampling},
|
{"extsampling", &CmdProxy::extsampling},
|
||||||
{"extsamplingsrc", &CmdProxy::extsamplingsrc},
|
{"extsamplingsrc", &CmdProxy::extsamplingsrc},
|
||||||
{"rx_dbitlist", &CmdProxy::ReceiverDbitList},
|
{"rx_dbitlist", &CmdProxy::ReceiverDbitList},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user