From 01921bc01632eb0c7182596b823e9954155331c8 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 11 Sep 2020 16:05:53 +0200 Subject: [PATCH] WIp, doc --- python/slsdet/detector.py | 48 ++++++++++++++++++++++++++ slsDetectorSoftware/include/Detector.h | 18 ++++++---- slsDetectorSoftware/src/CmdProxy.cpp | 8 ++--- slsDetectorSoftware/src/CmdProxy.h | 10 ++++-- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 25ee7bece..732f7e7ef 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -809,6 +809,17 @@ class Detector(CppDetectorApi): @property def udp_dstip(self): + """ + Ip address of the receiver (destination) udp interface. + Note + ---- + If 'auto' used, then ip is set to ip of rx_hostname. + Example + ------ + >>> d.udp_dstip = '192.168.1.110' + >>> d.udp_dstip + 192.168.1.110 + """ return element_if_equal(self.getDestinationUDPIP()) @udp_dstip.setter @@ -819,6 +830,19 @@ class Detector(CppDetectorApi): @property def udp_dstip2(self): + """ + [Jungfrau][Gotthard2] Ip address of the receiver (destination) udp interface 2. + Note + ---- + [Jungfrau] bottom half \n + [Gotthard2] veto debugging \n + If 'auto' used, then ip is set to ip of rx_hostname. + Example + ------ + >>> d.udp_dstip2 = '10.1.1.185' + >>> d.udp_dstip2 + 10.1.1.185 + """ return element_if_equal(self.getDestinationUDPIP2()) @udp_dstip2.setter @@ -829,6 +853,17 @@ class Detector(CppDetectorApi): @property def udp_dstmac(self): + """ + Mac address of the receiver (destination) udp interface. + Note + ---- + Not mandatory to set as udp_dstip retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). + Example + ------- + >>> d.udp_dstmac = '00:1b:31:01:8a:de' + d.udp_dstmac + 00:1b:31:01:8a:de + """ return element_if_equal(self.getDestinationUDPMAC()) @udp_dstmac.setter @@ -837,6 +872,19 @@ class Detector(CppDetectorApi): @property def udp_dstmac2(self): + """ + [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp interface 2. + Note + ---- + Not mandatory to set as udp_dstip2 retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). + [Jungfrau] bottom half \n + [Gotthard2] veto debugging \n + Example + ------ + >>> d.udp_dstmac2 = '00:1b:31:01:8a:de' + d.udp_dstmac2 + 00:1b:31:01:8a:de + """ return element_if_equal(self.getDestinationUDPMAC2()) @udp_dstmac2.setter diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 560e4d31e..470b160ee 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -551,24 +551,28 @@ class Detector { /** IP of the interface in receiver that the detector sends data to */ void setDestinationUDPIP(const IpAddr ip, Positions pos = {}); - /** [Jungfrau bottom half] */ + /** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ Result getDestinationUDPIP2(Positions pos = {}) const; - /** [Jungfrau bottom half] */ + /** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ void setDestinationUDPIP2(const IpAddr ip, Positions pos = {}); Result getDestinationUDPMAC(Positions pos = {}) const; - /** MAC of the interface in receiver that the detector sends data to - * Only needed if you use a custom receiver (not slsReceiver) - * Must be followed by configuremac. + /** Mac address of the receiver (destination) udp interface. Not mandatory + * to set as setDestinationUDPIP (udp_dstip) retrieves it from slsReceiver + * process but must be set if you use a custom receiver (not slsReceiver). */ void setDestinationUDPMAC(const MacAddr mac, Positions pos = {}); - /** [Jungfrau bottom half] */ + /** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ Result getDestinationUDPMAC2(Positions pos = {}) const; - /** [Jungfrau bottom half] */ + /* [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp + interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from + slsReceiver process but must be set if you use a custom receiver (not + slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging \n + */ void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {}); Result getDestinationUDPPort(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 6a291e577..413a5faf8 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1112,10 +1112,10 @@ std::string CmdProxy::UDPDestinationIP2(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[x.x.x.x] or auto\n\t[Jungfrau] Ip address of the receiver " - "(destination) udp interface where the second half of detector " - "data is sent to. If 'auto' used, then ip is set to ip of " - "rx_hostname." + os << "[x.x.x.x] or auto\n\t[Jungfrau][Gotthard2] Ip address of the " + "receiver (destination) udp interface 2. If 'auto' used, then ip " + "is set to ip of rx_hostname.\n\t[Jungfrau] bottom half " + "\n\t[Gotthard2] veto debugging. " << '\n'; } else if (action == defs::GET_ACTION) { auto t = det->getDestinationUDPIP2({det_id}); diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 189a3320f..7ea2e0ac5 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1687,13 +1687,17 @@ class CmdProxy { INTEGER_COMMAND( udp_dstmac, getDestinationUDPMAC, setDestinationUDPMAC, MacAddr, "[x:x:x:x:x:x]\n\tMac address of the receiver (destination) udp " - "interface. Can be unused as udp_dstip retrieves it."); + "interface. Not mandatory to set as udp_dstip retrieves it from " + "slsReceiver process, but must be set if you use a custom receiver " + "(not slsReceiver)."); INTEGER_COMMAND( udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr, "[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) " - "udp interface where the second half of detector data is sent to. Can " - "be unused as udp_dstip2 retrieves it."); + "udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from " + "slsReceiver process but must be set if you use a custom receiver (not " + "slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging " + "\n"); INTEGER_COMMAND(udp_dstport, getDestinationUDPPort, setDestinationUDPPort, StringTo,