gotthard type can only have max 2 modules

This commit is contained in:
maliakal_d 2022-02-04 13:29:42 +01:00
parent 83e0599a37
commit 753387c34c

View File

@ -281,6 +281,13 @@ void DetectorImpl::addModule(const std::string &hostname) {
// get type by connecting // get type by connecting
detectorType type = Module::getTypeFromDetector(host, port); 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(); auto pos = modules.size();
modules.emplace_back( modules.emplace_back(
sls::make_unique<Module>(type, detectorIndex, pos, false)); sls::make_unique<Module>(type, detectorIndex, pos, false));