From 2a63548f40f4d93b853cb430a28ff3fbe76a8912 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 1 Feb 2022 15:28:32 +0100 Subject: [PATCH] apring thread added to thread ids --- RELEASE.txt | 1 + python/slsdet/detector.py | 13 ++++++++++++- python/src/detector.cpp | 7 +++++++ slsDetectorSoftware/include/sls/Detector.h | 9 +++++---- slsDetectorSoftware/src/CmdProxy.h | 14 ++++++-------- slsReceiverSoftware/src/Implementation.cpp | 3 +++ slsSupportLib/include/sls/sls_detector_defs.h | 2 +- 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/RELEASE.txt b/RELEASE.txt index 371bb4494..e3fa1752c 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -29,6 +29,7 @@ This document describes the differences between v6.1.0 and v6.0.0. - moench and ctb - can set the starting frame number of next acquisition - mythen server kernel check incompatible (cet timezone) - rx_arping +- rx_threadsids max is now 9 (breaking api) 2. Resolved Issues diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 0a16ab8b0..91e81e90c 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -258,7 +258,7 @@ class Detector(CppDetectorApi): @element def rx_threads(self): """ - Get thread ids from the receiver in order of [parent, tcp, listener 0, processor 0, streamer 0, listener 1, processor 1, streamer 1]. + Get thread ids from the receiver in order of [parent, tcp, listener 0, processor 0, streamer 0, listener 1, processor 1, streamer 1, arping]. Note ----- @@ -268,6 +268,17 @@ class Detector(CppDetectorApi): """ return self.getRxThreadIds() + @property + @element + def rx_arping(self): + """Starts a thread in slsReceiver to ping the interface it is listening every minute. Useful in 10G mode. """ + return self.getRxArping() + + @rx_arping.setter + def rx_arping(self, value): + ut.set_using_dict(self.setRxArping, value) + + @property @element def dr(self): diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 7677fbae4..9f1d6937c 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -768,6 +768,13 @@ void init_det(py::module &m) { (Result>(Detector::*)(sls::Positions) const) & Detector::getRxThreadIds, py::arg() = Positions{}) + .def("getRxArping", + (Result(Detector::*)(sls::Positions) const) & + Detector::getRxArping, + py::arg() = Positions{}) + .def("setRxArping", + (void (Detector::*)(bool, sls::Positions)) & Detector::setRxArping, + py::arg(), py::arg() = Positions{}) .def("getFileFormat", (Result(Detector::*)(sls::Positions) const) & Detector::getFileFormat, diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index da0a37cb3..a842dd92f 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -878,15 +878,16 @@ class Detector { Result getRxLastClientIP(Positions pos = {}) const; /** Get thread ids from the receiver in order of [parent, tcp, listener 0, - * processor 0, streamer 0, listener 1, processor 1, streamer 1]. If no - * streamer yet or there is no second interface, it gives 0 in its place. */ + * processor 0, streamer 0, listener 1, processor 1, streamer 1, arping]. If + * no streamer yet or there is no second interface, it gives 0 in its place. + */ Result> getRxThreadIds(Positions pos = {}) const; Result getRxArping(Positions pos = {}) const; - /** Starts a thread in slsReceiver to ping the interface it is listening. - * Useful in 10G mode. */ + /** Starts a thread in slsReceiver to ping the interface it is listening + * every minute. Useful in 10G mode. */ void setRxArping(bool value, Positions pos = {}); ///@} diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 82a745cc8..7674eb53d 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1739,18 +1739,16 @@ class CmdProxy { rx_lastclient, getRxLastClientIP, "\n\tClient IP Address that last communicated with the receiver."); - GET_COMMAND( - rx_threads, getRxThreadIds, - "\n\tGet thread ids from the receiver in order of [parent, tcp, " - "listener 0, " - "processor 0, streamer 0, listener 1, processor 1, streamer 1]. If no " - "streamer yet or there is no second interface, it gives 0 in its " - "place."); + GET_COMMAND(rx_threads, getRxThreadIds, + "\n\tGet thread ids from the receiver in order of [parent, " + "tcp, listener 0, processor 0, streamer 0, listener 1, " + "processor 1, streamer 1, arping]. If no streamer yet or there " + "is no second interface, it gives 0 in its place."); INTEGER_COMMAND_VEC_ID( rx_arping, getRxArping, setRxArping, StringTo, "[0, 1]\n\tStarts a thread in slsReceiver to ping the interface it is " - "listening to. Useful in 10G mode."); + "listening to every minute. Useful in 10G mode."); /* File */ diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 3fbb4c0a4..36bda4160 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -325,6 +325,9 @@ std::array Implementation::getThreadIds() const { retval[id++] = 0; } } + if (threadArping->IsRunning()) { + retval[NUM_RX_THREAD_IDS - 1] = threadArping->GetThreadId(); + } return retval; } diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 6feb18c23..4dd5d3f48 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -73,7 +73,7 @@ #define DEFAULT_STREAMING_TIMER_IN_MS 500 -#define NUM_RX_THREAD_IDS 8 +#define NUM_RX_THREAD_IDS 9 #ifdef __cplusplus class slsDetectorDefs {