This commit is contained in:
maliakal_d 2021-08-05 17:41:21 +02:00
parent 074178848e
commit d3bbb50fc8
2 changed files with 50 additions and 2 deletions

View File

@ -934,6 +934,7 @@ class CmdProxy {
{"storagecell_start", &CmdProxy::storagecell_start},
{"storagecell_delay", &CmdProxy::storagecell_delay},
{"gainmode", &CmdProxy::gainmode},
{"filtercell", &CmdProxy::filtercell},
/* Gotthard Specific */
{"roi", &CmdProxy::ROI},
@ -1888,8 +1889,11 @@ class CmdProxy {
sls::StringTo<slsDetectorDefs::gainMode>,
"[dynamicgain|forceswitchg1|forceswitchg2|fixg1|fixg2|fixg0]\n\t["
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
"you can "
"damage the detector!!!");
"you can damage the detector!!!");
INTEGER_COMMAND_VEC_ID(
filtercell, getFilterCell, setFilterCell, sls::StringTo<int>,
"[0-12]\n\t[Jungfrau] Set Filter Cell. Advanced user Command");
/* Gotthard Specific */
TIME_GET_COMMAND(exptimel, getExptimeLeft,

View File

@ -488,3 +488,47 @@ TEST_CASE("gainmode", "[.cmd]") {
REQUIRE_THROWS(proxy.Call("gainmode", {}, -1, GET));
}
}
TEST_CASE("filtercell", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
// chip version 1.1
if (det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getFilterCell().tsquash(
"inconsistent #additional storage cells to test");
{
std::ostringstream oss;
proxy.Call("filtercell", {"1"}, -1, PUT, oss);
REQUIRE(oss.str() == "filtercell 1\n");
}
{
std::ostringstream oss;
proxy.Call("filtercell", {"15"}, -1, PUT, oss);
REQUIRE(oss.str() == "filtercell 15\n");
}
{
std::ostringstream oss;
proxy.Call("filtercell", {"0"}, -1, PUT, oss);
REQUIRE(oss.str() == "filtercell 0\n");
}
{
std::ostringstream oss;
proxy.Call("filtercell", {}, -1, GET, oss);
REQUIRE(oss.str() == "filtercell 0\n");
}
REQUIRE_THROWS(proxy.Call("filtercell", {"16"}, -1, PUT));
det.setFilterCell(prev_val);
}
// chip version 1.0
else {
// cannot set/get filter cell
REQUIRE_THROWS(proxy.Call("filtercell", {"1"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("filtercell", {}, -1, GET));
}
} else {
REQUIRE_THROWS(proxy.Call("filtercell", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("filtercell", {"0"}, -1, PUT));
}
}