Merge branch '5.0.1-rc' into developer

This commit is contained in:
Erik Frojdh 2020-11-23 09:20:22 +01:00
commit c120c70678
5 changed files with 63 additions and 14 deletions

View File

@ -192,7 +192,7 @@ if (SLS_USE_INTEGRATION_TESTS)
endif (SLS_USE_INTEGRATION_TESTS) endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON) if (SLS_USE_PYTHON)
set(PYBIND11_CPP_STANDARD -std=c++11) find_package (Python 3.6 COMPONENTS Interpreter Development)
add_subdirectory(libs/pybind11) add_subdirectory(libs/pybind11)
add_subdirectory(python) add_subdirectory(python)
endif(SLS_USE_PYTHON) endif(SLS_USE_PYTHON)

@ -1 +1 @@
Subproject commit 4f72ef846fe8453596230ac285eeaa0ce3278bb4 Subproject commit f1abf5d9159b805674197f6bc443592e631c9130

View File

@ -1,6 +1,4 @@
# find_package (Python COMPONENTS Interpreter Development)
pybind11_add_module(_slsdet pybind11_add_module(_slsdet
src/main.cpp src/main.cpp
src/enums.cpp src/enums.cpp
@ -9,11 +7,8 @@ pybind11_add_module(_slsdet
) )
target_link_libraries(_slsdet PUBLIC target_link_libraries(_slsdet PUBLIC
slsDetectorShared slsDetectorStatic
slsReceiverShared )
slsSupportShared
${ZeroMQ_LIBRARIES}
)

View File

@ -349,7 +349,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def nframes(self): def framecounter(self):
""" """
[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control. [Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control.
Note Note
@ -1009,6 +1009,32 @@ class Detector(CppDetectorApi):
ip = ut.make_ip(ip) #Convert from int or string to IpAddr ip = ut.make_ip(ip) #Convert from int or string to IpAddr
ut.set_using_dict(self.setClientZmqIp, ip) ut.set_using_dict(self.setClientZmqIp, ip)
@property
def zmqhwm(self):
"""
Client's zmq receive high water mark. Default is the zmq library's default (1000), can also be set here using -1.
This is a high number and can be set to 2 for gui purposes.
One must also set the receiver's send high water mark to similar value. Final effect is sum of them.
Setting it via command line is useful only before zmq enabled (before opening gui).
"""
return self.getClientZmqHwm()
@zmqhwm.setter
def zmqhwm(self, n_frames):
self.setClientZmqHwm(n_frames)
@property
def rx_zmqhwm(self):
"""
Receiver's zmq send high water mark. Default is the zmq library's default (1000). This is a high number and can be set to 2 for gui purposes. One must also set the client's receive high water mark to similar value. Final effect is sum of them. Also restarts receiver zmq streaming if enabled. Can set to -1 to set default value.
"""
return self.getRxZmqHwm()
@rx_zmqhwm.setter
def rx_zmqhwm(self, n_frames):
self.setRxZmqHwm(n_frames)
@property @property
@element @element
def udp_dstip(self): def udp_dstip(self):
@ -1965,7 +1991,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def now(self): def runtime(self):
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up. """[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up.
Note Note
----- -----
@ -3079,6 +3105,14 @@ class Detector(CppDetectorApi):
""" """
return ClkFreqProxy(self) return ClkFreqProxy(self)
def readout(self):
"""
Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
"""
self.startDetectorReadout()
""" """
---------------------------<<<Debug>>>--------------------------- ---------------------------<<<Debug>>>---------------------------
""" """

View File

@ -120,6 +120,10 @@ void init_det(py::module &m) {
(void (Detector::*)(const bool)) & (void (Detector::*)(const bool)) &
Detector::setGapPixelsinCallback, Detector::setGapPixelsinCallback,
py::arg()) py::arg())
.def("isVirtualDetectorServer",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::isVirtualDetectorServer,
py::arg() = Positions{})
.def("registerAcquisitionFinishedCallback", .def("registerAcquisitionFinishedCallback",
(void (Detector::*)(void (*)(double, int, void *), void *)) & (void (Detector::*)(void (*)(double, int, void *), void *)) &
Detector::registerAcquisitionFinishedCallback, Detector::registerAcquisitionFinishedCallback,
@ -314,6 +318,9 @@ void init_det(py::module &m) {
py::arg(), py::arg() = Positions{}) py::arg(), py::arg() = Positions{})
.def("getDacList", (std::vector<defs::dacIndex>(Detector::*)() const) & .def("getDacList", (std::vector<defs::dacIndex>(Detector::*)() const) &
Detector::getDacList) Detector::getDacList)
.def("setDefaultDacs",
(void (Detector::*)(sls::Positions)) & Detector::setDefaultDacs,
py::arg() = Positions{})
.def("getDAC", .def("getDAC",
(Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions) (Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions)
const) & const) &
@ -356,6 +363,8 @@ void init_det(py::module &m) {
.def("startReceiver", (void (Detector::*)()) & Detector::startReceiver) .def("startReceiver", (void (Detector::*)()) & Detector::startReceiver)
.def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver) .def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver)
.def("startDetector", (void (Detector::*)()) & Detector::startDetector) .def("startDetector", (void (Detector::*)()) & Detector::startDetector)
.def("startDetectorReadout",
(void (Detector::*)()) & Detector::startDetectorReadout)
.def("stopDetector", (void (Detector::*)()) & Detector::stopDetector) .def("stopDetector", (void (Detector::*)()) & Detector::stopDetector)
.def("getDetectorStatus", .def("getDetectorStatus",
(Result<defs::runStatus>(Detector::*)(sls::Positions) const) & (Result<defs::runStatus>(Detector::*)(sls::Positions) const) &
@ -599,15 +608,15 @@ void init_det(py::module &m) {
Detector::setPartialFramesPadding, Detector::setPartialFramesPadding,
py::arg(), py::arg() = Positions{}) py::arg(), py::arg() = Positions{})
.def("getRxUDPSocketBufferSize", .def("getRxUDPSocketBufferSize",
(Result<int64_t>(Detector::*)(sls::Positions) const) & (Result<int>(Detector::*)(sls::Positions) const) &
Detector::getRxUDPSocketBufferSize, Detector::getRxUDPSocketBufferSize,
py::arg() = Positions{}) py::arg() = Positions{})
.def("setRxUDPSocketBufferSize", .def("setRxUDPSocketBufferSize",
(void (Detector::*)(int64_t, sls::Positions)) & (void (Detector::*)(int, sls::Positions)) &
Detector::setRxUDPSocketBufferSize, Detector::setRxUDPSocketBufferSize,
py::arg(), py::arg() = Positions{}) py::arg(), py::arg() = Positions{})
.def("getRxRealUDPSocketBufferSize", .def("getRxRealUDPSocketBufferSize",
(Result<int64_t>(Detector::*)(sls::Positions) const) & (Result<int>(Detector::*)(sls::Positions) const) &
Detector::getRxRealUDPSocketBufferSize, Detector::getRxRealUDPSocketBufferSize,
py::arg() = Positions{}) py::arg() = Positions{})
.def("getRxLock", .def("getRxLock",
@ -747,6 +756,17 @@ void init_det(py::module &m) {
(void (Detector::*)(const sls::IpAddr, sls::Positions)) & (void (Detector::*)(const sls::IpAddr, sls::Positions)) &
Detector::setClientZmqIp, Detector::setClientZmqIp,
py::arg(), py::arg() = Positions{}) py::arg(), py::arg() = Positions{})
.def("getClientZmqHwm",
(int (Detector::*)() const) & Detector::getClientZmqHwm)
.def("setClientZmqHwm",
(void (Detector::*)(const int)) & Detector::setClientZmqHwm,
py::arg())
.def("getRxZmqHwm",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getRxZmqHwm,
py::arg() = Positions{})
.def("setRxZmqHwm",
(void (Detector::*)(const int)) & Detector::setRxZmqHwm, py::arg())
.def("getSubExptime", .def("getSubExptime",
(Result<sls::ns>(Detector::*)(sls::Positions) const) & (Result<sls::ns>(Detector::*)(sls::Positions) const) &
Detector::getSubExptime, Detector::getSubExptime,