From 7bf6cc3995fbfec80ef402fbc72d807c4370f6b3 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 13:25:55 +0200 Subject: [PATCH] wip --- python/slsdet/detector.py | 19 ++++++++++++++++++- python/src/detector.cpp | 7 +++++++ slsDetectorSoftware/src/Detector.cpp | 8 ++++++++ slsDetectorSoftware/src/Module.h | 4 +++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 383c2265c..4e4471316 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2242,7 +2242,9 @@ class Detector(CppDetectorApi): """[Gotthard2] Set filter resistor. Note ---- - Default is 0. Options: 0-3. + Advanced user command. + [Gotthard2] Default is 0. Options: 0-3. + [Jungfrau] Default is 1. Options: 0-1. """ return self.getFilter() @@ -2250,6 +2252,21 @@ class Detector(CppDetectorApi): def filter(self, value): ut.set_using_dict(self.setFilter, 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 7a5807a1d..7f0f71ea3 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1104,6 +1104,13 @@ void init_det(py::module &m) { .def("setFilter", (void (Detector::*)(int, sls::Positions)) & Detector::setFilter, 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 4929a3ead..b8f77c0eb 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1513,6 +1513,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 { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 3a9250d36..73fdb215a 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -373,7 +373,9 @@ class Module : public virtual slsDetectorDefs { void setStorageCellDelay(int64_t value); gainMode getGainMode() const; void setGainMode(const gainMode mode); - + int getStorageCellStart() const; + void setStorageCellStart(int pos); + /************************************************** * * * Gotthard Specific *