diff --git a/slsDetectorServers/slsDetectorServer/src/common.c b/slsDetectorServers/slsDetectorServer/src/common.c index eca942733..d1151bfa0 100644 --- a/slsDetectorServers/slsDetectorServer/src/common.c +++ b/slsDetectorServers/slsDetectorServer/src/common.c @@ -226,7 +226,8 @@ int getModuleIdInFile(int *ret, char *mess, char *fileName) { if (fd == NULL) { #ifdef JUNGFRAUD *ret = OK; - LOG(logWARNING, ("Could not find detid_jungfrau.txt to set module id\n")); + LOG(logWARNING, + ("Could not find detid_jungfrau.txt to set module id\n")); return 0; #else *ret = FAIL; diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index bb37e1db9..36eb2602f 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -289,8 +289,8 @@ std::string CmdProxy::Versions(int action) { << OutString( det->getDetectorServerVersion(std::vector{det_id})); if (!eiger) - os << "\nHardware : " - << OutString(det->getHardwareVersion(std::vector{det_id})); + os << "\nHardware : " + << OutString(det->getHardwareVersion(std::vector{det_id})); os << "\nKernel : " << OutString(det->getKernelVersion({std::vector{det_id}})); if (det->getUseReceiverFlag().squash(true)) { diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 061617a97..fcfca99d3 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -488,7 +488,8 @@ void DetectorImpl::setTransmissionDelay(int step) { "Transmission delay is not implemented for the this detector."); } - //using a asyc+future directly (instead of Parallel) to pass different values + // using a asyc+future directly (instead of Parallel) to pass different + // values std::vector> futures; for (int i = 0; i != size(); ++i) { if (eiger) { @@ -509,7 +510,7 @@ void DetectorImpl::setTransmissionDelay(int step) { } } - //wait for calls to complete + // wait for calls to complete for (auto &f : futures) f.get(); } diff --git a/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp b/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp index 4ee25036e..fbe801ba1 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp @@ -586,7 +586,8 @@ TEST_CASE("vetostream", "[.cmd]") { CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); if (det_type == defs::GOTTHARD2) { - auto prev_val = det.getVetoStream().tsquash("inconsistent veto stream to test"); + auto prev_val = + det.getVetoStream().tsquash("inconsistent veto stream to test"); { std::ostringstream oss; proxy.Call("vetostream", {"none"}, -1, PUT, oss); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index 5ac516b9a..21e8eb1e8 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -98,7 +98,6 @@ TEST_CASE("Setting and reading back Jungfrau dacs", "[.cmd][.dacs]") { /* Network Configuration (Detector<->Receiver) */ - TEST_CASE("selinterface", "[.cmd]") { Detector det; CmdProxy proxy(&det); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp b/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp index 02f0a49ad..f08612096 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp @@ -565,7 +565,7 @@ TEST_CASE("pumpprobe", "[.cmd]") { // mask with counter 2 disabled and enabled(to test vth2) uint32_t fixedMask[2] = {0x4, 0x3}; for (int i = 0; i != 2; ++i) { - std::cout << "i:"<< i < #include "sls/versionAPI.h" @@ -130,7 +130,7 @@ TEST_CASE("rx_missingpackets", "[.cmd][.rx]") { det.setFileWrite(false); // avoid writing or error on file creation CmdProxy proxy(&det); auto prev_frames = - det.getNumberOfFrames().tsquash("inconsistent #frames in test"); + det.getNumberOfFrames().tsquash("inconsistent #frames in test"); det.setNumberOfFrames(100); { // some missing packets @@ -798,7 +798,8 @@ TEST_CASE("rx_zmqport", "[.cmd][.rx]") { Detector det; CmdProxy proxy(&det); auto prev_val_zmqport = det.getRxZmqPort(); - auto prev_val_numinterfaces = det.getNumberofUDPInterfaces().tsquash("inconsistent number of udp interfaces to test"); + auto prev_val_numinterfaces = det.getNumberofUDPInterfaces().tsquash( + "inconsistent number of udp interfaces to test"); int socketsperdetector = 1; auto det_type = det.getDetectorType().squash(); diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 8357c64a1..dcee45551 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -123,7 +123,6 @@ TEST_CASE("hardwareversion", "[.cmd]") { } else { REQUIRE_THROWS(proxy.Call("hardwareversion", {"0"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("hardwareversion", {}, -1, GET)); - } } @@ -565,13 +564,14 @@ TEST_CASE("fliprows", "[.cmd]") { auto det_type = det.getDetectorType().squash(); bool jungfrauhw2 = false; if (det_type == defs::JUNGFRAU && - ((det.getHardwareVersion().tsquash("inconsistent serial number to test") - == "2.0"))) { + ((det.getHardwareVersion().tsquash( + "inconsistent serial number to test") == "2.0"))) { jungfrauhw2 = true; } if (det_type == defs::EIGER || jungfrauhw2) { auto previous = det.getFlipRows(); - auto previous_numudp = det.getNumberofUDPInterfaces().tsquash("inconsistent number of udp interfaces to test"); + auto previous_numudp = det.getNumberofUDPInterfaces().tsquash( + "inconsistent number of udp interfaces to test"); if (det_type == defs::JUNGFRAU) { det.setNumberofUDPInterfaces(2); } @@ -1651,8 +1651,8 @@ TEST_CASE("readnrows", "[.cmd]") { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { bool jungfrauhw2 = false; if (det_type == defs::JUNGFRAU && - ((det.getHardwareVersion().tsquash("inconsistent hardware version number to test") - == "2.0"))) { + ((det.getHardwareVersion().tsquash( + "inconsistent hardware version number to test") == "2.0"))) { jungfrauhw2 = true; } if (det_type == defs::JUNGFRAU && !jungfrauhw2) { @@ -2303,33 +2303,35 @@ TEST_CASE("scan", "[.cmd]") { // auto notImplementedPrevious = det.getDAC(notImplementedInd, false); if (det_type == defs::MYTHEN3 && det.size() > 1) { - ;// scan only allowed for single module due to sync + ; // scan only allowed for single module due to sync } else { { std::ostringstream oss; - proxy.Call("scan", {ToString(ind), "500", "1500", "500"}, -1, PUT, oss); - CHECK(oss.str() == "scan [" + ToString(ind) + ", 500, 1500, 500]\n"); - } - { - std::ostringstream oss; - proxy.Call("scan", {}, -1, GET, oss); - CHECK(oss.str() == "scan [enabled\ndac " + ToString(ind) + - "\nstart 500\nstop 1500\nstep " - "500\nsettleTime 1ms\n]\n"); - } - { - std::ostringstream oss; - proxy.Call("scan", {ToString(ind), "500", "1500", "500", "2s"}, -1, PUT, - oss); + proxy.Call("scan", {ToString(ind), "500", "1500", "500"}, -1, PUT, + oss); CHECK(oss.str() == - "scan [" + ToString(ind) + ", 500, 1500, 500, 2s]\n"); + "scan [" + ToString(ind) + ", 500, 1500, 500]\n"); } { std::ostringstream oss; proxy.Call("scan", {}, -1, GET, oss); CHECK(oss.str() == "scan [enabled\ndac " + ToString(ind) + - "\nstart 500\nstop 1500\nstep " - "500\nsettleTime 2s\n]\n"); + "\nstart 500\nstop 1500\nstep " + "500\nsettleTime 1ms\n]\n"); + } + { + std::ostringstream oss; + proxy.Call("scan", {ToString(ind), "500", "1500", "500", "2s"}, -1, + PUT, oss); + CHECK(oss.str() == + "scan [" + ToString(ind) + ", 500, 1500, 500, 2s]\n"); + } + { + std::ostringstream oss; + proxy.Call("scan", {}, -1, GET, oss); + CHECK(oss.str() == "scan [enabled\ndac " + ToString(ind) + + "\nstart 500\nstop 1500\nstep " + "500\nsettleTime 2s\n]\n"); } { std::ostringstream oss; @@ -2344,13 +2346,15 @@ TEST_CASE("scan", "[.cmd]") { { std::ostringstream oss; proxy.Call("scan", {ToString(ind), "1500", "500", "-500"}, -1, PUT, - oss); - CHECK(oss.str() == "scan [" + ToString(ind) + ", 1500, 500, -500]\n"); + oss); + CHECK(oss.str() == + "scan [" + ToString(ind) + ", 1500, 500, -500]\n"); } CHECK_THROWS(proxy.Call( - "scan", {ToString(notImplementedInd), "500", "1500", "500"}, -1, PUT)); - CHECK_THROWS( - proxy.Call("scan", {ToString(ind), "500", "1500", "-500"}, -1, PUT)); + "scan", {ToString(notImplementedInd), "500", "1500", "500"}, -1, + PUT)); + CHECK_THROWS(proxy.Call("scan", {ToString(ind), "500", "1500", "-500"}, + -1, PUT)); CHECK_THROWS( proxy.Call("scan", {ToString(ind), "1500", "500", "500"}, -1, PUT)); @@ -2358,15 +2362,15 @@ TEST_CASE("scan", "[.cmd]") { { std::ostringstream oss; proxy.Call("scan", {"trimbits", "0", "63", "16", "2s"}, -1, PUT, - oss); + oss); CHECK(oss.str() == "scan [trimbits, 0, 63, 16, 2s]\n"); } { std::ostringstream oss; proxy.Call("scan", {}, -1, GET, oss); CHECK(oss.str() == - "scan [enabled\ndac trimbits\nstart 0\nstop 48\nstep " - "16\nsettleTime 2s\n]\n"); + "scan [enabled\ndac trimbits\nstart 0\nstop 48\nstep " + "16\nsettleTime 2s\n]\n"); } } @@ -2416,7 +2420,7 @@ TEST_CASE("numinterfaces", "[.cmd]") { REQUIRE(oss.str() == "numinterfaces 1\n"); } det.setNumberofUDPInterfaces(prev_val); - } else if (det_type == defs::EIGER) { + } else if (det_type == defs::EIGER) { REQUIRE_THROWS(proxy.Call("numinterfaces", {"1"}, -1, PUT)); { std::ostringstream oss; @@ -2750,7 +2754,8 @@ TEST_CASE("txdelay", "[.cmd]") { det_type == defs::MYTHEN3) { // cannot get transmission delay with just one module - if ((det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) && (det.size() < 2)) { + if ((det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) && + (det.size() < 2)) { REQUIRE_THROWS(proxy.Call("txdelay", {}, -1, GET)); int val = 5; std::string sval = std::to_string(val); @@ -2759,7 +2764,7 @@ TEST_CASE("txdelay", "[.cmd]") { proxy.Call("txdelay", {sval}, -1, PUT, oss1); REQUIRE(oss1.str() == "txdelay " + sval + "\n"); } - } + } else { Result prev_left, prev_right; @@ -2930,10 +2935,9 @@ TEST_CASE("resetfpga", "[.cmd]") { auto det_type = det.getDetectorType().squash(); if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { - // reset will also reset udp info from config file (comment out for invdividual tests) - // std::ostringstream oss; - // proxy.Call("resetfpga", {}, -1, PUT, oss); - // REQUIRE(oss.str() == "resetfpga successful\n"); + // reset will also reset udp info from config file (comment out for + // invdividual tests) std::ostringstream oss; proxy.Call("resetfpga", + // {}, -1, PUT, oss); REQUIRE(oss.str() == "resetfpga successful\n"); REQUIRE_THROWS(proxy.Call("resetfpga", {}, -1, GET)); } else { REQUIRE_THROWS(proxy.Call("resetfpga", {}, -1, GET)); diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 57641fd70..0a80f26cb 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -4,10 +4,10 @@ #define RELEASE "developer" #define APILIB "developer 0x221108" #define APIRECEIVER "developer 0x221108" -#define APICTB "developer 0x221207" -#define APIGOTTHARD "developer 0x221207" +#define APICTB "developer 0x221207" +#define APIGOTTHARD "developer 0x221207" #define APIGOTTHARD2 "developer 0x221207" -#define APIJUNGFRAU "developer 0x221207" -#define APIMYTHEN3 "developer 0x221207" -#define APIMOENCH "developer 0x221207" -#define APIEIGER "developer 0x221207" +#define APIJUNGFRAU "developer 0x221207" +#define APIMYTHEN3 "developer 0x221207" +#define APIMOENCH "developer 0x221207" +#define APIEIGER "developer 0x221207"