From aaa9f9f4ad65093b3e1f5760dbdf93fd4ac4ae9f Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 9 Aug 2021 12:13:55 +0200 Subject: [PATCH] merge bug fix --- python/slsdet/detector.py | 15 +++++++++++++++ python/src/detector.cpp | 8 ++++++++ slsDetectorSoftware/src/Detector.cpp | 8 ++++++++ 3 files changed, 31 insertions(+) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 5b7d67e1f..cf5f7f023 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2254,6 +2254,21 @@ class Detector(CppDetectorApi): def filterresistor(self, value): ut.set_using_dict(self.setFilterResistor, value) + @property + @element + def filtercell(self): + """ + [Jungfrau] Set filter capacitor. + Note + ---- + [Jungfrau] Options: 0-12. Default: 0. Advanced user command. + """ + return self.getFilterCell() + + @filtercell.setter + def filtercell(self, value): + ut.set_using_dict(self.setFilterCell, value) + @property def maxclkphaseshift(self): """ diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 322a4ca49..5ee258e2c 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1104,6 +1104,14 @@ void init_det(py::module &m) { (void (Detector::*)(int, sls::Positions)) & Detector::setFilterResistor, py::arg(), py::arg() = Positions{}) + .def("getFilterCell", + (Result(Detector::*)(sls::Positions) const) & + Detector::getFilterCell, + py::arg() = Positions{}) + .def("setFilterCell", + (void (Detector::*)(int, sls::Positions)) & + Detector::setFilterCell, + py::arg(), py::arg() = Positions{}) .def("getCurrentSource", (Result(Detector::*)(sls::Positions) const) & Detector::getCurrentSource, diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 394d77a09..e5e36735c 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1521,6 +1521,14 @@ void Detector::setGainMode(const defs::gainMode mode, Positions pos) { pimpl->Parallel(&Module::setGainMode, pos, mode); } +Result Detector::getFilterCell(Positions pos) const { + return pimpl->Parallel(&Module::getFilterCell, pos); +} + +void Detector::setFilterCell(int cell, Positions pos) { + pimpl->Parallel(&Module::setFilterCell, pos, cell); +} + // Gotthard Specific Result Detector::getROI(Positions pos) const {