diff --git a/CMakeLists.txt b/CMakeLists.txt index 1338e84e1..482520f18 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,7 +192,7 @@ if (SLS_USE_INTEGRATION_TESTS) endif (SLS_USE_INTEGRATION_TESTS) 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(python) endif(SLS_USE_PYTHON) diff --git a/libs/pybind11 b/libs/pybind11 index 4f72ef846..f1abf5d91 160000 --- a/libs/pybind11 +++ b/libs/pybind11 @@ -1 +1 @@ -Subproject commit 4f72ef846fe8453596230ac285eeaa0ce3278bb4 +Subproject commit f1abf5d9159b805674197f6bc443592e631c9130 diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index b6017d79a..7120d0ca3 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,6 +1,4 @@ -# find_package (Python COMPONENTS Interpreter Development) - pybind11_add_module(_slsdet src/main.cpp src/enums.cpp @@ -9,11 +7,8 @@ pybind11_add_module(_slsdet ) target_link_libraries(_slsdet PUBLIC - slsDetectorShared - slsReceiverShared - slsSupportShared - ${ZeroMQ_LIBRARIES} - ) + slsDetectorStatic +) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 1d4fe6f02..4919a4f34 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -349,7 +349,7 @@ class Detector(CppDetectorApi): @property @element - def nframes(self): + def framecounter(self): """ [Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control. Note @@ -1009,6 +1009,32 @@ class Detector(CppDetectorApi): ip = ut.make_ip(ip) #Convert from int or string to IpAddr 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 @element def udp_dstip(self): @@ -1965,7 +1991,7 @@ class Detector(CppDetectorApi): @property @element - def now(self): + def runtime(self): """[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up. Note ----- @@ -3079,6 +3105,14 @@ class Detector(CppDetectorApi): """ 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() + + """ ---------------------------<<>>--------------------------- """ diff --git a/python/src/detector.cpp b/python/src/detector.cpp index d0284e0ef..0a86001f9 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -120,6 +120,10 @@ void init_det(py::module &m) { (void (Detector::*)(const bool)) & Detector::setGapPixelsinCallback, py::arg()) + .def("isVirtualDetectorServer", + (Result(Detector::*)(sls::Positions) const) & + Detector::isVirtualDetectorServer, + py::arg() = Positions{}) .def("registerAcquisitionFinishedCallback", (void (Detector::*)(void (*)(double, int, void *), void *)) & Detector::registerAcquisitionFinishedCallback, @@ -314,6 +318,9 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}) .def("getDacList", (std::vector(Detector::*)() const) & Detector::getDacList) + .def("setDefaultDacs", + (void (Detector::*)(sls::Positions)) & Detector::setDefaultDacs, + py::arg() = Positions{}) .def("getDAC", (Result(Detector::*)(defs::dacIndex, bool, sls::Positions) const) & @@ -356,6 +363,8 @@ void init_det(py::module &m) { .def("startReceiver", (void (Detector::*)()) & Detector::startReceiver) .def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver) .def("startDetector", (void (Detector::*)()) & Detector::startDetector) + .def("startDetectorReadout", + (void (Detector::*)()) & Detector::startDetectorReadout) .def("stopDetector", (void (Detector::*)()) & Detector::stopDetector) .def("getDetectorStatus", (Result(Detector::*)(sls::Positions) const) & @@ -599,15 +608,15 @@ void init_det(py::module &m) { Detector::setPartialFramesPadding, py::arg(), py::arg() = Positions{}) .def("getRxUDPSocketBufferSize", - (Result(Detector::*)(sls::Positions) const) & + (Result(Detector::*)(sls::Positions) const) & Detector::getRxUDPSocketBufferSize, py::arg() = Positions{}) .def("setRxUDPSocketBufferSize", - (void (Detector::*)(int64_t, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxUDPSocketBufferSize, py::arg(), py::arg() = Positions{}) .def("getRxRealUDPSocketBufferSize", - (Result(Detector::*)(sls::Positions) const) & + (Result(Detector::*)(sls::Positions) const) & Detector::getRxRealUDPSocketBufferSize, py::arg() = Positions{}) .def("getRxLock", @@ -747,6 +756,17 @@ void init_det(py::module &m) { (void (Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setClientZmqIp, 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(Detector::*)(sls::Positions) const) & + Detector::getRxZmqHwm, + py::arg() = Positions{}) + .def("setRxZmqHwm", + (void (Detector::*)(const int)) & Detector::setRxZmqHwm, py::arg()) .def("getSubExptime", (Result(Detector::*)(sls::Positions) const) & Detector::getSubExptime,