diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 01210f044..1c2b92da9 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -9,6 +9,7 @@ class multiSlsDetector; namespace sls { using ns = std::chrono::nanoseconds; class MacAddr; +class IpAddr; /** * \class Detector @@ -1274,7 +1275,6 @@ class Detector { void selectUDPInterface(int interface, Positions pos = {}); Result getNumberofUDPInterfaces(Positions pos = {}) const; - void setNumberofUDPInterfaces(int n, Positions pos = {}); /** [Eiger][Jungfrau] */ @@ -1292,8 +1292,48 @@ class Detector { /** [Jungfrau] */ Result getReceiverUDPMAC2(Positions pos = {}) const; - /** [Jungfrau] */ + /** [Jungfrau] */ void setReceiverUDPMAC2(const std::string &udpmac, Positions pos = {}); + + Result getReceiverUDPMAC(Positions pos = {}) const; + void setReceiverUDPMAC(const std::string &udpmac, Positions pos = {}); + + /** [Jungfrau] */ + Result getReceiverUDPIP2(Positions pos = {}) const; + + /** [Jungfrau] */ + void setReceiverUDPIP2(const std::string &udpip, Positions pos = {}); + + Result getReceiverUDPIP(Positions pos = {}) const; + void setReceiverUDPIP(const std::string &udpip, Positions pos = {}); + + Result getReceiverHostname(Positions pos = {}) const; + + /** + * Validates and sets the receiver. + * Also updates the receiver with all the shared memory parameters + * significant for the receiver Also configures the detector to the receiver + * as UDP destination + * @param receiver receiver hostname or IP address */ + void setReceiverHostname(const std::string &receiver, Positions pos = {}); + + /** [Jungfrau] */ + Result getDetectorIP2(Positions pos = {}) const; + + /** [Jungfrau] */ + void setDetectorIP2(const std::string &detectorIP, Positions pos = {}); + + Result getDetectorIP(Positions pos = {}) const; + void setDetectorIP(const std::string &detectorIP, Positions pos = {}); + + Result getDetectorMAC(Positions pos = {}) const; + void setDetectorMAC(const std::string &detectorMAC, Positions pos = {}); + + /** [Jungfrau] */ + Result getDetectorMAC2(Positions pos = {}) const; + + /** [Jungfrau] */ + void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {}); }; } // namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h index 73195e606..14cd4b1f8 100755 --- a/slsDetectorSoftware/include/multiSlsDetector.h +++ b/slsDetectorSoftware/include/multiSlsDetector.h @@ -976,14 +976,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns the detector MAC address */ - std::string setDetectorMAC(const std::string &detectorMAC, int detPos = -1); + std::string setDetectorMAC(const std::string &detectorMAC, int detPos = -1); // /** * Returns the detector MAC address * @param detPos -1 for all detectors in list or specific detector position * @returns the detector MAC address */ - std::string getDetectorMAC(int detPos = -1); + std::string getDetectorMAC(int detPos = -1); // /** * Validates the format of the detector MAC address (bottom half) and sets @@ -993,14 +993,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @returns the detector MAC address (bottom half) */ std::string setDetectorMAC2(const std::string &detectorMAC, - int detPos = -1); + int detPos = -1); // /** * Returns the detector MAC address (bottom half) Jungfrau only * @param detPos -1 for all detectors in list or specific detector position * @returns the detector MAC address (bottom half) */ - std::string getDetectorMAC2(int detPos = -1); + std::string getDetectorMAC2(int detPos = -1); // /** * Validates the format of the detector IP address and sets it @@ -1008,14 +1008,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns the detector IP address */ - std::string setDetectorIP(const std::string &detectorIP, int detPos = -1); + std::string setDetectorIP(const std::string &detectorIP, int detPos = -1); // /** * Returns the detector IP address * @param detPos -1 for all detectors in list or specific detector position * @returns the detector IP address */ - std::string getDetectorIP(int detPos = -1) const; + std::string getDetectorIP(int detPos = -1) const; // /** * Validates the format of the detector IP address (bottom half) and sets it @@ -1024,14 +1024,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns the detector IP address (bottom half) */ - std::string setDetectorIP2(const std::string &detectorIP, int detPos = -1); + std::string setDetectorIP2(const std::string &detectorIP, int detPos = -1); // /** * Returns the detector IP address (bottom half) Jungfrau only * @param detPos -1 for all detectors in list or specific detector position * @returns the detector IP address (bottom half) */ - std::string getDetectorIP2(int detPos = -1) const; + std::string getDetectorIP2(int detPos = -1) const; // /** * Validates and sets the receiver. @@ -1043,14 +1043,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @returns the receiver IP address from shared memory */ std::string setReceiverHostname(const std::string &receiver, - int detPos = -1); + int detPos = -1); // /** * Returns the receiver IP address * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver IP address */ - std::string getReceiverHostname(int detPos = -1) const; + std::string getReceiverHostname(int detPos = -1) const; // /** * Validates the format of the receiver UDP IP address and sets it @@ -1058,14 +1058,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver UDP IP address */ - std::string setReceiverUDPIP(const std::string &udpip, int detPos = -1); + std::string setReceiverUDPIP(const std::string &udpip, int detPos = -1); // /** * Returns the receiver UDP IP address * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver UDP IP address */ - std::string getReceiverUDPIP(int detPos = -1) const; + std::string getReceiverUDPIP(int detPos = -1) const; // /** * Validates the format of the receiver UDP IP address (bottom half) and @@ -1074,14 +1074,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver UDP IP address (bottom half) */ - std::string setReceiverUDPIP2(const std::string &udpip, int detPos = -1); + std::string setReceiverUDPIP2(const std::string &udpip, int detPos = -1); // /** * Returns the receiver UDP IP address (bottom half) Jungfrau only * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver UDP IP address (bottom half) */ - std::string getReceiverUDPIP2(int detPos = -1) const; + std::string getReceiverUDPIP2(int detPos = -1) const; // /** * Validates the format of the receiver UDP MAC address and sets it @@ -1089,14 +1089,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver UDP MAC address */ - std::string setReceiverUDPMAC(const std::string &udpmac, int detPos = -1); + std::string setReceiverUDPMAC(const std::string &udpmac, int detPos = -1);// /** * Returns the receiver UDP MAC address * @param detPos -1 for all detectors in list or specific detector position * @returns the receiver UDP MAC address */ - std::string getReceiverUDPMAC(int detPos = -1) const; + std::string getReceiverUDPMAC(int detPos = -1) const; // /** * Validates the format of the receiver UDP MAC address (bottom half) and diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index b8de96c73..ceea070c4 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1097,27 +1097,90 @@ void Detector::setNumberofUDPInterfaces(int n, Positions pos) { enableDataStreamingFromReceiver(true, pos); } -Result Detector::getReceiverUDPPort2(Positions pos) const{ - pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos); +Result Detector::getReceiverUDPPort2(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos); } -void Detector::setReceiverUDPPort2(int udpport, Positions pos){ +void Detector::setReceiverUDPPort2(int udpport, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverUDPPort2, pos, udpport); } -Result Detector::getReceiverUDPPort(Positions pos) const{ - pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos); +Result Detector::getReceiverUDPPort(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverUDPPort, pos); } -void Detector::setReceiverUDPPort(int udpport, Positions pos){ - pimpl->Parallel(&slsDetector::setReceiverUDPPort2, pos, udpport); +void Detector::setReceiverUDPPort(int udpport, Positions pos) { + pimpl->Parallel(&slsDetector::setReceiverUDPPort, pos, udpport); } -Result Detector::getReceiverUDPMAC2(Positions pos) const{ +Result Detector::getReceiverUDPMAC2(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverUDPMAC2, pos); } -void Detector::setReceiverUDPMAC2(const std::string &udpmac, Positions pos){ +void Detector::setReceiverUDPMAC2(const std::string &udpmac, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverUDPMAC2, pos, udpmac); } + +Result Detector::getReceiverUDPMAC(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverUDPMAC, pos); +} + +void Detector::setReceiverUDPMAC(const std::string &udpmac, Positions pos) { + pimpl->Parallel(&slsDetector::setReceiverUDPMAC, pos, udpmac); +} + +Result Detector::getReceiverUDPIP2(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverUDPIP2, pos); +} + +void Detector::setReceiverUDPIP2(const std::string &udpip, Positions pos) { + pimpl->Parallel(&slsDetector::setReceiverUDPIP2, pos, udpip); +} + +Result Detector::getReceiverUDPIP(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverUDPIP, pos); +} + +void Detector::setReceiverUDPIP(const std::string &udpip, Positions pos) { + pimpl->Parallel(&slsDetector::setReceiverUDPIP, pos, udpip); +} + +Result Detector::getReceiverHostname(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverHostname, pos); +} + +void Detector::setReceiverHostname(const std::string &receiver, Positions pos) { + pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver); +} + +Result Detector::getDetectorIP2(Positions pos) const{ + return pimpl->Parallel(&slsDetector::getDetectorIP2, pos); +} + +void Detector::setDetectorIP2(const std::string &detectorIP, Positions pos){ + pimpl->Parallel(&slsDetector::setDetectorIP2, pos, detectorIP); +} + +Result Detector::getDetectorIP(Positions pos) const{ + return pimpl->Parallel(&slsDetector::getDetectorIP, pos); +} + +void Detector::setDetectorIP(const std::string &detectorIP, Positions pos){ + pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP); +} + +Result Detector::getDetectorMAC(Positions pos) const{ + return pimpl->Parallel(&slsDetector::getDetectorMAC, pos); +} +void Detector::setDetectorMAC(const std::string &detectorMAC, Positions pos){ + pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC); +} + +Result Detector::getDetectorMAC2(Positions pos) const{ + return pimpl->Parallel(&slsDetector::getDetectorMAC2, pos); +} +void Detector::setDetectorMAC2(const std::string &detectorMAC, Positions pos){ + pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC); +} + } // namespace sls \ No newline at end of file