first draft of disabling data port at the receiver side. Todo: master file and stream for gui to use

This commit is contained in:
2026-05-07 17:15:50 +02:00
parent 111d10cfa7
commit 4ef8a625ab
39 changed files with 557 additions and 448 deletions
+27 -12
View File
@@ -1407,6 +1407,33 @@ void Module::setTransmissionDelayRight(int value) {
sendToDetector(F_SET_TRANSMISSION_DELAY_RIGHT, value, nullptr);
}
bool Module::getDataStream(const portPosition port) const {
// receiver only
if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH) {
if (!shm()->useReceiverFlag) {
throw RuntimeError("No receiver to get datastream.");
}
return sendToReceiver<int>(F_RECEIVER_GET_UDP_DATASTREAM,
static_cast<int>(port));
} else
return sendToDetector<int>(F_GET_DATASTREAM, static_cast<int>(port));
}
void Module::setDataStream(const portPosition port, const bool enable) {
int args[]{static_cast<int>(port), static_cast<int>(enable)};
if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH) {
if (!shm()->useReceiverFlag) {
throw RuntimeError("No receiver to set datastream.");
}
sendToReceiver(F_RECEIVER_SET_UDP_DATASTREAM, args, nullptr);
} else {
sendToDetector(F_SET_DATASTREAM, args, nullptr);
if (shm()->useReceiverFlag) {
sendToReceiver(F_RECEIVER_SET_UDP_DATASTREAM, args, nullptr);
}
}
}
// Receiver Config
bool Module::getUseReceiverFlag() const { return shm()->useReceiverFlag; }
@@ -1948,18 +1975,6 @@ void Module::setQuad(const bool enable) {
}
}
bool Module::getDataStream(const portPosition port) const {
return sendToDetector<int>(F_GET_DATASTREAM, static_cast<int>(port));
}
void Module::setDataStream(const portPosition port, const bool enable) {
int args[]{static_cast<int>(port), static_cast<int>(enable)};
sendToDetector(F_SET_DATASTREAM, args, nullptr);
if (shm()->useReceiverFlag) {
sendToReceiver(F_RECEIVER_SET_DATASTREAM, args, nullptr);
}
}
bool Module::getTop() const {
return (static_cast<bool>(sendToDetector<int>(F_GET_TOP)));
}