mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
Fix stop rx stuck (#669)
stop should really stop even if receiver had crashed, so check rx status after sending stop; also ensuring restream in acquire happens only if thers a callback
This commit is contained in:
parent
878eab9fc3
commit
fe281bd1b1
@ -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.
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 (...) {
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user