Merge branch 'eiger' of github.com:slsdetectorgroup/slsDetectorPackage into eiger

This commit is contained in:
2020-07-31 08:51:04 +02:00
30 changed files with 229 additions and 102 deletions

View File

@ -1559,9 +1559,7 @@ std::string CmdProxy::ROI(int action) {
if (args.size() != 2) {
WrongNumberOfParameters(2);
}
defs::ROI t;
t.xmin = StringTo<int>(args[0]);
t.xmax = StringTo<int>(args[1]);
defs::ROI t(StringTo<int>(args[0]), StringTo<int>(args[1]));
det->setROI(t, det_id);
os << '[' << t.xmin << ", " << t.xmax << "]\n";
} else {

View File

@ -528,6 +528,7 @@ class CmdProxy {
{"cycles", "triggers"},
{"cyclesl", "triggersl"},
{"clkdivider", "speed"},
{"vhighvoltage", "highvoltage"},
{"digitest", "imagetest"},
/** temperature */
@ -654,7 +655,7 @@ class CmdProxy {
{"clkphase", &CmdProxy::ClockPhase},
{"maxclkphaseshift", &CmdProxy::MaxClockPhaseShift},
{"clkdiv", &CmdProxy::ClockDivider},
{"vhighvoltage", &CmdProxy::vhighvoltage},
{"highvoltage", &CmdProxy::highvoltage},
{"powerchip", &CmdProxy::powerchip},
{"imagetest", &CmdProxy::imagetest},
{"extsig", &CmdProxy::ExternalSignal},
@ -1185,7 +1186,7 @@ class CmdProxy {
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the "
"clock to latch digital bits.");
INTEGER_COMMAND(vhighvoltage, getHighVoltage, setHighVoltage, StringTo<int>,
INTEGER_COMMAND(highvoltage, getHighVoltage, setHighVoltage, StringTo<int>,
"[n_value]\n\tHigh voltage to the sensor in Voltage."
"\n\t[Gotthard] [0|90|110|120|150|180|200]"
"\n\t[Eiger][Mythen3][Gotthard2] 0-200"

View File

@ -793,97 +793,97 @@ TEST_CASE("maxclkphaseshift", "[.cmd][.new]") {
}
}
TEST_CASE("vhighvoltage", "[.cmd][.new]") {
TEST_CASE("highvoltage", "[.cmd][.new]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
auto prev_val = det.getHighVoltage();
// selected values
if (det_type == defs::GOTTHARD) {
REQUIRE_THROWS(proxy.Call("vhighvoltage", {"50"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("highvoltage", {"50"}, -1, PUT));
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"90"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 90\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 90\n");
proxy.Call("highvoltage", {"90"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 90\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 90\n");
}
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"0"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 0\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 0\n");
proxy.Call("highvoltage", {"0"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 0\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 0\n");
}
}
// range 0, 60 - 200
else if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH) {
REQUIRE_THROWS(proxy.Call("vhighvoltage", {"50"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("highvoltage", {"50"}, -1, PUT));
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"90"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 90\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 90\n");
proxy.Call("highvoltage", {"90"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 90\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 90\n");
}
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"0"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 0\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 0\n");
proxy.Call("highvoltage", {"0"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 0\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 0\n");
}
}
// full range 0 - 200 (get needs to wait)
else if (det_type == defs::EIGER) {
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"50"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 50\n");
proxy.Call("highvoltage", {"50"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 50\n");
std::this_thread::sleep_for(std::chrono::seconds(2));
proxy.Call("vhighvoltage", {}, 0, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 50\n");
proxy.Call("highvoltage", {}, 0, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 50\n");
}
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"120"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 120\n");
proxy.Call("highvoltage", {"120"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 120\n");
std::this_thread::sleep_for(std::chrono::seconds(2));
proxy.Call("vhighvoltage", {}, 0, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 120\n");
proxy.Call("highvoltage", {}, 0, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 120\n");
}
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"0"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 0\n");
proxy.Call("highvoltage", {"0"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 0\n");
std::this_thread::sleep_for(std::chrono::seconds(2));
proxy.Call("vhighvoltage", {}, 0, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 0\n");
proxy.Call("highvoltage", {}, 0, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 0\n");
}
}
// full range 0 - 200
else {
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"50"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 50\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 50\n");
proxy.Call("highvoltage", {"50"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 50\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 50\n");
}
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"120"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 120\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 120\n");
proxy.Call("highvoltage", {"120"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 120\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 120\n");
}
{
std::ostringstream oss1, oss2;
proxy.Call("vhighvoltage", {"0"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "vhighvoltage 0\n");
proxy.Call("vhighvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "vhighvoltage 0\n");
proxy.Call("highvoltage", {"0"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "highvoltage 0\n");
proxy.Call("highvoltage", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "highvoltage 0\n");
}
}
for (int i = 0; i != det.size(); ++i) {