merge from 6.1.2.rc for stop detector (eiger)

This commit is contained in:
Erik Fröjdh 2022-11-25 09:55:51 +01:00 committed by Dhanya Thattil
parent 61c31ed44a
commit 255a75a646

View File

@ -821,7 +821,19 @@ void Detector::startDetectorReadout() {
}
void Detector::stopDetector(Positions pos) {
pimpl->Parallel(&Module::stopAcquisition, pos);
// stop and check status X times
int retries{0};
// avoid default construction of runStatus::IDLE on squash
auto status = getDetectorStatus().squash(defs::runStatus::RUNNING);
while (status != defs::runStatus::IDLE) {
pimpl->Parallel(&Module::stopAcquisition, pos);
status = getDetectorStatus().squash(defs::runStatus::RUNNING);
++retries;
if (retries == 10)
throw RuntimeError("Could not stop detector");
}
// validate consistent frame numbers
switch (getDetectorType().squash()) {