Merge pull request #390 from slsdetectorgroup/startmodular

startdetector
This commit is contained in:
Dhanya Thattil 2022-02-21 15:14:01 +01:00 committed by GitHub
commit bf1df92303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 18 deletions

View File

@ -1,7 +1,7 @@
SLS Detector Package Minor Release 6.1.0 released on 25.11.2021 SLS Detector Package Minor Release 7.0.0 released on 25.11.2021
=============================================================== ===============================================================
This document describes the differences between v6.1.0 and v6.0.0. This document describes the differences between v7.0.0 and v6.x.x
@ -39,7 +39,7 @@ This document describes the differences between v6.1.0 and v6.0.0.
- current frame index points to listened frame index (not processed index) - current frame index points to listened frame index (not processed index)
- when in discard partial frames or empty mode, the frame number doesnt increase by 1, it increases to that number (so its faster) - when in discard partial frames or empty mode, the frame number doesnt increase by 1, it increases to that number (so its faster)
- file write disabled by default - file write disabled by default
- start non blocking acquisition at modular level
2. Resolved Issues 2. Resolved Issues

View File

@ -470,7 +470,9 @@ void init_det(py::module &m) {
(void (Detector::*)()) & Detector::clearAcquiringFlag) (void (Detector::*)()) & Detector::clearAcquiringFlag)
.def("startReceiver", (void (Detector::*)()) & Detector::startReceiver) .def("startReceiver", (void (Detector::*)()) & Detector::startReceiver)
.def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver) .def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver)
.def("startDetector", (void (Detector::*)()) & Detector::startDetector) .def("startDetector",
(void (Detector::*)(sls::Positions)) & Detector::startDetector,
py::arg() = Positions{})
.def("startDetectorReadout", .def("startDetectorReadout",
(void (Detector::*)()) & Detector::startDetectorReadout) (void (Detector::*)()) & Detector::startDetectorReadout)
.def("stopDetector", .def("stopDetector",

View File

@ -567,7 +567,7 @@ class Detector {
/** Non blocking: start detector acquisition. Status changes to RUNNING or /** Non blocking: start detector acquisition. Status changes to RUNNING or
* WAITING and automatically returns to idle at the end of acquisition. * WAITING and automatically returns to idle at the end of acquisition.
[Mythen3] Master starts acquisition first */ [Mythen3] Master starts acquisition first */
void startDetector(); void startDetector(Positions pos = {});
/** [Mythen3] Non blocking: start detector readout of counters in chip. /** [Mythen3] Non blocking: start detector readout of counters in chip.
* Status changes to TRANSMITTING and automatically returns to idle at the * Status changes to TRANSMITTING and automatically returns to idle at the

View File

@ -1516,7 +1516,7 @@ class CmdProxy {
"\n\tStops receiver listener for detector data packets and closes " "\n\tStops receiver listener for detector data packets and closes "
"current data file (if file write enabled)."); "current data file (if file write enabled).");
EXECUTE_SET_COMMAND_NOID( EXECUTE_SET_COMMAND(
start, startDetector, start, startDetector,
"\n\tStarts detector acquisition. Status changes to RUNNING or WAITING " "\n\tStarts detector acquisition. Status changes to RUNNING or WAITING "
"and automatically returns to idle at the end of acquisition. If the " "and automatically returns to idle at the end of acquisition. If the "

View File

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