diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 06993bc85..1c582085e 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1739,6 +1739,7 @@ class Detector { private: std::vector getPortNumbers(int start_port); void updateRxRateCorrections(); + void setNumberofUDPInterfaces_(int n, Positions pos); + Result getNumberofUDPInterfaces_(Positions pos) const; }; - } // namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 3d6c2f410..114ac15e3 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -746,10 +746,28 @@ Result Detector::getScanErrorMessage(Positions pos) const { // Network Configuration (Detector<->Receiver) Result Detector::getNumberofUDPInterfaces(Positions pos) const { - return pimpl->Parallel(&Module::getNumberofUDPInterfaces, pos); + if (getDetectorType().squash() != defs::JUNGFRAU) { + throw sls::RuntimeError( + "Cannot set number of udp interfaces for this detector."); + } + // also called by vetostream (for gotthard2) + return getNumberofUDPInterfaces_(pos); } void Detector::setNumberofUDPInterfaces(int n, Positions pos) { + if (getDetectorType().squash() != defs::JUNGFRAU) { + throw sls::RuntimeError( + "Cannot set number of udp interfaces for this detector."); + } + // also called by vetostream (for gotthard2) + setNumberofUDPInterfaces_(n, pos); +} + +Result Detector::getNumberofUDPInterfaces_(Positions pos) const { + return pimpl->Parallel(&Module::getNumberofUDPInterfaces, pos); +} + +void Detector::setNumberofUDPInterfaces_(int n, Positions pos) { bool previouslyClientStreaming = pimpl->getDataStreamingToClient(); bool useReceiver = getUseReceiverFlag().squash(false); bool previouslyReceiverStreaming = false; @@ -1551,7 +1569,7 @@ Result Detector::getVetoStream(Positions pos) const { // 3gbe auto r3 = pimpl->Parallel(&Module::getVetoStream, pos); // 10gbe (debugging interface) opens 2nd udp interface in receiver - auto r10 = getNumberofUDPInterfaces(); + auto r10 = getNumberofUDPInterfaces_(pos); Result res(r3.size()); for (unsigned int i = 0; i < res.size(); ++i) { @@ -1570,11 +1588,11 @@ void Detector::setVetoStream(defs::EthernetInterface interface, Positions pos) { pimpl->Parallel(&Module::setVetoStream, pos, i3gbe); // 10gbe (debugging interface) opens 2nd udp interface in receiver - int old_numinterfaces = getNumberofUDPInterfaces(pos).tsquash( + int old_numinterfaces = getNumberofUDPInterfaces_(pos).tsquash( "retrieved inconsistent number of udp interfaces"); int numinterfaces = (interface & defs::EthernetInterface::I10GBE) ? 2 : 1; if (numinterfaces != old_numinterfaces) { - setNumberofUDPInterfaces(numinterfaces, pos); + setNumberofUDPInterfaces_(numinterfaces, pos); } }