From 833ca071c412509db34824095d9d48276424dce9 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Thu, 18 Apr 2019 15:40:20 +0200 Subject: [PATCH] fix --- python/src/Detector.h | 2 +- python/src/main.cpp | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/python/src/Detector.h b/python/src/Detector.h index 4833772ed..58dd3ef9a 100755 --- a/python/src/Detector.h +++ b/python/src/Detector.h @@ -250,7 +250,7 @@ class Detector { } - std::array getPatternLoops(uint64_t level, int detPos) { + std::array getPatternLoops(int level, int detPos) { return det.getPatternLoops(level, detPos); } diff --git a/python/src/main.cpp b/python/src/main.cpp index bc2aacc2d..b83c522cd 100755 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -300,17 +300,21 @@ PYBIND11_MODULE(_sls_detector, m) { .def("getNumberOfDetectors", &Detector::getNumberOfDetectors) .def("getDetectorGeometry", &Detector::getDetectorGeometry); + + // Experimental API to use the multi directly and inherit from to reduce // code duplication need to investigate how to handle documentation py::class_ multiDetectorApi(m, "multiDetectorApi"); multiDetectorApi.def(py::init()) .def("acquire", &multiSlsDetector::acquire) - .def_property("online", - py::cpp_function(&multiSlsDetector::setOnline, py::arg(), py::arg()=-1, py::arg("det_id")=-1), - py::cpp_function(&multiSlsDetector::setOnline, py::arg(), py::arg("flag"), py::arg("det_id")=-1) - ) - // .def("_setOnline", &multiSlsDetector::setOnline, py::arg("flag") = -1, + .def_property("online", + py::cpp_function(&multiSlsDetector::setOnline, py::arg(), + py::arg() = -1, py::arg("det_id") = -1), + py::cpp_function(&multiSlsDetector::setOnline, py::arg(), + py::arg("flag"), py::arg("det_id") = -1)) + // .def("_setOnline", &multiSlsDetector::setOnline, py::arg("flag") = + // -1, // py::arg("det_id") = -1) .def_property_readonly( @@ -328,7 +332,8 @@ PYBIND11_MODULE(_sls_detector, m) { py::cpp_function(&multiSlsDetector::getReceiverUDPIP, py::arg(), py::arg("det_id") = -1), py::cpp_function(&multiSlsDetector::setReceiverUDPIP, - py::arg(), py::arg("ip"), py::arg("det_id") = -1) ) + py::arg(), py::arg("ip"), + py::arg("det_id") = -1)) .def("_getReceiverUDPIP", &multiSlsDetector::getReceiverUDPIP) .def("_setReceiverUDPIP", &multiSlsDetector::setReceiverUDPIP) .def("getPatternLoops", &multiSlsDetector::getPatternLoops,