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 {

View File

@ -513,6 +513,7 @@ bool Module::isMaster() const { return sendToDetectorStop<int>(F_GET_MASTER); }
void Module::setMaster(const bool master) {
sendToDetector(F_SET_MASTER, static_cast<int>(master), nullptr);
sendToDetectorStop(F_SET_MASTER, static_cast<int>(master), nullptr);
}
bool Module::isVirtualDetectorServer() const {
@ -1680,12 +1681,11 @@ void Module::setDataStream(const portPosition port, const bool enable) {
}
bool Module::getTop() const {
return (
!static_cast<bool>(sendToDetector<int>(F_GET_TOP)));
return (static_cast<bool>(sendToDetector<int>(F_GET_TOP)));
}
void Module::setTop(bool value) {
sendToDetector<int>(F_SET_TOP, static_cast<int>(value));
sendToDetector(F_SET_TOP, static_cast<int>(value), nullptr);
}
// Jungfrau Specific