* added api in detector class for adcvpp, taken out of dac list
This commit is contained in:
Dhanya Thattil
2022-10-20 10:58:56 +02:00
committed by GitHub
parent af300e0276
commit b7cdfbb4d2
8 changed files with 65 additions and 14 deletions

View File

@ -2556,6 +2556,51 @@ std::string CmdProxy::Samples(int action) {
}
/* CTB Specific */
std::string CmdProxy::AdcVpp(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[dac or mV value][(optional unit) mV] \n\t[Ctb][Moench] Vpp of "
"ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V. "
"\n\tAdvanced User function!\n"
<< '\n';
return os.str();
}
if (action == defs::GET_ACTION) {
bool mV = false;
if (args.size() == 1) {
if ((args[0] != "mv") && (args[0] != "mV")) {
throw RuntimeError("Unknown argument " + args[0] +
". Did you mean mV?");
}
mV = true;
} else if (args.size() > 1) {
WrongNumberOfParameters(1);
}
auto t = det->getADCVpp(mV, std::vector<int>{det_id});
os << OutString(t) << (mV ? " mV\n" : "\n");
} else if (action == defs::PUT_ACTION) {
bool mV = false;
if (args.size() == 2) {
if ((args[1] != "mv") && (args[1] != "mV")) {
throw RuntimeError("Unknown argument " + args[1] +
". Did you mean mV?");
}
mV = true;
} else if (args.size() > 2 || args.size() < 1) {
WrongNumberOfParameters(1);
}
det->setADCVpp(StringTo<int>(args[1]), mV,
std::vector<int>{det_id});
os << args[1] << (mV ? " mV\n" : "\n");
} else {
throw RuntimeError("Unknown action");
}
return os.str();
}
std::string CmdProxy::SlowAdc(int action) {
std::ostringstream os;

View File

@ -666,7 +666,6 @@ class CmdProxy {
{"vb_cs", "dac"},
{"vb_opa_fd", "dac"},
{"vcom_adc2", "dac"},
{"adcvpp", "dac"},
{"vb_ds", "dac"},
{"vb_comp", "dac"},
{"vb_pixbuf", "dac"},
@ -1018,6 +1017,7 @@ class CmdProxy {
{"dsamples", &CmdProxy::dsamples},
{"romode", &CmdProxy::romode},
{"dbitclk", &CmdProxy::dbitclk},
{"adcvpp", &CmdProxy::AdcVpp},
{"v_a", &CmdProxy::v_a},
{"v_b", &CmdProxy::v_b},
{"v_c", &CmdProxy::v_c},
@ -1190,6 +1190,7 @@ class CmdProxy {
/* CTB/ Moench Specific */
std::string Samples(int action);
/* CTB Specific */
std::string AdcVpp(int action);
std::string SlowAdc(int action);
std::string ReceiverDbitList(int action);
std::string DigitalIODelay(int action);

View File

@ -1999,6 +1999,14 @@ void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) {
pimpl->Parallel(&Module::setDAC, pos, value, index, true);
}
Result<int> Detector::getADCVpp(bool mV, Positions pos) const {
return pimpl->Parallel(&Module::getDAC, pos, defs::ADC_VPP, mV);
}
void Detector::setADCVpp(int value, bool mV, Positions pos) {
pimpl->Parallel(&Module::setDAC, pos, value, defs::ADC_VPP, mV);
}
Result<uint32_t> Detector::getADCEnableMask(Positions pos) const {
return pimpl->Parallel(&Module::getADCEnableMask, pos);
}

View File

@ -253,12 +253,6 @@ std::string GetHelpDac(std::string dac) {
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
"common mode voltage of ADC DAC bank 2.");
}
if (dac == "adcvpp") {
return std::string(
"[dac or mV value][(optional unit) mV] \n\t[Ctb][Moench] Vpp of "
"ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V. "
"\n\tAdvanced User function! ");
}
if (dac == "vb_ds") {
return std::string(
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for ??");