mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
fix to not throw exception when stopping detector when it really stopped, expecting idle instead of stopped flag (#595)
This commit is contained in:
@ -826,7 +826,12 @@ void Detector::stopDetector(Positions pos) {
|
||||
int retries{0};
|
||||
// avoid default construction of runStatus::IDLE on squash
|
||||
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);
|
||||
status = getDetectorStatus().squash(defs::runStatus::RUNNING);
|
||||
++retries;
|
||||
|
Reference in New Issue
Block a user