M3: master starts twice (non blocking) (#444)

* start acq for master m3 was sent twice (non blocking), removed redundant code, check that there is only one master

* m3 can have more than 1 master (when many master modules used independently)

* fix for singe mod m3 or other dets
This commit is contained in:
Dhanya Thattil
2022-05-10 14:27:40 +02:00
committed by GitHub
parent 36a1159f38
commit f55bdd6eae
3 changed files with 34 additions and 37 deletions

View File

@ -781,24 +781,7 @@ void Detector::startReceiver() { pimpl->Parallel(&Module::startReceiver, {}); }
void Detector::stopReceiver() { pimpl->Parallel(&Module::stopReceiver, {}); }
void Detector::startDetector(Positions pos) {
auto detector_type = getDetectorType(pos).squash();
if (detector_type == defs::MYTHEN3 && size() > 1) {
std::vector<int> slaves(pos);
auto is_master = getMaster(pos);
int masterPosition = -1;
for (unsigned int i = 0; i < is_master.size(); ++i) {
if (is_master[i]) {
masterPosition = i;
slaves.erase(slaves.begin() + i);
}
}
pimpl->Parallel(&Module::startAcquisition, pos);
if (masterPosition != -1) {
pimpl->Parallel(&Module::startAcquisition, {masterPosition});
}
} else {
pimpl->Parallel(&Module::startAcquisition, pos);
}
pimpl->startAcquisition(false, pos);
}
void Detector::startDetectorReadout() {