mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40: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.
|
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 fail
|
||||||
Free and config command checked mismatch of size of shared memory before
|
Free and config command checked mismatch of size of shared memory before
|
||||||
freeing or loading new config. Fixed.
|
freeing or loading new config. Fixed.
|
||||||
|
@ -1224,8 +1224,7 @@ int DetectorImpl::acquire() {
|
|||||||
// let the progress thread (no callback) know acquisition is done
|
// let the progress thread (no callback) know acquisition is done
|
||||||
if (dataReady == nullptr) {
|
if (dataReady == nullptr) {
|
||||||
setJoinThreadFlag(true);
|
setJoinThreadFlag(true);
|
||||||
}
|
} else if (receiver) {
|
||||||
if (receiver) {
|
|
||||||
while (numZmqRunning != 0) {
|
while (numZmqRunning != 0) {
|
||||||
Parallel(&Module::restreamStopFromReceiver, {});
|
Parallel(&Module::restreamStopFromReceiver, {});
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||||
@ -1315,6 +1314,7 @@ void DetectorImpl::processData(bool receiver) {
|
|||||||
}
|
}
|
||||||
// only update progress
|
// only update progress
|
||||||
else {
|
else {
|
||||||
|
LOG(logINFO) << "Type 'q' and hit enter to stop";
|
||||||
double progress = 0;
|
double progress = 0;
|
||||||
printProgress(progress);
|
printProgress(progress);
|
||||||
|
|
||||||
|
@ -870,27 +870,26 @@ void Module::startReadout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Module::stopAcquisition() {
|
void Module::stopAcquisition() {
|
||||||
// get status before stopping acquisition
|
|
||||||
runStatus s = ERROR, r = ERROR;
|
// get det status before stopping acq
|
||||||
bool zmqstreaming = false;
|
runStatus detStatus = ERROR;
|
||||||
try {
|
try {
|
||||||
if (shm()->useReceiverFlag && getReceiverStreaming()) {
|
detStatus = getRunStatus();
|
||||||
zmqstreaming = true;
|
|
||||||
s = getRunStatus();
|
|
||||||
r = getReceiverStatus();
|
|
||||||
}
|
|
||||||
} catch (...) {
|
} 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
|
// restream dummy header, if rxr streaming and det idle before stop
|
||||||
if (zmqstreaming && (s == IDLE) && (r == IDLE)) {
|
try {
|
||||||
|
if (shm()->useReceiverFlag && getReceiverStreaming()) {
|
||||||
|
if (detStatus == IDLE && getReceiverStatus() == IDLE) {
|
||||||
restreamStopFromReceiver();
|
restreamStopFromReceiver();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::restreamStopFromReceiver() {
|
void Module::restreamStopFromReceiver() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user