Dev/multi id ignored in config (#1115)

* 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.
This commit is contained in:
maliakal_d 2025-02-27 10:41:17 +01:00 committed by GitHub
parent ce8911de10
commit 964ab19b42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,6 +99,12 @@ void Detector::loadParameters(const std::vector<std::string> &parameters) {
CmdParser parser; CmdParser parser;
for (const auto &current_line : parameters) { for (const auto &current_line : parameters) {
parser.Parse(current_line); 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(), caller.call(parser.command(), parser.arguments(), parser.detector_id(),
defs::PUT_ACTION, std::cout, parser.receiver_id()); defs::PUT_ACTION, std::cout, parser.receiver_id());
} }