apring thread added to thread ids

This commit is contained in:
maliakal_d 2022-02-01 15:28:32 +01:00
parent bf83c9b3e2
commit 2a63548f40
7 changed files with 35 additions and 14 deletions

View File

@ -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 - moench and ctb - can set the starting frame number of next acquisition
- mythen server kernel check incompatible (cet timezone) - mythen server kernel check incompatible (cet timezone)
- rx_arping - rx_arping
- rx_threadsids max is now 9 (breaking api)
2. Resolved Issues 2. Resolved Issues

View File

@ -258,7 +258,7 @@ class Detector(CppDetectorApi):
@element @element
def rx_threads(self): 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 Note
----- -----
@ -268,6 +268,17 @@ class Detector(CppDetectorApi):
""" """
return self.getRxThreadIds() 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 @property
@element @element
def dr(self): def dr(self):

View File

@ -768,6 +768,13 @@ void init_det(py::module &m) {
(Result<std::array<pid_t, 8>>(Detector::*)(sls::Positions) const) & (Result<std::array<pid_t, 8>>(Detector::*)(sls::Positions) const) &
Detector::getRxThreadIds, Detector::getRxThreadIds,
py::arg() = Positions{}) py::arg() = Positions{})
.def("getRxArping",
(Result<bool>(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", .def("getFileFormat",
(Result<defs::fileFormat>(Detector::*)(sls::Positions) const) & (Result<defs::fileFormat>(Detector::*)(sls::Positions) const) &
Detector::getFileFormat, Detector::getFileFormat,

View File

@ -878,15 +878,16 @@ class Detector {
Result<sls::IpAddr> getRxLastClientIP(Positions pos = {}) const; Result<sls::IpAddr> getRxLastClientIP(Positions pos = {}) const;
/** Get thread ids from the receiver in order of [parent, tcp, listener 0, /** 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 * processor 0, streamer 0, listener 1, processor 1, streamer 1, arping]. If
* streamer yet or there is no second interface, it gives 0 in its place. */ * no streamer yet or there is no second interface, it gives 0 in its place.
*/
Result<std::array<pid_t, NUM_RX_THREAD_IDS>> Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
getRxThreadIds(Positions pos = {}) const; getRxThreadIds(Positions pos = {}) const;
Result<bool> getRxArping(Positions pos = {}) const; Result<bool> getRxArping(Positions pos = {}) const;
/** Starts a thread in slsReceiver to ping the interface it is listening. /** Starts a thread in slsReceiver to ping the interface it is listening
* Useful in 10G mode. */ * every minute. Useful in 10G mode. */
void setRxArping(bool value, Positions pos = {}); void setRxArping(bool value, Positions pos = {});
///@} ///@}

View File

@ -1739,18 +1739,16 @@ class CmdProxy {
rx_lastclient, getRxLastClientIP, rx_lastclient, getRxLastClientIP,
"\n\tClient IP Address that last communicated with the receiver."); "\n\tClient IP Address that last communicated with the receiver.");
GET_COMMAND( GET_COMMAND(rx_threads, getRxThreadIds,
rx_threads, getRxThreadIds, "\n\tGet thread ids from the receiver in order of [parent, "
"\n\tGet thread ids from the receiver in order of [parent, tcp, " "tcp, listener 0, processor 0, streamer 0, listener 1, "
"listener 0, " "processor 1, streamer 1, arping]. If no streamer yet or there "
"processor 0, streamer 0, listener 1, processor 1, streamer 1]. If no " "is no second interface, it gives 0 in its place.");
"streamer yet or there is no second interface, it gives 0 in its "
"place.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
rx_arping, getRxArping, setRxArping, StringTo<int>, rx_arping, getRxArping, setRxArping, StringTo<int>,
"[0, 1]\n\tStarts a thread in slsReceiver to ping the interface it is " "[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 */ /* File */

View File

@ -325,6 +325,9 @@ std::array<pid_t, NUM_RX_THREAD_IDS> Implementation::getThreadIds() const {
retval[id++] = 0; retval[id++] = 0;
} }
} }
if (threadArping->IsRunning()) {
retval[NUM_RX_THREAD_IDS - 1] = threadArping->GetThreadId();
}
return retval; return retval;
} }

View File

@ -73,7 +73,7 @@
#define DEFAULT_STREAMING_TIMER_IN_MS 500 #define DEFAULT_STREAMING_TIMER_IN_MS 500
#define NUM_RX_THREAD_IDS 8 #define NUM_RX_THREAD_IDS 9
#ifdef __cplusplus #ifdef __cplusplus
class slsDetectorDefs { class slsDetectorDefs {