fix to not throw exception when stopping detector when it really stopped, expecting idle instead of stopped flag (#595)

This commit is contained in:
Dhanya Thattil 2022-12-12 11:39:20 +01:00 committed by GitHub
parent ff5aa13073
commit 3fb22dc20a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -440,6 +440,11 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
Changes or Fixes: Changes or Fixes:
* [Jungfrau][Gotthard2][Mythen3][Gotthard][Moench][Ctb] Can't stop
This bug was introduced in 6.1.1, when stopping an acquisition saying it
cannot stop, even though it was successful. It is fixed now.
* Free and config command fail * Free and config command fail
Free and config command checked mismatch of size of shared memory before Free and config command checked mismatch of size of shared memory before
freeing or loading new config. Fixed. freeing or loading new config. Fixed.

View File

@ -826,7 +826,12 @@ void Detector::stopDetector(Positions pos) {
int retries{0}; int retries{0};
// avoid default construction of runStatus::IDLE on squash // avoid default construction of runStatus::IDLE on squash
auto status = getDetectorStatus().squash(defs::runStatus::RUNNING); auto status = getDetectorStatus().squash(defs::runStatus::RUNNING);
while (status != defs::runStatus::IDLE) { while (status != defs::runStatus::IDLE &&
status != defs::runStatus::STOPPED) {
if (status == defs::runStatus::ERROR) {
throw RuntimeError(
"Could not stop detector. Returned error status.");
}
pimpl->Parallel(&Module::stopAcquisition, pos); pimpl->Parallel(&Module::stopAcquisition, pos);
status = getDetectorStatus().squash(defs::runStatus::RUNNING); status = getDetectorStatus().squash(defs::runStatus::RUNNING);
++retries; ++retries;