fixes for set top, masterin api

This commit is contained in:
2022-03-16 12:49:22 +01:00
parent de9e83fd61
commit 7a39822813
6 changed files with 34 additions and 25 deletions

View File

@ -303,11 +303,11 @@ Result<bool> Detector::getMaster(Positions pos) const {
}
void Detector::setMaster(bool master, int pos) {
if (pos == -1 && size() > 1) {
throw RuntimeError("Master can be set only to a single module");
}
// multi mod, set slaves first
if (master && size() > 1) {
if (pos == -1) {
throw RuntimeError("Master can be set only to a single module");
}
pimpl->Parallel(&Module::setMaster, {}, false);
pimpl->Parallel(&Module::setMaster, {pos}, master);
} else {