gotthard tests passed

This commit is contained in:
maliakal_d 2019-10-22 17:07:38 +02:00
parent 12c7389b8d
commit fa84d17a19
4 changed files with 17 additions and 8 deletions

View File

@ -817,7 +817,7 @@ std::string CmdProxy::ROI(int action) {
os << '[' << it.xmin << ", " << it.xmax << "] \n"; os << '[' << it.xmin << ", " << it.xmax << "] \n";
} }
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
if (det_id == -1) { if (det_id == -1 && det->size() > 1) {
throw sls::RuntimeError("Cannot execute ROI at multi module level"); throw sls::RuntimeError("Cannot execute ROI at multi module level");
} }
if (args.size() != 2) { if (args.size() != 2) {

View File

@ -615,7 +615,7 @@ TEST_CASE("extsig", "[.cmd][.gotthard]") {
REQUIRE_NOTHROW(multiSlsDetectorClient("extsig", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient("extsig", GET, nullptr, oss));
REQUIRE(oss.str() == "extsig trigger_in_rising_edge\n"); REQUIRE(oss.str() == "extsig trigger_in_rising_edge\n");
} }
REQUIRE_NOTHROW(multiSlsDetectorClient("extsig gating", PUT)); REQUIRE_THROWS(multiSlsDetectorClient("extsig gating", PUT));
} else { } else {
REQUIRE_THROWS(multiSlsDetectorClient("extsig", GET)); REQUIRE_THROWS(multiSlsDetectorClient("extsig", GET));
} }
@ -680,12 +680,13 @@ TEST_CASE("roi", "[.cmd][.gotthard]") {
} }
{ {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient("clearroi", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient("clearroi", PUT, nullptr, oss));
REQUIRE(oss.str() == "clearroi [-1, -1] \n"); REQUIRE(oss.str() == "clearroi [-1, -1] \n");
} }
REQUIRE_THROWS(multiSlsDetectorClient("roi 0 256", PUT)); REQUIRE_THROWS(multiSlsDetectorClient("roi 0 256", PUT));
} else { } else {
REQUIRE_THROWS(multiSlsDetectorClient("roi", GET)); REQUIRE_THROWS(multiSlsDetectorClient("roi", GET));
REQUIRE_THROWS(multiSlsDetectorClient("clearroi", PUT));
} }
} }
@ -1893,9 +1894,11 @@ TEST_CASE("maxadcphaseshift", "[.cmd][.ctb][.jungfrau]") {
} }
TEST_CASE("adcphase", "[.cmd][.ctb][.jungfrau][.gotthard]") { TEST_CASE("adcphase", "[.cmd][.ctb][.jungfrau][.gotthard]") {
if (test::type != slsDetectorDefs::CHIPTESTBOARD && test::type != slsDetectorDefs::JUNGFRAU && test::type != slsDetectorDefs::GOTTHARD) {
REQUIRE_THROWS(multiSlsDetectorClient("adcphase", GET)); if (test::type == slsDetectorDefs::GOTTHARD) {
} else { REQUIRE_NOTHROW(multiSlsDetectorClient("adcphase 120", PUT));
// get is -1
} else if (test::type == slsDetectorDefs::CHIPTESTBOARD || test::type == slsDetectorDefs::JUNGFRAU) {
int prev_val = 0; int prev_val = 0;
{ {
std::ostringstream oss; std::ostringstream oss;
@ -1924,6 +1927,8 @@ TEST_CASE("adcphase", "[.cmd][.ctb][.jungfrau][.gotthard]") {
REQUIRE(oss.str() == "adcphase 20 deg\n"); REQUIRE(oss.str() == "adcphase 20 deg\n");
} }
REQUIRE_NOTHROW(multiSlsDetectorClient("adcphase " + std::to_string(prev_val), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("adcphase " + std::to_string(prev_val), PUT));
} else {
REQUIRE_THROWS(multiSlsDetectorClient("adcphase", GET));
} }
} }
@ -2249,6 +2254,10 @@ TEST_CASE("triggersl", "[.cmd][.jungfrau][gotthard][ctb]") {
TEST_CASE("delayl", "[.cmd][.jungfrau][gotthard][ctb]") { TEST_CASE("delayl", "[.cmd][.jungfrau][gotthard][ctb]") {
if(test::type == slsDetectorDefs::EIGER) { if(test::type == slsDetectorDefs::EIGER) {
REQUIRE_THROWS(multiSlsDetectorClient("delayl", GET)); REQUIRE_THROWS(multiSlsDetectorClient("delayl", GET));
} else if(test::type == slsDetectorDefs::GOTTHARD) {
REQUIRE_NOTHROW(multiSlsDetectorClient("delay 0", PUT));
REQUIRE_NOTHROW(multiSlsDetectorClient("delayl", GET));
// delayl always gives 0 for gotthard
} else { } else {
REQUIRE_NOTHROW(multiSlsDetectorClient("timing trigger", PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("timing trigger", PUT));
REQUIRE_NOTHROW(multiSlsDetectorClient("frames 1", PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("frames 1", PUT));

View File

@ -5,8 +5,8 @@
#define APIGUI 0x190723 #define APIGUI 0x190723
#define APIMOENCH 0x190820 #define APIMOENCH 0x190820
#define APICTB 0x191011 #define APICTB 0x191011
#define APIGOTTHARD 0x191011
#define APIMYTHEN3 0x191011 #define APIMYTHEN3 0x191011
#define APIGOTTHARD2 0x191017 #define APIGOTTHARD2 0x191017
#define APIEIGER 0x191021 #define APIEIGER 0x191021
#define APIJUNGFRAU 0x191022 #define APIJUNGFRAU 0x191022
#define APIGOTTHARD 0x191021