mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
startdetector (non blocking) is allowed at modular level
This commit is contained in:
@ -1516,7 +1516,7 @@ class CmdProxy {
|
||||
"\n\tStops receiver listener for detector data packets and closes "
|
||||
"current data file (if file write enabled).");
|
||||
|
||||
EXECUTE_SET_COMMAND_NOID(
|
||||
EXECUTE_SET_COMMAND(
|
||||
start, startDetector,
|
||||
"\n\tStarts detector acquisition. Status changes to RUNNING or WAITING "
|
||||
"and automatically returns to idle at the end of acquisition. If the "
|
||||
|
@ -756,22 +756,24 @@ void Detector::startReceiver() { pimpl->Parallel(&Module::startReceiver, {}); }
|
||||
|
||||
void Detector::stopReceiver() { pimpl->Parallel(&Module::stopReceiver, {}); }
|
||||
|
||||
void Detector::startDetector() {
|
||||
auto detector_type = getDetectorType().squash();
|
||||
void Detector::startDetector(Positions pos) {
|
||||
auto detector_type = getDetectorType(pos).squash();
|
||||
if (detector_type == defs::MYTHEN3 && size() > 1) {
|
||||
auto is_master = getMaster();
|
||||
int masterPosition = 0;
|
||||
std::vector<int> slaves;
|
||||
for (int i = 0; i < size(); ++i) {
|
||||
if (is_master[i])
|
||||
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;
|
||||
else
|
||||
slaves.push_back(i);
|
||||
slaves.erase(pos.begin() + i);
|
||||
}
|
||||
}
|
||||
pimpl->Parallel(&Module::startAcquisition, pos);
|
||||
if (masterPosition != -1) {
|
||||
pimpl->Parallel(&Module::startAcquisition, {masterPosition});
|
||||
}
|
||||
pimpl->Parallel(&Module::startAcquisition, slaves);
|
||||
pimpl->Parallel(&Module::startAcquisition, {masterPosition});
|
||||
} else {
|
||||
pimpl->Parallel(&Module::startAcquisition, {});
|
||||
pimpl->Parallel(&Module::startAcquisition, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user