mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
Dev: : gui acq finished callback for different status (#850)
* 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:
parent
9b5d44f0b3
commit
ebb352b13a
@ -1220,10 +1220,26 @@ int DetectorImpl::acquire() {
|
|||||||
dataProcessingThread.join();
|
dataProcessingThread.join();
|
||||||
|
|
||||||
if (acquisition_finished != nullptr) {
|
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, {});
|
auto a = Parallel(&Module::getReceiverProgress, {});
|
||||||
double progress = (*std::max_element(a.begin(), a.end()));
|
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);
|
clock_gettime(CLOCK_REALTIME, &end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user