Moench rewrite (#597)

* copied jungfrau server to moench and adapted

* fixed image size and num packets

* read n rows allows 16

* commneted out configure_asic_timer at server startup. To be removed later the ASIC_CTRL_REG and storage cell options

* moench:removing the decrement (which was in jf)  in read n rows to register

* removed lblsamples from gui
This commit is contained in:
Dhanya Thattil
2022-12-15 09:16:51 +01:00
committed by GitHub
parent 7ab3b25f87
commit 39b1f5bbf2
58 changed files with 4309 additions and 5499 deletions

View File

@ -149,7 +149,8 @@ TEST_CASE("moduleid", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::MYTHEN3 ||
det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
REQUIRE_NOTHROW(proxy.Call("moduleid", {}, -1, GET));
} else {
REQUIRE_THROWS(proxy.Call("moduleid", {}, -1, GET));
@ -217,6 +218,7 @@ TEST_CASE("settings", "[.cmd]") {
std::vector<std::string> sett;
switch (det_type) {
case defs::JUNGFRAU:
case defs::MOENCH:
sett.push_back("gain0");
sett.push_back("highgain0");
break;
@ -232,16 +234,6 @@ TEST_CASE("settings", "[.cmd]") {
sett.push_back("fixgain1");
sett.push_back("fixgain2");
break;
case defs::MOENCH:
sett.push_back("g1_hg");
sett.push_back("g1_lg");
sett.push_back("g2_hc_hg");
sett.push_back("g2_hc_lg");
sett.push_back("g2_lc_hg");
sett.push_back("g2_lc_lg");
sett.push_back("g4_hg");
sett.push_back("g4_lg");
break;
case defs::MYTHEN3:
sett.push_back("standard");
sett.push_back("fast");
@ -525,7 +517,8 @@ TEST_CASE("gappixels", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::EIGER) {
auto prev_val = det.getGapPixelsinCallback();
{
std::ostringstream oss;
@ -562,17 +555,17 @@ TEST_CASE("fliprows", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
bool jungfrauhw2 = false;
if (det_type == defs::JUNGFRAU &&
bool hw2 = false;
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
((det.getHardwareVersion().tsquash(
"inconsistent serial number to test") == "2.0"))) {
jungfrauhw2 = true;
hw2 = true;
}
if (det_type == defs::EIGER || jungfrauhw2) {
if (det_type == defs::EIGER || hw2) {
auto previous = det.getFlipRows();
auto previous_numudp = det.getNumberofUDPInterfaces().tsquash(
"inconsistent number of udp interfaces to test");
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(2);
}
std::ostringstream oss1, oss2, oss3;
@ -585,7 +578,7 @@ TEST_CASE("fliprows", "[.cmd]") {
for (int i = 0; i != det.size(); ++i) {
det.setFlipRows(previous[i], {i});
}
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(previous_numudp);
}
} else {
@ -599,10 +592,10 @@ TEST_CASE("master", "[.cmd]") {
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD || det_type == defs::GOTTHARD2 ||
det_type == defs::JUNGFRAU) {
det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
REQUIRE_NOTHROW(proxy.Call("master", {}, -1, GET));
if (det_type == defs::EIGER || det_type == defs::GOTTHARD2 ||
det_type == defs::JUNGFRAU) {
det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
// get previous master
int prevMaster = 0;
{
@ -743,7 +736,7 @@ TEST_CASE("exptime", "[.cmd][.time]") {
proxy.Call("exptime", {"1s"}, -1, PUT, oss);
REQUIRE(oss.str() == "exptime 1s\n");
}
if (det_type != defs::JUNGFRAU) {
if (det_type != defs::JUNGFRAU && det_type != defs::MOENCH) {
{
std::ostringstream oss;
proxy.Call("exptime", {"0"}, -1, PUT, oss);
@ -849,7 +842,6 @@ TEST_CASE("delayl", "[.cmd]") {
switch (det_type) {
case defs::EIGER:
case defs::CHIPTESTBOARD:
case defs::MOENCH:
case defs::GOTTHARD2:
case defs::MYTHEN3:
REQUIRE_THROWS(proxy.Call("delayl", {}, -1, GET));
@ -867,7 +859,6 @@ TEST_CASE("periodl", "[.cmd]") {
switch (det_type) {
case defs::EIGER:
case defs::CHIPTESTBOARD:
case defs::MOENCH:
case defs::GOTTHARD2:
case defs::MYTHEN3:
REQUIRE_THROWS(proxy.Call("periodl", {}, -1, GET));
@ -1001,12 +992,12 @@ TEST_CASE("readoutspeed", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::GOTTHARD2) {
det_type == defs::MOENCH || det_type == defs::GOTTHARD2) {
auto prev_val = det.getReadoutSpeed();
// full speed for jungfrau only works for new boards (chipv1.1 is with
// new board [hw1.0 and chipv1.0 not tested here])
if ((det_type == defs::JUNGFRAU &&
// full speed for jungfrau/moench only works for new boards (chipv1.1 is
// with new board [hw1.0 and chipv1.0 not tested here])
if (((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
det.getChipVersion().squash() * 10 == 11) ||
(det_type == defs::EIGER)) {
std::ostringstream oss1, oss2, oss3, oss4;
@ -1020,7 +1011,8 @@ TEST_CASE("readoutspeed", "[.cmd]") {
REQUIRE(oss4.str() == "readoutspeed full_speed\n");
}
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
{
std::ostringstream oss1, oss2, oss3, oss4;
proxy.Call("readoutspeed", {"1"}, -1, PUT, oss1);
@ -1086,7 +1078,7 @@ TEST_CASE("readoutspeedlist", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU ||
det_type == defs::EIGER) {
det_type == defs::MOENCH || det_type == defs::EIGER) {
REQUIRE_NOTHROW(proxy.Call("readoutspeedlist", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, PUT));
} else {
@ -1099,7 +1091,7 @@ TEST_CASE("adcphase", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD || det_type == defs::JUNGFRAU ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
det_type == defs::MOENCH || det_type == defs::CHIPTESTBOARD) {
if (det_type == defs::GOTTHARD) {
std::ostringstream oss1;
proxy.Call("adcphase", {"20"}, -1, PUT, oss1);
@ -1137,8 +1129,8 @@ TEST_CASE("maxadcphaseshift", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD ||
det_type == defs::MYTHEN3 || // only because clk index of 0 exists
det_type == defs::GOTTHARD2) { // only because clk index of 0 exists
REQUIRE_NOTHROW(proxy.Call("maxadcphaseshift", {}, -1, GET));
@ -1151,7 +1143,8 @@ TEST_CASE("dbitphase", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getDBITPhase();
{
std::ostringstream oss1, oss2;
@ -1180,7 +1173,8 @@ TEST_CASE("maxdbitphaseshift", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD ||
det_type == defs::MYTHEN3 || // only because clk index of 0 exists
det_type == defs::GOTTHARD2) { // only because clk index of 0 exists
REQUIRE_NOTHROW(proxy.Call("maxdbitphaseshift", {}, -1, GET));
@ -1305,8 +1299,8 @@ TEST_CASE("highvoltage", "[.cmd]") {
}
}
// range 0, 60 - 200
else if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH) {
else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(proxy.Call("highvoltage", {"50"}, -1, PUT));
{
std::ostringstream oss1, oss2;
@ -1384,8 +1378,8 @@ TEST_CASE("powerchip", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2 || det_type == defs::MOENCH) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
auto prev_val = det.getPowerChip();
{
std::ostringstream oss;
@ -1434,8 +1428,9 @@ TEST_CASE("imagetest", "[.cmd]") {
for (int i = 0; i != det.size(); ++i) {
det.setImageTestMode(prev_val[i], {i});
}
} else if (det_type != defs::JUNGFRAU && det_type != defs::EIGER) {
// wont fail for eiger and jungfrau virtual servers
} else if (det_type != defs::JUNGFRAU && det_type != defs::MOENCH &&
det_type != defs::EIGER) {
// wont fail for eiger and jungfrau/moench virtual servers
REQUIRE_THROWS(proxy.Call("imagetest", {}, -1, GET));
}
}
@ -1557,7 +1552,7 @@ TEST_CASE("filterresistor", "[.cmd]") {
// only for chipv1.1
bool chip11 = false;
if (det_type == defs::JUNGFRAU &&
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
det.getChipVersion().squash() * 10 == 11) {
chip11 = true;
}
@ -1648,14 +1643,15 @@ TEST_CASE("readnrows", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
bool jungfrauhw2 = false;
if (det_type == defs::JUNGFRAU &&
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
bool hw2 = false;
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
((det.getHardwareVersion().tsquash(
"inconsistent hardware version number to test") == "2.0"))) {
jungfrauhw2 = true;
hw2 = true;
}
if (det_type == defs::JUNGFRAU && !jungfrauhw2) {
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) && !hw2) {
{
std::ostringstream oss;
proxy.Call("readnrows", {}, -1, GET, oss);
@ -1678,7 +1674,7 @@ TEST_CASE("readnrows", "[.cmd]") {
proxy.Call("readnrows", {"16"}, -1, PUT, oss);
REQUIRE(oss.str() == "readnrows 16\n");
}
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
REQUIRE_THROWS(proxy.Call("readnrows", {"7"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"20"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"44"}, -1, PUT));
@ -1700,7 +1696,8 @@ TEST_CASE("currentsource", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU) {
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_val = det.getCurrentSource();
if (det_type == defs::GOTTHARD2) {
@ -1724,7 +1721,7 @@ TEST_CASE("currentsource", "[.cmd]") {
REQUIRE_THROWS(proxy.Call("currentsource",
{"1", "fix", "42", "normal"}, -1, PUT));
}
// jungfrau
// jungfrau/moench
else {
int chipVersion = det.getChipVersion().tsquash(
"inconsistent chip versions to test") *
@ -1852,7 +1849,8 @@ TEST_CASE("temp_adc", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD) {
REQUIRE_NOTHROW(proxy.Call("temp_adc", {}, -1, GET));
std::ostringstream oss;
REQUIRE_NOTHROW(proxy.Call("temp_adc", {}, 0, GET, oss));
@ -1867,7 +1865,7 @@ TEST_CASE("temp_fpga", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::MOENCH && det_type != defs::CHIPTESTBOARD) {
if (det_type != defs::CHIPTESTBOARD) {
REQUIRE_NOTHROW(proxy.Call("temp_fpga", {}, -1, GET));
std::ostringstream oss;
REQUIRE_NOTHROW(proxy.Call("temp_fpga", {}, 0, GET, oss));
@ -1924,7 +1922,7 @@ TEST_CASE("defaultdac", "[.cmd]") {
det.setDefaultDac(it, prev_val[i], {i});
}
}
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
std::vector<defs::dacIndex> daclist = {
defs::VREF_PRECH, defs::VREF_DS, defs::VREF_COMP};
for (auto it : daclist) {
@ -1964,7 +1962,7 @@ TEST_CASE("resetdacs", "[.cmd]") {
REQUIRE_NOTHROW(proxy.Call("resetdacs", {}, -1, PUT));
REQUIRE_NOTHROW(proxy.Call("resetdacs", {"hard"}, -1, PUT));
// settings should not change especially for jungfrau and m3
// settings should not change especially for jungfrau/moench and m3
auto next_val = det.getSettings();
for (int i = 0; i != det.size(); ++i) {
REQUIRE(prev_val[i] == next_val[i]);
@ -1984,7 +1982,8 @@ TEST_CASE("trigger", "[.cmd]") {
auto det_type = det.getDetectorType().squash();
if (det_type == defs::MYTHEN3) {
REQUIRE_NOTHROW(proxy.Call("trigger", {}, -1, PUT));
} else if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
} else if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_timing =
det.getTimingMode().tsquash("inconsistent timing mode in test");
auto prev_frames =
@ -2024,7 +2023,8 @@ TEST_CASE("blockingtrigger", "[.cmd]") {
CmdProxy proxy(&det);
REQUIRE_THROWS(proxy.Call("blockingtrigger", {}, -1, GET));
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_timing =
det.getTimingMode().tsquash("inconsistent timing mode in test");
auto prev_frames =
@ -2275,6 +2275,7 @@ TEST_CASE("scan", "[.cmd]") {
notImplementedInd = defs::VCASCP_PB;
break;
case defs::JUNGFRAU:
case defs::MOENCH:
ind = defs::VB_COMP;
notImplementedInd = defs::VSVP;
break;
@ -2282,10 +2283,6 @@ TEST_CASE("scan", "[.cmd]") {
ind = defs::VREF_DS;
notImplementedInd = defs::VSVP;
break;
case defs::MOENCH:
ind = defs::VBP_COLBUF;
notImplementedInd = defs::VSVP;
break;
case defs::GOTTHARD2:
ind = defs::VB_COMP_FE;
notImplementedInd = defs::VSVP;
@ -2401,7 +2398,7 @@ TEST_CASE("numinterfaces", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getNumberofUDPInterfaces().tsquash(
"inconsistent numinterfaces to test");
{
@ -2456,8 +2453,9 @@ TEST_CASE("udp_dstlist", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
REQUIRE_NOTHROW(proxy.Call("udp_dstlist", {}, 0, GET, std::cout, 0));
REQUIRE_THROWS(proxy.Call(
"udp_dstlist", {"ip=0.0.0.0", "mac=00:00:00:00:00:00", "port=1233"},
@ -2471,8 +2469,9 @@ TEST_CASE("udp_numdst", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
REQUIRE_NOTHROW(proxy.Call("udp_numdst", {}, -1, GET));
} else {
REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET));
@ -2491,8 +2490,8 @@ TEST_CASE("udp_firstdst", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
auto prev_val = det.getFirstUDPDestination();
{
std::ostringstream oss;
@ -2568,7 +2567,8 @@ TEST_CASE("udp_srcip2", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
auto prev_val = det.getSourceUDPIP2();
REQUIRE_THROWS(proxy.Call("udp_srcip2", {"0.0.0.0"}, -1, PUT));
{
@ -2589,7 +2589,8 @@ TEST_CASE("udp_dstip2", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
REQUIRE_THROWS(proxy.Call("udp_dstip2", {"0.0.0.0"}, -1, PUT));
} else {
REQUIRE_THROWS(proxy.Call("udp_dstip2", {}, -1, GET));
@ -2600,7 +2601,8 @@ TEST_CASE("udp_srcmac2", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
auto prev_val = det.getSourceUDPMAC2();
REQUIRE_THROWS(
proxy.Call("udp_srcmac2", {"00:00:00:00:00:00"}, -1, PUT));
@ -2623,7 +2625,8 @@ TEST_CASE("udp_dstmac2", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
REQUIRE_THROWS(
proxy.Call("udp_dstmac2", {"00:00:00:00:00:00"}, -1, PUT));
} else {
@ -2635,8 +2638,8 @@ TEST_CASE("udp_dstport2", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2 ||
det_type == defs::EIGER) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2 || det_type == defs::EIGER) {
auto prev_val = det.getDestinationUDPPort2();
{
std::ostringstream oss;
@ -2671,7 +2674,7 @@ TEST_CASE("tengiga", "[.cmd]") {
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
auto tengiga = det.getTenGiga();
det.setTenGiga(false);
@ -2694,7 +2697,8 @@ TEST_CASE("flowcontrol10g", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_val = det.getTenGigaFlowControl();
{
std::ostringstream oss;
@ -2724,10 +2728,11 @@ TEST_CASE("txdelay_frame", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MYTHEN3) {
det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
auto prev_val = det.getTransmissionDelayFrame();
auto val = 5000;
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
val = 5;
}
std::string sval = std::to_string(val);
@ -2751,10 +2756,11 @@ TEST_CASE("txdelay", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MYTHEN3) {
det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
// cannot get transmission delay with just one module
if ((det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) &&
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) &&
(det.size() < 2)) {
REQUIRE_THROWS(proxy.Call("txdelay", {}, -1, GET));
int val = 5;
@ -2776,7 +2782,8 @@ TEST_CASE("txdelay", "[.cmd]") {
}
auto prev_frame = det.getTransmissionDelayFrame();
auto val = 5000;
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
val = 5;
}
std::string sval = std::to_string(val);
@ -2829,7 +2836,7 @@ TEST_CASE("zmqport", "[.cmd]") {
int prev = 1;
if (det_type == defs::EIGER) {
socketsperdetector *= 2;
} else if (det_type == defs::JUNGFRAU) {
} else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
prev = det.getNumberofUDPInterfaces().squash();
det.setNumberofUDPInterfaces(2);
socketsperdetector *= 2;
@ -2863,7 +2870,7 @@ TEST_CASE("zmqport", "[.cmd]") {
std::to_string(port + i * socketsperdetector) +
'\n');
}
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(prev);
}
}
@ -2917,8 +2924,8 @@ TEST_CASE("programfpga", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 ||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
// TODO program a real board?
/// afs/psi.ch/project/sls_det_firmware/jungfrau_firmware/cyclone_V/v0_8/Jungfrau_MCB.pof
@ -2949,8 +2956,8 @@ TEST_CASE("updatekernel", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
// TODO: send real server?
// std::ostringstream oss;
@ -2968,8 +2975,8 @@ TEST_CASE("rebootcontroller", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2 || det_type == defs::GOTTHARD) {
// TODO: reboot real server?
// REQUIRE_NOTHROW(proxy.Call("rebootcontroller", {}, -1, PUT));
@ -2984,8 +2991,8 @@ TEST_CASE("update", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD) {
// TODO: update real server and firmware?
// REQUIRE_NOTHROW(proxy.Call("update",
// {"jungfrauDetectorServerv4.0.1.0", "pc13784",
@ -3028,8 +3035,8 @@ TEST_CASE("adcreg", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::GOTTHARD) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD) {
std::ostringstream oss;
proxy.Call("adcreg", {"0x8", "0x3"}, -1, PUT, oss);
REQUIRE(oss.str() == "adcreg [0x8, 0x3]\n");
@ -3113,8 +3120,8 @@ TEST_CASE("firmwaretest", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::GOTTHARD ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
std::ostringstream oss;
proxy.Call("firmwaretest", {}, -1, PUT, oss);
@ -3130,8 +3137,8 @@ TEST_CASE("bustest", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::GOTTHARD ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
std::ostringstream oss;
proxy.Call("bustest", {}, -1, PUT, oss);
@ -3170,8 +3177,8 @@ TEST_CASE("adcinvert", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::JUNGFRAU) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_val = det.getADCInvert();
{
std::ostringstream oss;
@ -3261,8 +3268,8 @@ TEST_CASE("framecounter", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
auto framecounter = det.getNumberOfFramesFromStart().squash();
std::ostringstream oss;
@ -3280,8 +3287,8 @@ TEST_CASE("runtime", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
std::ostringstream oss;
proxy.Call("runtime", {}, -1, GET, oss);
@ -3298,8 +3305,8 @@ TEST_CASE("frametime", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
std::ostringstream oss;
proxy.Call("frametime", {}, -1, GET, oss);