diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 607241c87..4b2ed5153 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -757,17 +757,7 @@ Result Detector::getUseReceiverFlag(Positions pos) const { } Result Detector::getRxHostname(const int udpInterface, Positions pos) const { - // switch (udpInterface) { - // case 1: - // return pimpl->Parallel1(&Receiver::getHostname, pos, {}); - // case 2: - // return pimpl->Parallel2(&Receiver::getHostname, pos, {}); - // default: - // throw RuntimeError("Invalid udp interface number " + - // std::to_string(udpInterface)); - // } - return pimpl->getHostname(pos, udpInterface); - // return experimental::Parallel(&Receiver::getHostname, receivers, MaskGenerator(){receivers}); + return pimpl->getRxHostname(pos, udpInterface); } void Detector::setRxHostname(const int udpInterface, const std::string &hostname, Positions pos) { @@ -783,21 +773,14 @@ void Detector::setRxHostname(const int udpInterface, const std::string &hostname } Result Detector::getRxPort(const int udpInterface, Positions pos) const { - switch (udpInterface) { - case 1: - return pimpl->Parallel1(&Receiver::getTCPPort, pos, {}); - case 2: - return pimpl->Parallel2(&Receiver::getTCPPort, pos, {}); - default: - throw RuntimeError("Invalid udp interface number " + - std::to_string(udpInterface)); - } + return pimpl->getRxPort(pos, udpInterface); } void Detector::setRxPort(const int udpInterface, int port, int module_id) { if (!pimpl->isReceiverInitialized(udpInterface)) { pimpl->initReceiver(udpInterface); } + // return pimpl->setRxPort(); if (udpInterface == 1) { if (module_id == -1) { for (int idet = 0; idet < size(); ++idet) { diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index a66b03ae3..c18804c7e 100755 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -315,9 +315,12 @@ void DetectorImpl::setHostname(const std::vector &name) { updateDetectorSize(); } -Result DetectorImpl::getHostname(Positions pos, int udp_interface){ - LOG(logWARNING) << ToString(pos) << ": " << udp_interface; - return experimental::Parallel(&Receiver::getHostname, receivers, MaskGenerator(pos, udp_interface).mask(receivers)); +Result DetectorImpl::getRxHostname(Positions pos, int udpInterface){ + return experimental::Parallel(&Receiver::getHostname, receivers, MaskGenerator(pos, udpInterface).mask(receivers)); +} + +Result DetectorImpl::getRxPort(Positions pos, int udpInterface){ + return experimental::Parallel(&Receiver::getTCPPort, receivers, MaskGenerator(pos, udpInterface).mask(receivers)); } void DetectorImpl::setHostname(const std::vector &name, diff --git a/slsDetectorSoftware/src/DetectorImpl.h b/slsDetectorSoftware/src/DetectorImpl.h index cfa307853..0a7c01411 100755 --- a/slsDetectorSoftware/src/DetectorImpl.h +++ b/slsDetectorSoftware/src/DetectorImpl.h @@ -304,7 +304,8 @@ class DetectorImpl : public virtual slsDetectorDefs { void setHostname(const std::vector &name, const std::vector &port); - Result getHostname(Positions pos, int udp_interface); + Result getRxHostname(Positions pos, int udpInterface); + Result getRxPort(Positions pos, int udpInterface); int getNumberofReceiversPerModule() const; void initReceiver(const int udpInterface);