Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer

This commit is contained in:
Erik Frojdh 2020-11-03 08:44:37 +01:00
commit f6fff9d916

View File

@ -1,6 +1,6 @@
#include "CmdProxy.h"
#include "sls/Detector.h"
#include "catch.hpp"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
#include <chrono>
@ -328,16 +328,18 @@ TEST_CASE("exptime", "[.cmd][.time]") {
proxy.Call("exptime", {"1s"}, -1, PUT, oss);
REQUIRE(oss.str() == "exptime 1s\n");
}
{
std::ostringstream oss;
proxy.Call("exptime", {"0"}, -1, PUT, oss);
REQUIRE(oss.str() == "exptime 0\n");
}
{
// Get exptime of single module
std::ostringstream oss;
proxy.Call("exptime", {}, 0, GET, oss);
REQUIRE(oss.str() == "exptime 0ns\n");
if (det_type != defs::JUNGFRAU) {
{
std::ostringstream oss;
proxy.Call("exptime", {"0"}, -1, PUT, oss);
REQUIRE(oss.str() == "exptime 0\n");
}
{
// Get exptime of single module
std::ostringstream oss;
proxy.Call("exptime", {}, 0, GET, oss);
REQUIRE(oss.str() == "exptime 0ns\n");
}
}
det.setExptime(-1, prev_val);
}
@ -1217,6 +1219,7 @@ TEST_CASE("start", "[.cmd][.new]") {
proxy.Call("start", {}, -1, PUT, oss);
REQUIRE(oss.str() == "start successful\n");
}
std::this_thread::sleep_for(std::chrono::milliseconds(200));
{
std::ostringstream oss;
proxy.Call("status", {}, -1, GET, oss);
@ -1245,6 +1248,7 @@ TEST_CASE("stop", "[.cmd][.new]") {
}
det.setExptime(-1, std::chrono::seconds(2));
det.startDetector();
std::this_thread::sleep_for(std::chrono::milliseconds(200));
{
std::ostringstream oss;
proxy.Call("status", {}, -1, GET, oss);
@ -1255,7 +1259,11 @@ TEST_CASE("stop", "[.cmd][.new]") {
proxy.Call("stop", {}, -1, PUT, oss);
REQUIRE(oss.str() == "stop successful\n");
}
{
if (det_type == defs::JUNGFRAU) {
std::ostringstream oss;
proxy.Call("status", {}, -1, GET, oss);
REQUIRE(oss.str() == "status stopped\n");
} else {
std::ostringstream oss;
proxy.Call("status", {}, -1, GET, oss);
REQUIRE(oss.str() == "status idle\n");
@ -1280,6 +1288,7 @@ TEST_CASE("status", "[.cmd][.new]") {
}
det.setExptime(-1, std::chrono::seconds(2));
det.startDetector();
std::this_thread::sleep_for(std::chrono::milliseconds(200));
{
std::ostringstream oss;
proxy.Call("status", {}, -1, GET, oss);