From 753387c34c4f38e83c2552dcf4b2dca9f365e41f Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 4 Feb 2022 13:29:42 +0100 Subject: [PATCH] gotthard type can only have max 2 modules --- slsDetectorSoftware/src/DetectorImpl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 15454ab23..c28fe4c0c 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -281,6 +281,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(type, detectorIndex, pos, false));