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

@ -107,7 +107,7 @@ TEST_CASE("adcvpp", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCVpp(false);
{
std::ostringstream oss;
@ -132,14 +132,14 @@ TEST_CASE("adcvpp", "[.cmd]") {
}
}
/* CTB/ Moench Specific */
/* CTB Specific */
TEST_CASE("samples", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_asamples = det.getNumberOfAnalogSamples();
Result<int> prev_dsamples = 0;
if (det_type == defs::CHIPTESTBOARD) {
@ -186,7 +186,7 @@ TEST_CASE("asamples", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getNumberOfAnalogSamples();
{
std::ostringstream oss;
@ -216,7 +216,7 @@ TEST_CASE("adcclk", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCClock();
{
std::ostringstream oss;
@ -247,7 +247,7 @@ TEST_CASE("runclk", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getRUNClock();
{
std::ostringstream oss;
@ -277,7 +277,7 @@ TEST_CASE("syncclk", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_NOTHROW(proxy.Call("syncclk", {}, -1, GET));
} else {
// clock index might work
@ -290,7 +290,7 @@ TEST_CASE("adcpipeline", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCPipeline();
{
std::ostringstream oss;
@ -325,7 +325,7 @@ TEST_CASE("v_limit", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getVoltage(defs::V_LIMIT);
{
std::ostringstream oss;
@ -363,7 +363,7 @@ TEST_CASE("adcenable", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCEnableMask();
{
std::ostringstream oss;
@ -393,7 +393,7 @@ TEST_CASE("adcenable10g", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getTenGigaADCEnableMask();
{
std::ostringstream oss;

View File

@ -23,7 +23,7 @@ TEST_CASE("Setting and reading back Jungfrau dacs", "[.cmd][.dacs]") {
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) {
SECTION("vb_comp") { test_dac(defs::VB_COMP, "vb_comp", 1220); }
SECTION("vdd_prot") { test_dac(defs::VDD_PROT, "vdd_prot", 3000); }
SECTION("vin_com") { test_dac(defs::VIN_COM, "vin_com", 1053); }
@ -102,7 +102,7 @@ TEST_CASE("selinterface", "[.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.getSelectedUDPInterface().tsquash(
"inconsistent selected interface to test");
{
@ -127,13 +127,13 @@ TEST_CASE("selinterface", "[.cmd]") {
}
}
/* Jungfrau Specific */
/* Jungfrau/moench Specific */
TEST_CASE("temp_threshold", "[.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.getThresholdTemperature();
{
std::ostringstream oss;
@ -163,7 +163,7 @@ TEST_CASE("chipversion", "[.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) {
REQUIRE_NOTHROW(proxy.Call("chipversion", {}, -1, GET));
} else {
REQUIRE_THROWS(proxy.Call("chipversion", {}, -1, GET));
@ -175,7 +175,7 @@ TEST_CASE("temp_control", "[.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.getTemperatureControl();
{
std::ostringstream oss;
@ -205,7 +205,7 @@ TEST_CASE("temp_event", "[.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) {
{
std::ostringstream oss;
proxy.Call("temp_event", {"0"}, -1, PUT, oss);
@ -226,7 +226,7 @@ TEST_CASE("autocompdisable", "[.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.getAutoComparatorDisable();
{
std::ostringstream oss;
@ -256,7 +256,7 @@ TEST_CASE("compdisabletime", "[.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) &&
det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getComparatorDisableTime();
{
@ -287,7 +287,7 @@ TEST_CASE("extrastoragecells", "[.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) {
// chip version 1.0
if (det.getChipVersion().squash() * 10 == 10) {
auto prev_val = det.getNumberOfAdditionalStorageCells().tsquash(
@ -330,7 +330,7 @@ TEST_CASE("storagecell_start", "[.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.getStorageCellStart();
{
std::ostringstream oss;
@ -375,7 +375,7 @@ TEST_CASE("storagecell_delay", "[.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) {
// chip version 1.0
if (det.getChipVersion().squash() * 10 == 10) {
auto prev_val = det.getStorageCellDelay();
@ -416,7 +416,7 @@ TEST_CASE("gainmode", "[.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.getGainMode();
{
std::ostringstream oss;
@ -465,7 +465,7 @@ TEST_CASE("filtercells", "[.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) {
// chip version 1.1
if (det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getNumberOfFilterCells();
@ -510,7 +510,7 @@ TEST_CASE("sync", "[.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.getSynchronization().tsquash(
"inconsistent synchronization to test");
{

View File

@ -19,94 +19,4 @@ using test::PUT;
/* dacs */
TEST_CASE("Setting and reading back MOENCH dacs", "[.cmd][.dacs]") {
// vbp_colbuf, vipre, vin_cm", vb_sda, vcasc_sfp, vout_cm, vipre_cds,
// ibias_sfp
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::MOENCH) {
SECTION("vbp_colbuf") {
test_dac(defs::VBP_COLBUF, "vbp_colbuf", 1300);
}
SECTION("vipre") { test_dac(defs::VIPRE, "vipre", 1000); }
SECTION("vin_cm") { test_dac(defs::VIN_CM, "vin_cm", 1400); }
SECTION("vb_sda") { test_dac(defs::VB_SDA, "vb_sda", 680); }
SECTION("vcasc_sfp") { test_dac(defs::VCASC_SFP, "vcasc_sfp", 1428); }
SECTION("vout_cm") { test_dac(defs::VOUT_CM, "vout_cm", 1200); }
SECTION("vipre_cds") { test_dac(defs::VIPRE_CDS, "vipre_cds", 800); }
SECTION("ibias_sfp") { test_dac(defs::IBIAS_SFP, "ibias_sfp", 900); }
// eiger
REQUIRE_THROWS(proxy.Call("dac", {"vthreshold"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vsvp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vsvn"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vtrim"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrpreamp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrshaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vtgstv"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_ll"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_lr"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcal"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_rl"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_rr"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"rxb_rb"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"rxb_lb"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcn"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vishaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"iodelay"}, -1, GET));
// jungfrau
REQUIRE_THROWS(proxy.Call("dac", {"vb_comp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vdd_prot"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vin_com"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_prech"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_pixbuf"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_ds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_ds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_comp"}, -1, GET));
// gotthard
REQUIRE_THROWS(proxy.Call("dac", {"vref_ds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcascn_pb"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcascp_pb"}, -1, GET));
// REQUIRE_THROWS(proxy.Call("dac", {"vout_cm"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcasc_out"}, -1, GET));
// REQUIRE_THROWS(proxy.Call("dac", {"vin_cm"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_comp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"ib_test_c"}, -1, GET));
// mythen3
REQUIRE_THROWS(proxy.Call("dac", {"vrpreamp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrshaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrshaper_n"}, -1, GET));
// REQUIRE_THROWS(proxy.Call("dac", {"vipre"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vishaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vdcsh"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vth1"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vth2"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vth3"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcal_n"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcal_p"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vtrim"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcassh"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcas"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vicin"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vipre_out"}, -1, GET));
// gotthard2
REQUIRE_THROWS(proxy.Call("dac", {"vref_h_adc"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_comp_fe"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_comp_adc"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcom_cds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_rstore"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_opa_1st"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_comp_fe"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcom_adc1"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_l_adc"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_cds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_cs"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_opa_fd"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcom_adc2"}, -1, GET));
}
}
} // namespace sls

View File

@ -23,8 +23,7 @@ TEST_CASE("pattern", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
// no proper test for put
REQUIRE_THROWS(proxy.Call("pattern", {}, -1, GET));
} else {
@ -36,8 +35,7 @@ TEST_CASE("savepattern", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
REQUIRE_THROWS(
proxy.Call("savepattern", {"/tmp/pattern.txt"}, -1, GET));
if (det.size() == 1) {
@ -54,7 +52,7 @@ TEST_CASE("defaultpattern", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
if (det_type == defs::MYTHEN3) {
REQUIRE_THROWS(proxy.Call("defaultpattern", {}, -1, GET));
REQUIRE_NOTHROW(proxy.Call("defaultpattern", {}, -1, PUT));
} else {
@ -68,7 +66,7 @@ TEST_CASE("patioctrl", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getPatternIOControl();
{
std::ostringstream oss;
@ -98,8 +96,7 @@ TEST_CASE("patword", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
int addr = 0x23;
std::string saddr = ToStringHex(addr, 4);
auto prev_val = det.getPatternWord(addr);
@ -134,8 +131,7 @@ TEST_CASE("patlimits", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternLoopAddresses(-1);
{
std::ostringstream oss;
@ -161,8 +157,7 @@ TEST_CASE("patloop", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -208,8 +203,7 @@ TEST_CASE("patnloop", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -254,8 +248,7 @@ TEST_CASE("patwait", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -300,8 +293,7 @@ TEST_CASE("patwaittime", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -346,8 +338,7 @@ TEST_CASE("patmask", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternMask();
{
std::ostringstream oss;
@ -372,8 +363,7 @@ TEST_CASE("patsetbit", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternBitMask();
{
std::ostringstream oss;

View File

@ -451,7 +451,7 @@ TEST_CASE("rx_roi", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(proxy.Call("rx_roi", {"5", "10"}, -1, PUT));
} else {
auto prev_val = det.getRxROI();
@ -513,7 +513,7 @@ TEST_CASE("rx_clearroi", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) {
if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(proxy.Call("rx_clearroi", {}, -1, PUT));
} else {
auto prev_val = det.getRxROI();
@ -805,7 +805,7 @@ TEST_CASE("rx_zmqport", "[.cmd][.rx]") {
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER) {
socketsperdetector *= 2;
} else if (det_type == defs::JUNGFRAU) {
} else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
proxy.Call("numinterfaces", {"2"}, -1, PUT);
socketsperdetector *= 2;
}
@ -830,7 +830,7 @@ TEST_CASE("rx_zmqport", "[.cmd][.rx]") {
for (int i = 0; i != det.size(); ++i) {
det.setRxZmqPort(prev_val_zmqport[i], i);
}
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(prev_val_numinterfaces);
}
}
@ -948,8 +948,6 @@ TEST_CASE("rx_dbitoffset", "[.cmd][.rx]") {
}
}
/* Moench */
TEST_CASE("rx_jsonaddheader", "[.cmd][.rx]") {
Detector det;
CmdProxy proxy(&det);

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);