Merge branch 'developer' into numudp

This commit is contained in:
2022-03-25 10:50:51 +01:00
24 changed files with 299 additions and 304 deletions

View File

@ -272,6 +272,13 @@ void DetectorImpl::addModule(const std::string &hostname) {
// get type by connecting
detectorType type = Module::getTypeFromDetector(host, port);
// gotthard cannot have more than 2 modules (50um=1, 25um=2
if ((type == GOTTHARD || type == GOTTHARD2) && modules.size() > 2) {
freeSharedMemory();
throw sls::RuntimeError("Gotthard cannot have more than 2 modules");
}
auto pos = modules.size();
modules.emplace_back(
sls::make_unique<Module>(type, detectorIndex, pos, false));
@ -1142,7 +1149,7 @@ int DetectorImpl::acquire() {
if (acquisition_finished != nullptr) {
int status = Parallel(&Module::getRunStatus, {}).squash(ERROR);
auto a = Parallel(&Module::getReceiverProgress, {});
double progress = (*std::min_element(a.begin(), a.end()));
double progress = (*std::max_element(a.begin(), a.end()));
acquisition_finished(progress, status, acqFinished_p);
}