mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
WIP
This commit is contained in:
parent
0a66605111
commit
8ffb27c300
@ -228,6 +228,41 @@ TEST_CASE("Setting and reading back EIGER dacs", "[.cmd][.dacs][.new]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* acquisition */
|
||||||
|
|
||||||
|
TEST_CASE("trigger", "[.cmd][.new]") {
|
||||||
|
Detector det;
|
||||||
|
CmdProxy proxy(&det);
|
||||||
|
REQUIRE_THROWS(proxy.Call("trigger", {}, -1, GET));
|
||||||
|
auto det_type = det.getDetectorType().squash();
|
||||||
|
if (det_type != defs::EIGER) {
|
||||||
|
REQUIRE_THROWS(proxy.Call("trigger", {}, -1, PUT));
|
||||||
|
} else {
|
||||||
|
auto prev_timing =
|
||||||
|
det.getTimingMode().tsquash("inconsistent timing mode in test");
|
||||||
|
auto prev_frames =
|
||||||
|
det.getNumberOfFrames().tsquash("inconsistent #frames in test");
|
||||||
|
det.setTimingMode(defs::TRIGGER_EXPOSURE);
|
||||||
|
det.setNumberOfFrames(1);
|
||||||
|
auto startingfnum = det.getStartingFrameNumber().tsquash(
|
||||||
|
"inconsistent frame nr in test");
|
||||||
|
det.startDetector();
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("trigger", {}, -1, PUT, oss);
|
||||||
|
REQUIRE(oss.str() == "trigger successful\n");
|
||||||
|
}
|
||||||
|
auto currentfnum = det.getStartingFrameNumber().tsquash(
|
||||||
|
"inconsistent frame nr in test");
|
||||||
|
REQUIRE(startingfnum + 1 == currentfnum);
|
||||||
|
det.stopDetector();
|
||||||
|
det.setTimingMode(prev_timing);
|
||||||
|
det.setNumberOfFrames(prev_frames);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Network Configuration (Detector<->Receiver) */
|
||||||
|
|
||||||
TEST_CASE("Eiger transmission delay", "[.cmd]") {
|
TEST_CASE("Eiger transmission delay", "[.cmd]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
@ -493,84 +528,3 @@ TEST_CASE("quad", "[.cmd]") {
|
|||||||
REQUIRE_THROWS(proxy.Call("quad", {}, -1, GET));
|
REQUIRE_THROWS(proxy.Call("quad", {}, -1, GET));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST_CASE("trigger", "[.cmd]") {
|
|
||||||
// Detector det;
|
|
||||||
// CmdProxy proxy(&det);
|
|
||||||
// auto det_type = det.getDetectorType().squash();
|
|
||||||
// if (det_type != defs::EIGER) {
|
|
||||||
// proxy.Call("trigger", {}, -1, PUT);
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// proxy.Call("timing", {"trigger"}, -1, PUT, oss);
|
|
||||||
// REQUIRE(oss.str() == "timing trigger\n");
|
|
||||||
// }
|
|
||||||
// auto startingfnum = det.getStartingFrameNumber().tsquash(
|
|
||||||
// "inconsistent frame nr in test");
|
|
||||||
// det.startDetector();
|
|
||||||
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// proxy.Call("trigger", {}, -1, PUT, oss);
|
|
||||||
// REQUIRE(oss.str() == "trigger successful\n");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// auto currentfnum = det.getStartingFrameNumber().tsquash(
|
|
||||||
// "inconsistent frame nr in test");
|
|
||||||
|
|
||||||
// REQUIRE(startingfnum +1 == currentfnum);
|
|
||||||
// det.stopDetector();
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// proxy.Call("timing", {"auto"}, -1, PUT, oss);
|
|
||||||
// REQUIRE(oss.str() == "timing auto\n");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if(test::type != slsDetectorDefs::EIGER) {
|
|
||||||
// REQUIRE_THROWS(multiSlsDetectorClient("trigger", PUT));
|
|
||||||
// } else {
|
|
||||||
// // trigger
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("timing trigger", PUT,
|
|
||||||
// nullptr, oss)); REQUIRE(oss.str() == "timing trigger\n");
|
|
||||||
// }
|
|
||||||
// int startingfnum = 0;
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("startingfnum", GET,
|
|
||||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
|
||||||
// strlen("startingfnum ")); startingfnum = std::stoi(s);
|
|
||||||
// }
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("start", PUT, nullptr,
|
|
||||||
// oss)); REQUIRE(oss.str() == "start successful\n");
|
|
||||||
// }
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("status", GET,
|
|
||||||
// nullptr, oss)); REQUIRE(oss.str() != "status idle\n");
|
|
||||||
// REQUIRE(oss.str()
|
|
||||||
// != "status stopped\n");
|
|
||||||
// }
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("trigger", PUT,
|
|
||||||
// nullptr, oss)); REQUIRE(oss.str() == "trigger successful\n");
|
|
||||||
// }
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("stop", PUT));
|
|
||||||
// int currentfnum = 0;
|
|
||||||
// {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("startingfnum", GET,
|
|
||||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
|
||||||
// strlen("startingfnum ")); currentfnum = std::stoi(s);
|
|
||||||
// }
|
|
||||||
// REQUIRE((startingfnum + 1) == currentfnum);
|
|
||||||
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("timing auto", PUT));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
@ -1095,6 +1095,43 @@ TEST_CASE("startingfnum", "[.cmd][.new]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Network Configuration (Detector<->Receiver) */
|
||||||
|
|
||||||
|
TEST_CASE("numinterfaces", "[.cmd][.new]") {
|
||||||
|
Detector det;
|
||||||
|
CmdProxy proxy(&det);
|
||||||
|
auto det_type = det.getDetectorType().squash();
|
||||||
|
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) {
|
||||||
|
auto prev_val = det.getNumberofUDPInterfaces().tsquash(
|
||||||
|
"inconsistent numinterfaces to test");
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("numinterfaces", {"2"}, -1, PUT, oss);
|
||||||
|
REQUIRE(oss.str() == "numinterfaces 2\n");
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("numinterfaces", {"1"}, -1, PUT, oss);
|
||||||
|
REQUIRE(oss.str() == "numinterfaces 1\n");
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("numinterfaces", {}, -1, GET, oss);
|
||||||
|
REQUIRE(oss.str() == "numinterfaces 1\n");
|
||||||
|
}
|
||||||
|
det.setNumberofUDPInterfaces(prev_val);
|
||||||
|
} else {
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("numinterfaces", {}, -1, GET, oss);
|
||||||
|
REQUIRE(oss.str() == "numinterfaces 1\n");
|
||||||
|
REQUIRE_THROWS(proxy.Call("numinterfaces", {"1"}, -1, PUT));
|
||||||
|
}
|
||||||
|
REQUIRE_THROWS(proxy.Call("numinterfaces", {"3"}, -1, PUT));
|
||||||
|
REQUIRE_THROWS(proxy.Call("numinterfaces", {"0"}, -1, PUT));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Advanced */
|
||||||
|
|
||||||
TEST_CASE("initialchecks", "[.cmd]") {
|
TEST_CASE("initialchecks", "[.cmd]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
@ -1124,18 +1161,7 @@ TEST_CASE("initialchecks", "[.cmd]") {
|
|||||||
det.setInitialChecks(check);
|
det.setInitialChecks(check);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("user", "[.cmd]") {
|
/* Insignificant */
|
||||||
Detector det;
|
|
||||||
CmdProxy proxy(&det);
|
|
||||||
proxy.Call("user", {}, -1, GET);
|
|
||||||
|
|
||||||
// This is a get only command
|
|
||||||
REQUIRE_THROWS(proxy.Call("user", {}, -1, PUT));
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEST_CASE("execcommand", "[.cmd]") {
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("execcommand ls", PUT));
|
|
||||||
// }
|
|
||||||
|
|
||||||
TEST_CASE("port", "[.cmd]") {
|
TEST_CASE("port", "[.cmd]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
@ -1171,6 +1197,19 @@ TEST_CASE("stopport", "[.cmd]") {
|
|||||||
REQUIRE(port == 1953);
|
REQUIRE(port == 1953);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TEST_CASE("execcommand", "[.cmd]") {
|
||||||
|
// REQUIRE_NOTHROW(multiSlsDetectorClient("execcommand ls", PUT));
|
||||||
|
// }
|
||||||
|
|
||||||
|
TEST_CASE("user", "[.cmd]") {
|
||||||
|
Detector det;
|
||||||
|
CmdProxy proxy(&det);
|
||||||
|
proxy.Call("user", {}, -1, GET);
|
||||||
|
|
||||||
|
// This is a get only command
|
||||||
|
REQUIRE_THROWS(proxy.Call("user", {}, -1, PUT));
|
||||||
|
}
|
||||||
|
|
||||||
// TEST_CASE("reg", "[.cmd]") {
|
// TEST_CASE("reg", "[.cmd]") {
|
||||||
// if (test::type == defs::JUNGFRAU) {
|
// if (test::type == defs::JUNGFRAU) {
|
||||||
// {
|
// {
|
||||||
@ -2860,29 +2899,6 @@ TEST_CASE("zmqport", "[.cmd]") {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// TEST_CASE("numinterfaces", "[.cmd][.jungfrau]") {
|
|
||||||
// if (test::type == defs::JUNGFRAU) {
|
|
||||||
// {
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("numinterfaces 2", PUT));
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("0:numinterfaces", GET,
|
|
||||||
// nullptr, oss)); REQUIRE(oss.str() == "numinterfaces 2\n");
|
|
||||||
// }
|
|
||||||
// {
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("numinterfaces 1", PUT));
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("0:numinterfaces", GET,
|
|
||||||
// nullptr, oss)); REQUIRE(oss.str() == "numinterfaces 1\n");
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// std::ostringstream oss;
|
|
||||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("0:numinterfaces", GET,
|
|
||||||
// nullptr, oss)); REQUIRE(oss.str() == "numinterfaces 1\n");
|
|
||||||
// }
|
|
||||||
// REQUIRE_THROWS(multiSlsDetectorClient("numinterfaces 3", PUT));
|
|
||||||
// REQUIRE_THROWS(multiSlsDetectorClient("numinterfaces 0", PUT));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// TEST_CASE("adc", "[.cmd][.ctb]") {
|
// TEST_CASE("adc", "[.cmd][.ctb]") {
|
||||||
// if (test::type != defs::CHIPTESTBOARD) {
|
// if (test::type != defs::CHIPTESTBOARD) {
|
||||||
// REQUIRE_THROWS(multiSlsDetectorClient("adc 8", GET));
|
// REQUIRE_THROWS(multiSlsDetectorClient("adc 8", GET));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user