mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-09 23:50:51 +02:00
first draft of disabling data port at the receiver side. Todo: master file and stream for gui to use
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user