mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-09 23:50:51 +02:00
fixed disabled ports meta data as well
This commit is contained in:
@@ -1441,8 +1441,8 @@ void Module::updateRxUDPPortDisableMetadata(const std::vector<int> &disable) {
|
||||
LOG(logDEBUG) << "Updating UDP port disable metadata in Receiver 0";
|
||||
auto client = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
|
||||
|
||||
client.Send(F_RECEIVER_UDP_PORT_DISABLE_META);
|
||||
client.setFnum(F_RECEIVER_UDP_PORT_DISABLE_META);
|
||||
client.Send(F_RECEIVER_SET_UDP_PORT_DISABLE_META);
|
||||
client.setFnum(F_RECEIVER_SET_UDP_PORT_DISABLE_META);
|
||||
|
||||
auto nports = static_cast<int>(disable.size());
|
||||
client.Send(nports);
|
||||
@@ -1455,6 +1455,29 @@ void Module::updateRxUDPPortDisableMetadata(const std::vector<int> &disable) {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<int> Module::getRxUDPPortDisableMetadata() const {
|
||||
if (!shm()->useReceiverFlag) {
|
||||
throw RuntimeError("No receiver to get disabled udp port indices.");
|
||||
}
|
||||
|
||||
LOG(logDEBUG) << "Getting UDP port disable metadata in Receiver 0";
|
||||
auto client = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
|
||||
|
||||
client.Send(F_RECEIVER_GET_UDP_PORT_DISABLE_META);
|
||||
client.setFnum(F_RECEIVER_GET_UDP_PORT_DISABLE_META);
|
||||
if (client.Receive<int>() == FAIL) {
|
||||
throw ReceiverError("Receiver " + std::to_string(moduleIndex) +
|
||||
" returned error: " + client.readErrorMessage());
|
||||
}
|
||||
auto nports = client.Receive<int>();
|
||||
std::vector<int> retval(nports);
|
||||
client.Send(nports);
|
||||
if (nports > 0) {
|
||||
client.Receive(retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
// Receiver Config
|
||||
|
||||
bool Module::getUseReceiverFlag() const { return shm()->useReceiverFlag; }
|
||||
|
||||
Reference in New Issue
Block a user