mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +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:
@ -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