diff --git a/RELEASE.txt b/RELEASE.txt index 8381d2d85..ab0a4c0f3 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -483,6 +483,12 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2 to access shared memory without creating it first. + * Stop detector when receiver is stuck + If receiver was stuck or crashed, stop acquisition command should + stop detector first before checking receiver status to restream + dummy header. Fixed. + + * Free and config command fail Free and config command checked mismatch of size of shared memory before freeing or loading new config. Fixed. diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index ed1d07622..a64dadd95 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1224,8 +1224,7 @@ int DetectorImpl::acquire() { // let the progress thread (no callback) know acquisition is done if (dataReady == nullptr) { setJoinThreadFlag(true); - } - if (receiver) { + } else if (receiver) { while (numZmqRunning != 0) { Parallel(&Module::restreamStopFromReceiver, {}); std::this_thread::sleep_for(std::chrono::milliseconds(200)); @@ -1315,6 +1314,7 @@ void DetectorImpl::processData(bool receiver) { } // only update progress else { + LOG(logINFO) << "Type 'q' and hit enter to stop"; double progress = 0; printProgress(progress); diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 1bb47c085..1efd3a9fc 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -870,26 +870,25 @@ void Module::startReadout() { } void Module::stopAcquisition() { - // get status before stopping acquisition - runStatus s = ERROR, r = ERROR; - bool zmqstreaming = false; + + // get det status before stopping acq + runStatus detStatus = ERROR; try { - if (shm()->useReceiverFlag && getReceiverStreaming()) { - zmqstreaming = true; - s = getRunStatus(); - r = getReceiverStatus(); - } + detStatus = getRunStatus(); } catch (...) { - // if receiver crashed, stop detector in any case - 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(); + // restream dummy header, if rxr streaming and det idle before stop + try { + if (shm()->useReceiverFlag && getReceiverStreaming()) { + if (detStatus == IDLE && getReceiverStatus() == IDLE) { + restreamStopFromReceiver(); + } + } + } catch (...) { } }