From c8290598db3b1e2d71ebeb4c3f8ce3fded383e16 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 27 Feb 2025 10:41:31 +0100 Subject: [PATCH] 910: multi ids ignored silently in config file (#1114) * warn that the multi id is ignored in config file? or throw? * throw and not just warn with printouts as that could be silent as well * throw for any multi id command in the file. --- slsDetectorSoftware/src/Detector.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index b2d24bf1e..171678b0e 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -99,6 +99,12 @@ void Detector::loadParameters(const std::vector ¶meters) { CmdParser parser; for (const auto ¤t_line : parameters) { parser.Parse(current_line); + if (parser.multi_id() != 0) { + throw RuntimeError( + "Multi-detector indices [" + std::to_string(parser.multi_id()) + + "] are not allowed in the file. Instead, use the index for " + "'config' or 'parameters' command?"); + } caller.call(parser.command(), parser.arguments(), parser.detector_id(), defs::PUT_ACTION, std::cout, parser.receiver_id()); }