jungfrau: special settings and configure chip if powered on (1.1 chip)

This commit is contained in:
2021-07-28 13:34:32 +02:00
parent 41bbe4e3cf
commit f8b14c694d
4 changed files with 45 additions and 13 deletions

View File

@ -1201,8 +1201,7 @@ class CmdProxy {
"verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, "
"g2_lc_hg, g2_lc_lg, g4_hg, g4_lg]"
"\n\t Detector Settings"
"\n\t[Jungfrau] - [dynamicgain | dynamichg0 | fixgain1 | "
"fixgain2 | forceswitchg1 | forceswitchg2]"
"\n\t[Jungfrau] - [dynamicgain | dynamichg0]"
"\n\t[Gotthard] - [dynamicgain | highgain | lowgain | "
"mediumgain | veryhighgain]"
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"

View File

@ -142,15 +142,34 @@ TEST_CASE("settings", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
std::vector<std::string> allSett;
allSett.push_back("standard");
allSett.push_back("fast");
allSett.push_back("highgain");
allSett.push_back("dynamicgain");
allSett.push_back("lowgain");
allSett.push_back("mediumgain");
allSett.push_back("veryhighgain");
allSett.push_back("dynamichg0");
allSett.push_back("fixgain1");
allSett.push_back("fixgain2");
allSett.push_back("verylowgain");
allSett.push_back("g1_hg");
allSett.push_back("g1_lg");
allSett.push_back("g2_hc_hg");
allSett.push_back("g2_hc_lg");
allSett.push_back("g2_lc_hg");
allSett.push_back("g2_lc_lg");
allSett.push_back("g4_hg");
allSett.push_back("g4_lg");
allSett.push_back("forceswitchg1");
allSett.push_back("forceswitchg2");
std::vector<std::string> sett;
switch (det_type) {
case defs::JUNGFRAU:
sett.push_back("dynamicgain");
sett.push_back("dynamichg0");
sett.push_back("fixgain1");
sett.push_back("fixgain2");
sett.push_back("forceswitchg1");
sett.push_back("forceswitchg2");
break;
case defs::GOTTHARD:
sett.push_back("highgain");
@ -203,10 +222,9 @@ TEST_CASE("settings", "[.cmd]") {
REQUIRE(oss.str() == "settings " + it + "\n");
}
}
for (int i = 0; i != det.size(); ++i) {
if (prev_val[i] != defs::UNDEFINED &&
prev_val[i] != defs::UNINITIALIZED) {
det.setSettings(prev_val[i], {i});
for (auto &it : allSett) {
if (std::find(sett.begin(), sett.end(), it) == sett.end()) {
REQUIRE_THROWS(proxy.Call("settings", {it}, -1, PUT));
}
}
}