mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 04:47:14 +02:00
first draft at fixing nextframenumber properly with firmware (#995)
* fixing nextframenumber properly with firmware * updated firmware to have getnextframenumber and fixed setnextframenumber to reset also the header fifo when stopping * fix tests for gotthard2
This commit is contained in:
@ -86,7 +86,7 @@ TEST_CASE("timegotthard2", "[.cmdcall]") {
|
||||
det.setPeriod(prev_val[i], {i});
|
||||
}
|
||||
// period in continuous mode
|
||||
det.setBurstMode(defs::CONTINUOUS_INTERNAL, {});
|
||||
det.setBurstMode(defs::CONTINUOUS_EXTERNAL, {});
|
||||
prev_val = det.getPeriod();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -338,7 +338,7 @@ TEST_CASE("bursts", "[.cmdcall]") {
|
||||
}
|
||||
// continuous mode: reg set to #frames,
|
||||
// but bursts should return same value
|
||||
det.setBurstMode(defs::CONTINUOUS_INTERNAL);
|
||||
det.setBurstMode(defs::CONTINUOUS_EXTERNAL);
|
||||
det.setNumberOfFrames(2);
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -494,13 +494,13 @@ TEST_CASE("burstmode", "[.cmdcall]") {
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("burstmode", {"cw_internal"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "burstmode cw_internal\n");
|
||||
caller.call("burstmode", {"cw_external"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "burstmode cw_external\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("burstmode", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "burstmode cw_internal\n");
|
||||
REQUIRE(oss.str() == "burstmode cw_external\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setBurstMode(burst[i], {i});
|
||||
|
@ -2422,40 +2422,80 @@ TEST_CASE("nextframenumber", "[.cmdcall]") {
|
||||
REQUIRE(oss.str() == "nextframenumber 1\n");
|
||||
}
|
||||
|
||||
auto prev_timing =
|
||||
det.getTimingMode().tsquash("inconsistent timing mode in test");
|
||||
auto prev_frames =
|
||||
det.getNumberOfFrames().tsquash("inconsistent #frames in test");
|
||||
auto prev_exptime =
|
||||
det.getExptime().tsquash("inconsistent exptime in test");
|
||||
auto prev_period =
|
||||
det.getPeriod().tsquash("inconsistent period in test");
|
||||
det.setTimingMode(defs::AUTO_TIMING);
|
||||
det.setNumberOfFrames(1);
|
||||
det.setExptime(std::chrono::microseconds(200));
|
||||
det.setPeriod(std::chrono::milliseconds(1));
|
||||
det.startDetector();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
auto currentfnum =
|
||||
det.getNextFrameNumber().tsquash("inconsistent frame nr in test");
|
||||
REQUIRE(currentfnum == 2);
|
||||
if (det_type == defs::EIGER) {
|
||||
auto prev_tengiga =
|
||||
det.getTenGiga().tsquash("inconsistent ten giga enable");
|
||||
det.setTenGiga(true);
|
||||
det.setNextFrameNumber(1);
|
||||
if (det_type == defs::GOTTHARD2) {
|
||||
auto prev_timing =
|
||||
det.getTimingMode().tsquash("inconsistent timing mode in test");
|
||||
auto prev_frames =
|
||||
det.getNumberOfFrames().tsquash("inconsistent #frames in test");
|
||||
auto prev_exptime =
|
||||
det.getExptime().tsquash("inconsistent exptime in test");
|
||||
auto prev_period =
|
||||
det.getPeriod().tsquash("inconsistent period in test");
|
||||
auto prev_burstmode =
|
||||
det.getBurstMode().tsquash("inconsistent burst mode in test");
|
||||
auto prev_bursts = det.getNumberOfBursts().tsquash(
|
||||
"inconsistent #bursts in test");
|
||||
auto prev_burstperiod = det.getBurstPeriod().tsquash(
|
||||
"inconsistent burst period in test");
|
||||
|
||||
det.setTimingMode(defs::AUTO_TIMING);
|
||||
det.setNumberOfFrames(1);
|
||||
det.setExptime(std::chrono::microseconds(200));
|
||||
det.setPeriod(std::chrono::milliseconds(1));
|
||||
det.setBurstMode(defs::CONTINUOUS_EXTERNAL);
|
||||
det.setNumberOfBursts(1);
|
||||
det.setBurstPeriod(std::chrono::milliseconds(0));
|
||||
|
||||
det.startDetector();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
auto currentfnum = det.getNextFrameNumber().tsquash(
|
||||
"inconsistent frame nr in test");
|
||||
auto currentfnum =
|
||||
det.getNextFrameNumber().tsquash("inconsistent frame nr in test");
|
||||
REQUIRE(currentfnum == 2);
|
||||
det.setTenGiga(prev_tengiga);
|
||||
|
||||
det.setTimingMode(prev_timing);
|
||||
det.setNumberOfFrames(prev_frames);
|
||||
det.setExptime(prev_exptime);
|
||||
det.setPeriod(prev_period);
|
||||
det.setBurstMode(prev_burstmode);
|
||||
det.setNumberOfBursts(prev_bursts);
|
||||
det.setBurstPeriod(prev_burstperiod);
|
||||
} else {
|
||||
auto prev_timing =
|
||||
det.getTimingMode().tsquash("inconsistent timing mode in test");
|
||||
auto prev_frames =
|
||||
det.getNumberOfFrames().tsquash("inconsistent #frames in test");
|
||||
auto prev_exptime =
|
||||
det.getExptime().tsquash("inconsistent exptime in test");
|
||||
auto prev_period =
|
||||
det.getPeriod().tsquash("inconsistent period in test");
|
||||
det.setTimingMode(defs::AUTO_TIMING);
|
||||
det.setNumberOfFrames(1);
|
||||
det.setExptime(std::chrono::microseconds(200));
|
||||
det.setPeriod(std::chrono::milliseconds(1));
|
||||
det.startDetector();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
auto currentfnum =
|
||||
det.getNextFrameNumber().tsquash("inconsistent frame nr in test");
|
||||
REQUIRE(currentfnum == 2);
|
||||
if (det_type == defs::EIGER) {
|
||||
auto prev_tengiga =
|
||||
det.getTenGiga().tsquash("inconsistent ten giga enable");
|
||||
det.setTenGiga(true);
|
||||
det.setNextFrameNumber(1);
|
||||
det.startDetector();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
auto currentfnum = det.getNextFrameNumber().tsquash(
|
||||
"inconsistent frame nr in test");
|
||||
REQUIRE(currentfnum == 2);
|
||||
det.setTenGiga(prev_tengiga);
|
||||
}
|
||||
|
||||
det.setTimingMode(prev_timing);
|
||||
det.setNumberOfFrames(prev_frames);
|
||||
det.setExptime(prev_exptime);
|
||||
det.setPeriod(prev_period);
|
||||
}
|
||||
|
||||
det.setTimingMode(prev_timing);
|
||||
det.setNumberOfFrames(prev_frames);
|
||||
det.setExptime(prev_exptime);
|
||||
det.setPeriod(prev_period);
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setNextFrameNumber(prev_sfnum[i], {i});
|
||||
}
|
||||
|
Reference in New Issue
Block a user