From f31260030b888cb10be56dcf5f81e54497741478 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 1 Oct 2020 17:54:08 +0200 Subject: [PATCH 1/2] bugfix: cannot stop detector if rxr crashed --- slsDetectorSoftware/src/Module.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index b952546dd..6bfa4ce4a 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -411,10 +411,16 @@ void Module::stopAcquisition() { // get status before stopping acquisition runStatus s = ERROR, r = ERROR; bool zmqstreaming = false; - if (shm()->useReceiverFlag && getReceiverStreaming()) { - zmqstreaming = true; - s = getRunStatus(); - r = getReceiverStatus(); + try { + if (shm()->useReceiverFlag && getReceiverStreaming()) { + zmqstreaming = true; + s = getRunStatus(); + r = getReceiverStatus(); + } + } catch (...) { + // if receiver crashed, stop detector in any case + sendToDetectorStop(F_STOP_ACQUISITION); + return; } sendToDetectorStop(F_STOP_ACQUISITION); shm()->stoppedFlag = true; From a730a13cbef406b4129b876f4b3e0134b2a91b08 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 1 Oct 2020 17:57:07 +0200 Subject: [PATCH 2/2] wip --- slsDetectorSoftware/src/Module.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 6bfa4ce4a..04c8835a3 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -419,11 +419,12 @@ void Module::stopAcquisition() { } } catch (...) { // if receiver crashed, stop detector in any case - sendToDetectorStop(F_STOP_ACQUISITION); - return; + zmqstreaming = false; } + sendToDetectorStop(F_STOP_ACQUISITION); shm()->stoppedFlag = true; + // if rxr streaming and acquisition finished, restream dummy stop packet if (zmqstreaming && (s == IDLE) && (r == IDLE)) { restreamStopFromReceiver();