mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
gotthard2: timingsource and currentsource features, (timing source external yet to be implemented in fpga to test (#80)
This commit is contained in:
@ -282,3 +282,62 @@ TEST_CASE("burstperiod", "[.cmd]") {
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("currentsource", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::GOTTHARD2) {
|
||||
auto prev_val = det.getCurrentSource();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("currentsource", {"1"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "currentsource 1\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("currentsource", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "currentsource 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("currentsource", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "currentsource 0\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setCurrentSource(prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("currentsource", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("timingsource", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::GOTTHARD2) {
|
||||
auto prev_val = det.getTimingSource();
|
||||
/* { until its activated in fpga
|
||||
std::ostringstream oss;
|
||||
proxy.Call("timingsource", {"external"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "timingsource external\n");
|
||||
}*/
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("timingsource", {"internal"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "timingsource internal\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("timingsource", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "timingsource internal\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setTimingSource(prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("timingsource", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user