diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 0887ecc0a..19355ba50 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1234,10 +1234,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(status), acqFinished_p); } clock_gettime(CLOCK_REALTIME, &end);