restream stop if stop called, temp solution (#1092)

* restream stop if stop called, temp solution until new command for it

* chekckrestream is ambiguous when only checking receiver

* moved restreaming in background to receiver stop instead of detector stop (was in stop before due to gui stop button access), increase to 2s time to restream in client acquire

* minor

* moved stop to module class

* fix from before
This commit is contained in:
maliakal_d 2025-02-11 09:17:25 +01:00 committed by GitHub
parent 60ce31bb17
commit 84e83bf551
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 19 deletions

View File

@ -1179,7 +1179,8 @@ int DetectorImpl::acquire() {
} else if (receiver) {
while (numZmqRunning != 0) {
Parallel(&Module::restreamStopFromReceiver, {});
std::this_thread::sleep_for(std::chrono::milliseconds(200));
// increase time for fewer dummy packets to process
std::this_thread::sleep_for(std::chrono::seconds(2));
}
}
dataProcessingThread.join();

View File

@ -905,8 +905,13 @@ void Module::startReceiver() {
}
void Module::stopReceiver() {
auto rxStatusPrior = getReceiverStatus();
sendToReceiver(F_STOP_RECEIVER, static_cast<int>(shm()->stoppedFlag),
nullptr);
if (rxStatusPrior == IDLE && getReceiverStreaming()) {
restreamStopFromReceiver();
}
}
void Module::startAcquisition() {
@ -920,26 +925,8 @@ void Module::startReadout() {
}
void Module::stopAcquisition() {
// get det status before stopping acq
runStatus detStatus = ERROR;
try {
detStatus = getRunStatus();
} catch (...) {
}
sendToDetectorStop(F_STOP_ACQUISITION);
shm()->stoppedFlag = true;
// restream dummy header, if rxr streaming and det idle before stop
try {
if (shm()->useReceiverFlag && getReceiverStreaming()) {
if (detStatus == IDLE && getReceiverStatus() == IDLE) {
restreamStopFromReceiver();
}
}
} catch (...) {
}
}
void Module::restreamStopFromReceiver() {