From 6b149244d31ab6fadcb2035aab8f2ed11a7b8e5b Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 18 Feb 2025 11:11:33 +0100 Subject: [PATCH] added documentation of order in hostname command in quick start guide, udp header format for row and column values and in command line hostname (#1099) --- docs/src/quick_start_guide.rst | 4 ++++ docs/src/udpheader.rst | 4 ++-- python/slsdet/detector.py | 4 ++++ slsDetectorSoftware/include/sls/Detector.h | 7 ++++++- slsDetectorSoftware/src/CallerSpecial.cpp | 7 ++++++- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/src/quick_start_guide.rst b/docs/src/quick_start_guide.rst index 9ccd28506..3e4efc943 100644 --- a/docs/src/quick_start_guide.rst +++ b/docs/src/quick_start_guide.rst @@ -128,6 +128,10 @@ For Multiple Modules # set file path fpath /tmp +.. note :: + The **hostname** and **detsize** command in a multi module system can affect the row and column values in the udp/zmq header. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. + + Gui ---- diff --git a/docs/src/udpheader.rst b/docs/src/udpheader.rst index 56e59a387..f49ae1d02 100644 --- a/docs/src/udpheader.rst +++ b/docs/src/udpheader.rst @@ -73,9 +73,9 @@ Description * **modId**: module ID picked up from det_id_[detector type].txt on the detector cpu. -* **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. +* **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. -* **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. +* **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. * **detType**: detector type from enum of detectorType in the package. diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 6b0b86f68..b3e107835 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -151,6 +151,10 @@ class Detector(CppDetectorApi): def hostname(self): """Frees shared memory and sets hostname (or IP address) of all modules concatenated by + Virtual servers can already use the port in hostname separated by ':' and ports incremented by 2 to accomodate the stop server as well. + + Note + ----- + The row and column values in the udp/zmq header are affected by the order in this command and the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. This only affects row and column in udp/zmq header. Example ------- diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index eed90955b..b51345f30 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -65,7 +65,12 @@ class Detector { Result getHostname(Positions pos = {}) const; - /**Frees shared memory, adds detectors to the list. */ + /**Frees shared memory, adds detectors to the list. The row and column + * values in the udp/zmq header are affected by the order in this command + * and the setDetectorSize function. The modules are stacked row by row + * until they reach the y-axis limit set by detsize (if specified). Then, + * stacking continues in the next column and so on. This only affects row + * and column in udp/zmq header.*/ void setHostname(const std::vector &hostname); /** connects to n servers at local host starting at specific control port. diff --git a/slsDetectorSoftware/src/CallerSpecial.cpp b/slsDetectorSoftware/src/CallerSpecial.cpp index 12e02b0ff..078c383f3 100644 --- a/slsDetectorSoftware/src/CallerSpecial.cpp +++ b/slsDetectorSoftware/src/CallerSpecial.cpp @@ -198,7 +198,12 @@ std::string Caller::hostname(int action) { os << "\n\tFrees shared memory and sets hostname (or IP address) of " "all modules concatenated by +.\n\t Virtual servers can already " "use the port in hostname separated by ':' and ports incremented " - "by 2 to accomodate the stop server as well." + "by 2 to accomodate the stop server as well. The row and column " + "values in the udp/zmq header are affected by the order in this " + "command and the detsize command. The modules are stacked row by " + "row until they reach the y-axis limit set by detsize (if " + "specified). Then, stacking continues in the next column and so " + "on. This only affects row and column in udp/zmq header." << '\n'; } else if (action == defs::GET_ACTION) { if (!args.empty()) {