mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
wip, setmaster
This commit is contained in:
@ -196,7 +196,7 @@ class Detector {
|
||||
/** [Eiger][Mythen3][Gotthard1] via stop server **/
|
||||
Result<bool> getMaster(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] Set master */
|
||||
/** [Eiger] Set half module to master and the others to slaves */
|
||||
void setMaster(bool value, int pos);
|
||||
|
||||
Result<bool> isVirtualDetectorServer(Positions pos = {}) const;
|
||||
|
@ -1282,6 +1282,12 @@ class CmdProxy {
|
||||
"interfaces must be set to 2. slsReceiver and slsDetectorGui "
|
||||
"does not handle.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID_GET(
|
||||
master, getMaster, setMaster, StringTo<int>,
|
||||
"[0, 1]\n\t[Eiger] Sets half module to master and "
|
||||
"others to slaves.\n\t\t [Gotthard][Mythen3][Eiger] "
|
||||
"Gets if the current module/ half module is master.");
|
||||
|
||||
/* acquisition parameters */
|
||||
|
||||
INTEGER_COMMAND_SET_NOID_GET_ID(
|
||||
|
@ -303,10 +303,16 @@ Result<bool> Detector::getMaster(Positions pos) const {
|
||||
}
|
||||
|
||||
void Detector::setMaster(bool master, int pos) {
|
||||
if (pos == -1)) {
|
||||
if (pos == -1 && size() > 1) {
|
||||
throw RuntimeError("Master can be set only to a single module");
|
||||
}
|
||||
pimpl->Parallel(&Module::setMaster, {pos}, value);
|
||||
// multi mod, set slaves first
|
||||
if (master && size() > 1) {
|
||||
pimpl->Parallel(&Module::setMaster, {}, false);
|
||||
pimpl->Parallel(&Module::setMaster, {pos}, master);
|
||||
} else {
|
||||
pimpl->Parallel(&Module::setMaster, {pos}, master);
|
||||
}
|
||||
}
|
||||
|
||||
Result<bool> Detector::isVirtualDetectorServer(Positions pos) const {
|
||||
|
Reference in New Issue
Block a user