mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 00:14:37 +01:00
wip
This commit is contained in:
@@ -1179,7 +1179,7 @@ class Detector {
|
||||
/** [Jungfrau]*/
|
||||
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] Options: NORMAL_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
|
||||
/** [Jungfrau] Options: DYNAMICGAIN, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
|
||||
* FIX_G1, FIX_G2, FIX_G0, FIX_HG0 \n\CAUTION: Do not use FIX_G0 and FIX_HG0
|
||||
* blindly, you can damage the detector!!!\n
|
||||
*/
|
||||
|
||||
@@ -1494,9 +1494,10 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
|
||||
std::vector<defs::gainMode> Detector::getGainModeList() const {
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::JUNGFRAU:
|
||||
return std::vector<defs::gainMode>{defs::NORMAL_GAIN_MODE,
|
||||
defs::FORCE_SWITCH_G1,
|
||||
defs::FORCE_SWITCH_G2};
|
||||
return std::vector<defs::gainMode>{
|
||||
defs::DYNAMICGAIN, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2,
|
||||
defs::FIX_G1, defs::FIX_G2, defs::FIX_G0,
|
||||
defs::FIX_HG0};
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Gain mode is not implemented for this detector.");
|
||||
|
||||
@@ -463,8 +463,18 @@ TEST_CASE("gainmode", "[.cmd]") {
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("gainmode", {"normal"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "gainmode normal\n");
|
||||
proxy.Call("gainmode", {"fixg1"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "gainmode fixg1\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("gainmode", {"fixg2"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "gainmode fixg2\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("gainmode", {"dynamic"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "gainmode dynamic\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setGainMode(prev_val[i], {i});
|
||||
|
||||
Reference in New Issue
Block a user