diff --git a/RELEASE.txt b/RELEASE.txt index bd79956a6..32bd1f59e 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -272,7 +272,7 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. Gotthard2 ========= - Compatible version : 27.05.2021 (development) + Compatible version : 27.05.2021 (v1.0) Moench ====== diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index 56f586b19..5dc0e62bd 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -2040,17 +2040,17 @@ int setAllTrimbits(int val) { } int getAllTrimbits() { - int value = *((detectorModules->chanregs)); if (detectorModules) { + int value = (*((detectorModules->chanregs))); for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) { if (*((detectorModules->chanregs) + ichan) != value) { - value = -1; - break; + return -1; } } + LOG(logINFO, ("Value of all Trimbits: %d\n", value)); + return value; } - LOG(logINFO, ("Value of all Trimbits: %d\n", value)); - return value; + return -1; } int getBebFPGATemp() { diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index af61a36fd..dac09753c 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -9247,7 +9247,7 @@ int get_readout_speed(int file_des) { int retval = -1; LOG(logDEBUG1, ("Getting readout speed\n")); -#if !defined(JUNGFRAUD) && !defined(EIGER) && !defined(GOTTHARD2D) +#if !defined(JUNGFRAUD) && !defined(EIGERD) && !defined(GOTTHARD2D) functionNotImplemented(); #else // get only @@ -9270,7 +9270,7 @@ int set_readout_speed(int file_des) { return printSocketReadError(); LOG(logDEBUG1, ("Setting readout speed : %u\n", arg)); -#if !defined(JUNGFRAUD) && !defined(EIGER) && !defined(GOTTHARD2D) +#if !defined(JUNGFRAUD) && !defined(EIGERD) && !defined(GOTTHARD2D) functionNotImplemented(); #else // only set diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 2391c92e1..fa442da69 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -833,10 +833,6 @@ Result Detector::getScanErrorMessage(Positions pos) const { // Network Configuration (Detector<->Receiver) Result Detector::getNumberofUDPInterfaces(Positions pos) const { - if (getDetectorType().squash() != defs::JUNGFRAU) { - throw sls::RuntimeError( - "Cannot set number of udp interfaces for this detector."); - } // also called by vetostream (for gotthard2) return pimpl->getNumberofUDPInterfaces(pos); } diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index c2c0edf1b..7404e66be 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -576,11 +576,11 @@ void Module::setDynamicRange(int dr) { if (dr == 32) { LOG(logINFO) << "Setting Clock to Quarter Speed to cope with " "Dynamic Range of 32"; - setClockDivider(RUN_CLOCK, 2); + setReadoutSpeed(defs::QUARTER_SPEED); } else { LOG(logINFO) << "Setting Clock to Full Speed for Dynamic Range of " << dr; - setClockDivider(RUN_CLOCK, 0); + setReadoutSpeed(defs::FULL_SPEED); } // EIGER only, update speed and rate correction when dr changes if (dr != prev_val) { diff --git a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp index 7482c30d0..032901d3a 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp @@ -488,23 +488,13 @@ TEST_CASE("activate", "[.cmd]") { } { std::ostringstream oss; - proxy.Call("activate", {"1", "nopadding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 1 nopadding\n"); + proxy.Call("activate", {}, -1, GET, oss); + REQUIRE(oss.str() == "activate 1\n"); } { std::ostringstream oss; - proxy.Call("activate", {"0", "padding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 0 padding\n"); - } - { - std::ostringstream oss; - proxy.Call("activate", {"0", "nopadding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 0 nopadding\n"); - } - { - std::ostringstream oss; - proxy.Call("activate", {"1", "padding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 1 padding\n"); + proxy.Call("activate", {"0"}, -1, PUT, oss); + REQUIRE(oss.str() == "activate 0\n"); } for (int i = 0; i != det.size(); ++i) { det.setActive(prev_val[i], {i}); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index b71d9678e..798498a2c 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -287,7 +287,7 @@ TEST_CASE("comp_disable_time", "[.cmd]") { Detector det; CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::JUNGFRAU) { + if (det_type == defs::JUNGFRAU && det.getChipVersion().squash()*10 == 11) { auto prev_val = det.getComparatorDisableTime(); { std::ostringstream oss; diff --git a/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp b/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp index ed4f1ce7b..2a964d123 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp @@ -308,12 +308,13 @@ TEST_CASE("rx_udpsocksize", "[.cmd][.rx]") { CmdProxy proxy(&det); int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash( "Need same udp socket buffer size to test"); - std::string s_new_val = std::to_string(prev_val - 1000); - { + std::string s_new_val = std::to_string(prev_val); + /*std::string s_new_val = std::to_string(prev_val - 1000); + { Need permissions std::ostringstream oss; proxy.Call("rx_udpsocksize", {s_new_val}, -1, PUT, oss); REQUIRE(oss.str() >= "rx_udpsocksize " + s_new_val + "\n"); - } + }*/ { std::ostringstream oss; proxy.Call("rx_udpsocksize", {}, -1, GET, oss); diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 63ecf434b..5f68c922c 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -345,7 +345,7 @@ TEST_CASE("thresholdnotb", "[.cmd]") { std::string senergy = std::to_string(prev_energies[0]); std::ostringstream oss1, oss2; proxy.Call("thresholdnotb", {senergy, "standard"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "threshold [" + senergy + ", standard]\n"); + REQUIRE(oss1.str() == "thresholdnotb [" + senergy + ", standard]\n"); proxy.Call("threshold", {}, -1, GET, oss2); REQUIRE(oss2.str() == "threshold " + senergy + "\n"); REQUIRE_THROWS(proxy.Call("thresholdnotb", @@ -973,8 +973,14 @@ TEST_CASE("readoutspeed", "[.cmd]") { TEST_CASE("readoutspeedlist", "[.cmd]") { Detector det; CmdProxy proxy(&det); - REQUIRE_NOTHROW(proxy.Call("readoutspeedlist", {}, -1, GET)); - REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, PUT)); + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU || det_type == defs::EIGER) + { + REQUIRE_NOTHROW(proxy.Call("readoutspeedlist", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, PUT)); + } else { + REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, GET)); + } } TEST_CASE("adcphase", "[.cmd]") { @@ -1575,17 +1581,17 @@ TEST_CASE("currentsource", "[.cmd]") { { std::ostringstream oss; proxy.Call("currentsource", {"1"}, -1, PUT, oss); - REQUIRE(oss.str() == "currentsource 1\n"); + REQUIRE(oss.str() == "currentsource [1]\n"); } { std::ostringstream oss; proxy.Call("currentsource", {"0"}, -1, PUT, oss); - REQUIRE(oss.str() == "currentsource 0\n"); + REQUIRE(oss.str() == "currentsource [0]\n"); } { std::ostringstream oss; proxy.Call("currentsource", {}, -1, GET, oss); - REQUIRE(oss.str() == "currentsource 0\n"); + REQUIRE(oss.str() == "currentsource [disabled]\n"); } REQUIRE_THROWS( proxy.Call("currentsource", {"1", "fix", "42"}, -1, PUT)); @@ -1772,6 +1778,9 @@ TEST_CASE("defaultdac", "[.cmd]") { REQUIRE_THROWS(proxy.Call("defaultdac", {"blabla"}, -1, PUT)); auto daclist = det.getDacList(); for (auto it : daclist) { + if (it == defs::VTHRESHOLD) { + continue; + } auto dacname = sls::ToString(it); auto prev_val = det.getDefaultDac(it); { @@ -1916,6 +1925,9 @@ TEST_CASE("blockingtrigger", "[.cmd]") { proxy.Call("blockingtrigger", {}, -1, PUT, oss); REQUIRE(oss.str() == "blockingtrigger successful\n"); } + if (det.isVirtualDetectorServer().tsquash("inconsistent virtual detectors")) { + std::this_thread::sleep_for(std::chrono::seconds(2)); + } auto currentfnum = det.getNextFrameNumber().tsquash("inconsistent frame nr in test"); REQUIRE(nextframenumber + 1 == currentfnum); @@ -2310,7 +2322,7 @@ TEST_CASE("udp_firstdst", "[.cmd]") { det.setFirstUDPDestination(prev_val[i], {i}); } } else { - REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("udp_firstdst", {}, -1, GET)); } }