Merge pull request #193 from slsdetectorgroup/stopfix

Stopfix
This commit is contained in:
Dhanya Thattil 2020-10-01 17:57:48 +02:00 committed by GitHub
commit 855ed36db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,13 +411,20 @@ void Module::stopAcquisition() {
// get status before stopping acquisition // get status before stopping acquisition
runStatus s = ERROR, r = ERROR; runStatus s = ERROR, r = ERROR;
bool zmqstreaming = false; bool zmqstreaming = false;
try {
if (shm()->useReceiverFlag && getReceiverStreaming()) { if (shm()->useReceiverFlag && getReceiverStreaming()) {
zmqstreaming = true; zmqstreaming = true;
s = getRunStatus(); s = getRunStatus();
r = getReceiverStatus(); r = getReceiverStatus();
} }
} catch (...) {
// if receiver crashed, stop detector in any case
zmqstreaming = false;
}
sendToDetectorStop(F_STOP_ACQUISITION); sendToDetectorStop(F_STOP_ACQUISITION);
shm()->stoppedFlag = true; shm()->stoppedFlag = true;
// if rxr streaming and acquisition finished, restream dummy stop packet // if rxr streaming and acquisition finished, restream dummy stop packet
if (zmqstreaming && (s == IDLE) && (r == IDLE)) { if (zmqstreaming && (s == IDLE) && (r == IDLE)) {
restreamStopFromReceiver(); restreamStopFromReceiver();