jungfrau: gainmode

This commit is contained in:
2021-08-02 12:44:57 +02:00
parent 526aa3273e
commit 9ed3a294ce
20 changed files with 298 additions and 16 deletions

View File

@ -408,4 +408,38 @@ TEST_CASE("storagecell_delay", "[.cmd]") {
REQUIRE_THROWS(proxy.Call("storagecell_delay", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("storagecell_delay", {"0"}, -1, PUT));
}
}
}
TEST_CASE("gainmode", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
auto prev_val = det.getGainMode();
{
std::ostringstream oss;
proxy.Call("gainmode", {"forceswitchg1"}, -1, PUT, oss);
REQUIRE(oss.str() == "gainmode forceswitchg1\n");
}
{
std::ostringstream oss;
proxy.Call("gainmode", {}, -1, GET, oss);
REQUIRE(oss.str() == "gainmode forceswitchg1\n");
}
{
std::ostringstream oss;
proxy.Call("gainmode", {"forceswitchg2"}, -1, PUT, oss);
REQUIRE(oss.str() == "gainmode forceswitchg2\n");
}
{
std::ostringstream oss;
proxy.Call("gainmode", {"normal"}, -1, PUT, oss);
REQUIRE(oss.str() == "gainmode normal\n");
}
for (int i = 0; i != det.size(); ++i) {
det.setGainMode(prev_val[i], {i});
}
} else {
REQUIRE_THROWS(proxy.Call("gainmode", {}, -1, GET));
}
}