diff --git a/python/scripts/basic.py b/python/scripts/basic.py new file mode 100644 index 000000000..a31e05214 --- /dev/null +++ b/python/scripts/basic.py @@ -0,0 +1,5 @@ +from sls_detector import Eiger +from sls_detector import ExperimentalDetector + +d = Eiger() +e = ExperimentalDetector() \ No newline at end of file diff --git a/python/sls_detector/detector.py b/python/sls_detector/detector.py index d78278407..0b62619e3 100644 --- a/python/sls_detector/detector.py +++ b/python/sls_detector/detector.py @@ -1053,15 +1053,15 @@ class Detector: @property def rx_udpmac(self): - return element_if_equal(self._api.getNetworkParameter('rx_udpmac')) + return self._api.getReceiverUDPMAC(-1) @rx_udpmac.setter def rx_udpmac(self, mac): if isinstance(mac, list): for i, m in enumerate(mac): - self._api.setNetworkParameter('rx_udpmac', m, i) + self._api.setReceiverUDPMAC(m, i) else: - self._api.setNetworkParameter('rx_udpmac', mac, -1) + self._api.setReceiverUDPMAC(mac, -1) @property @error_handling diff --git a/python/sls_detector/experimental.py b/python/sls_detector/experimental.py new file mode 100644 index 000000000..093703ab8 --- /dev/null +++ b/python/sls_detector/experimental.py @@ -0,0 +1,11 @@ + +from _sls_detector import multiDetectorApi + +class ExperimentalDetector(multiDetectorApi): + def __init__(self): + super().__init__(0) + + # @rx_udpip.setter + # def rx_udpip(self, ip): + # self._setReceiverUDPIP(ip, -1) + \ No newline at end of file diff --git a/python/src/Detector.h b/python/src/Detector.h index 18f2ff46b..1261c6630 100644 --- a/python/src/Detector.h +++ b/python/src/Detector.h @@ -93,7 +93,7 @@ class Detector { return det.getReceiverHostname(det_id); } - void setReceiverHostname(const std::string &hostname, int det_id = -1) { + void setReceiverHostname(std::string hostname, int det_id = -1) { det.setReceiverHostname(hostname, det_id); } @@ -101,10 +101,18 @@ class Detector { return det.getReceiverUDPIP(det_id); } - void setReceiverUDPIP(const std::string &ip, int det_id = -1) { + void setReceiverUDPIP(std::string ip, int det_id = -1) { det.setReceiverUDPIP(ip, det_id); } + std::string getReceiverUDPMAC(int det_id = -1){ + return det.getReceiverUDPMAC(det_id); + } + + void setReceiverUDPMAC(std::string mac, int det_id = -1){ + det.setReceiverUDPMAC(mac, det_id); + } + void startReceiver() { det.startReceiver(); } void stopReceiver() { det.stopReceiver(); } diff --git a/python/src/main.cpp b/python/src/main.cpp index 1c300a12f..9e090cc83 100644 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -188,6 +188,8 @@ PYBIND11_MODULE(_sls_detector, m) .def("setReceiverUDPPort2", &Detector::setReceiverUDPPort2) .def("setReceiverUDPIP", &Detector::setReceiverUDPIP) .def("getReceiverUDPIP", &Detector::getReceiverUDPIP) + .def("getReceiverUDPMAC", &Detector::getReceiverUDPMAC) + .def("setReceiverUDPMAC", &Detector::setReceiverUDPMAC) .def("getReceiverPort", &Detector::getReceiverPort) .def("setReceiverPort", &Detector::setReceiverPort)