8.0.0rc: : gui acq finished callback for different status (#851)

* fix acquisition finished status to have different status for different modules, but does not have to be error. for eg. jf sync fw (2.4.1 gives idle for master and stopped for slaves when stopping acquiistion)
This commit is contained in:
maliakal_d 2023-11-06 16:08:23 +01:00 committed by GitHub
parent 35ed926047
commit 51f9d6f011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1220,10 +1220,26 @@ int DetectorImpl::acquire() {
dataProcessingThread.join();
if (acquisition_finished != nullptr) {
int status = Parallel(&Module::getRunStatus, {}).squash(ERROR);
// status
runStatus status = IDLE;
auto statusList = Parallel(&Module::getRunStatus, {});
status = statusList.squash(ERROR);
// difference, but none error
if (status == ERROR && (!statusList.any(ERROR))) {
// handle jf sync issue (master idle, slaves stopped)
if (statusList.contains_only(IDLE, STOPPED)) {
status = STOPPED;
}
else
status = statusList.squash(RUNNING);
}
// progress
auto a = Parallel(&Module::getReceiverProgress, {});
double progress = (*std::max_element(a.begin(), a.end()));
acquisition_finished(progress, status, acqFinished_p);
// callback
acquisition_finished(progress, static_cast<int>(status), acqFinished_p);
}
clock_gettime(CLOCK_REALTIME, &end);