From d3bbb50fc8eca1c2f9cd9e6de7e9a0b03e32b102 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 5 Aug 2021 17:41:21 +0200 Subject: [PATCH 1/4] wip --- slsDetectorSoftware/src/CmdProxy.h | 8 +++- .../tests/test-CmdProxy-jungfrau.cpp | 44 +++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 0bde34e55..1e08df708 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -934,6 +934,7 @@ class CmdProxy { {"storagecell_start", &CmdProxy::storagecell_start}, {"storagecell_delay", &CmdProxy::storagecell_delay}, {"gainmode", &CmdProxy::gainmode}, + {"filtercell", &CmdProxy::filtercell}, /* Gotthard Specific */ {"roi", &CmdProxy::ROI}, @@ -1888,8 +1889,11 @@ class CmdProxy { sls::StringTo, "[dynamicgain|forceswitchg1|forceswitchg2|fixg1|fixg2|fixg0]\n\t[" "Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, " - "you can " - "damage the detector!!!"); + "you can damage the detector!!!"); + + INTEGER_COMMAND_VEC_ID( + filtercell, getFilterCell, setFilterCell, sls::StringTo, + "[0-12]\n\t[Jungfrau] Set Filter Cell. Advanced user Command"); /* Gotthard Specific */ TIME_GET_COMMAND(exptimel, getExptimeLeft, diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index 3fddd6f26..fbf2421fb 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -488,3 +488,47 @@ TEST_CASE("gainmode", "[.cmd]") { REQUIRE_THROWS(proxy.Call("gainmode", {}, -1, GET)); } } + +TEST_CASE("filtercell", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::JUNGFRAU) { + // chip version 1.1 + if (det.getChipVersion().squash() * 10 == 11) { + auto prev_val = det.getFilterCell().tsquash( + "inconsistent #additional storage cells to test"); + { + std::ostringstream oss; + proxy.Call("filtercell", {"1"}, -1, PUT, oss); + REQUIRE(oss.str() == "filtercell 1\n"); + } + { + std::ostringstream oss; + proxy.Call("filtercell", {"15"}, -1, PUT, oss); + REQUIRE(oss.str() == "filtercell 15\n"); + } + { + std::ostringstream oss; + proxy.Call("filtercell", {"0"}, -1, PUT, oss); + REQUIRE(oss.str() == "filtercell 0\n"); + } + { + std::ostringstream oss; + proxy.Call("filtercell", {}, -1, GET, oss); + REQUIRE(oss.str() == "filtercell 0\n"); + } + REQUIRE_THROWS(proxy.Call("filtercell", {"16"}, -1, PUT)); + det.setFilterCell(prev_val); + } + // chip version 1.0 + else { + // cannot set/get filter cell + REQUIRE_THROWS(proxy.Call("filtercell", {"1"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("filtercell", {}, -1, GET)); + } + } else { + REQUIRE_THROWS(proxy.Call("filtercell", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("filtercell", {"0"}, -1, PUT)); + } +} \ No newline at end of file From 42257d8f67f9db33975aad3a85f8c46ea438c574 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 08:18:34 +0200 Subject: [PATCH 2/4] wip --- slsDetectorSoftware/include/sls/Detector.h | 7 +++++++ slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 5401b4233..6ad3b0826 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1199,6 +1199,13 @@ class Detector { */ void setGainMode(const defs::gainMode mode, Positions pos = {}); + /** [Jungfrau] Advanced */ + Result getFilterCell(Positions pos = {}) const; + + /** [Jungfrau] Advanced Options[0-12] + */ + void setFilterCell(int cell, Positions pos = {}); + ///@{ /** @name Gotthard Specific */ diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index fbf2421fb..741565e90 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -505,8 +505,8 @@ TEST_CASE("filtercell", "[.cmd]") { } { std::ostringstream oss; - proxy.Call("filtercell", {"15"}, -1, PUT, oss); - REQUIRE(oss.str() == "filtercell 15\n"); + proxy.Call("filtercell", {"12"}, -1, PUT, oss); + REQUIRE(oss.str() == "filtercell 12\n"); } { std::ostringstream oss; @@ -518,8 +518,10 @@ TEST_CASE("filtercell", "[.cmd]") { proxy.Call("filtercell", {}, -1, GET, oss); REQUIRE(oss.str() == "filtercell 0\n"); } - REQUIRE_THROWS(proxy.Call("filtercell", {"16"}, -1, PUT)); - det.setFilterCell(prev_val); + REQUIRE_THROWS(proxy.Call("filtercell", {"13"}, -1, PUT)); + for (int i = 0; i != det.size(); ++i) { + det.setFilterCell(prev_val[i], {i}); + } } // chip version 1.0 else { From 2934ccbf2c7daafb22bca908efd1c9d904c606c1 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 14:42:41 +0200 Subject: [PATCH 3/4] filter cell (only chipv1.1) --- python/slsdet/detector.py | 16 +++++ python/src/detector.cpp | 7 ++ .../slsDetectorFunctionList.c | 31 ++++++++- .../slsDetectorServer_defs.h | 2 + .../slsDetectorFunctionList.c | 1 + .../include/slsDetectorFunctionList.h | 2 + .../include/slsDetectorServer_funcs.h | 4 +- .../src/slsDetectorServer_funcs.c | 67 +++++++++++++++++-- slsDetectorSoftware/src/Detector.cpp | 8 +++ slsDetectorSoftware/src/Module.cpp | 8 +++ slsDetectorSoftware/src/Module.h | 4 +- .../tests/test-CmdProxy-jungfrau.cpp | 3 +- .../include/sls/sls_detector_funcs.h | 4 ++ 13 files changed, 147 insertions(+), 10 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 8137f1526..79ea86c38 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2244,6 +2244,7 @@ class Detector(CppDetectorApi): "resistance. Note ---- + Advanced user command. [Gotthard2] Default is 0. Options: 0-3. [Jungfrau] Default is 1. Options: 0-1. """ @@ -2253,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 482bc9f23..9088d197d 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1104,6 +1104,13 @@ void init_det(py::module &m) { .def("setFilterResistor", (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/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index 999b04036..fc9f1ae63 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -475,7 +475,10 @@ void setupDetector() { setThresholdTemperature(DEFAULT_TMP_THRSHLD); setTemperatureEvent(0); setFlipRows(DEFAULT_FLIP_ROWS); - setFilterResistor(DEFAULT_FILTER_RESISTOR); + if (getChipVersion() == 11) { + setFilterResistor(DEFAULT_FILTER_RESISTOR); + setFilterCell(DEFAULT_FILTER_CELL); + } } int resetToDefaultDacs(int hardReset) { @@ -2055,6 +2058,32 @@ int setFilterResistor(int value) { return FAIL; } +int getFilterCell() { +#ifdef VIRTUAL + uint32_t addr = CONFIG_V11_REG; +#else + uint32_t addr = CONFIG_V11_STATUS_REG; +#endif + uint32_t value = (bus_r(addr) & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST; + // count number of bits = which icell + return (__builtin_popcount(value)); +} + +void setFilterCell(int iCell) { + uint32_t value = 0; + // sets the corresponding cell and the cells before it + if (iCell != 0) { + value = iCell; + if (value > 1) { + value += (value - 1); + } + } + uint32_t addr = CONFIG_V11_REG; + bus_w(addr, bus_r(addr) &~ CONFIG_V11_FLTR_CLL_MSK); + bus_w(addr, bus_r(addr) | ((value << CONFIG_V11_FLTR_CLL_OFST) & CONFIG_V11_FLTR_CLL_MSK)); + LOG(logINFO, ("Setting Filter Cell to %d [Reg:0x%x]\n", iCell, bus_r(addr))); +} + int getTenGigaFlowControl() { return ((bus_r(CONFIG_REG) & CONFIG_ETHRNT_FLW_CNTRL_MSK) >> CONFIG_ETHRNT_FLW_CNTRL_OFST); diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h index 4742c19fe..cc41a62ee 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h @@ -107,11 +107,13 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; #define DEFAULT_STRG_CLL_DLY (0) #define DEFAULT_FLIP_ROWS (0) #define DEFAULT_FILTER_RESISTOR (1) // higher resistor +#define DEFAULT_FILTER_CELL (0) #define HIGHVOLTAGE_MIN (60) #define HIGHVOLTAGE_MAX (200) #define DAC_MIN_MV (0) #define DAC_MAX_MV (2500) +#define MAX_FILTER_CELL_VAL (12) /* Defines in the Firmware */ #define MAX_TIMESLOT_VAL (0x1F) diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index d498614b5..f0ae19d82 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -2573,6 +2573,7 @@ int setChipStatusRegister(int csr) { } int setGainCaps(int caps) { + LOG(logINFO, ("Setting gain caps to: %u\n", caps)); // Update only gain caps, leave the rest of the CSR unchanged int csr = getChipStatusRegister(); csr &= ~GAIN_MASK; diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 0643ac399..f28fcc102 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -464,6 +464,8 @@ int getFlipRows(); void setFlipRows(int arg); int setFilterResistor(int value); int getFilterResistor(); +int getFilterCell(); +void setFilterCell(int iCell); // eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter #elif EIGERD diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index 5477cea6d..040b64f18 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -262,4 +262,6 @@ int set_gain_mode(int); int get_comp_disable_time(int); int set_comp_disable_time(int); int get_flip_rows(int); -int set_flip_rows(int); \ No newline at end of file +int set_flip_rows(int); +int get_filter_cell(int); +int set_filter_cell(int); \ No newline at end of file diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 5027f3fe3..473d2b26a 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -388,6 +388,8 @@ void function_table() { flist[F_SET_COMP_DISABLE_TIME] = &set_comp_disable_time; flist[F_GET_FLIP_ROWS] = &get_flip_rows; flist[F_SET_FLIP_ROWS] = &set_flip_rows; + flist[F_GET_FILTER_CELL] = &get_filter_cell; + flist[F_SET_FILTER_CELL] = &set_filter_cell; // check if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) { @@ -8243,7 +8245,7 @@ int set_gain_caps(int file_des) { if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) return printSocketReadError(); - LOG(logINFO, ("Setting gain caps to: %u\n", arg)); + LOG(logDEBUG1, ("Setting gain caps to: %u\n", arg)); int retval = -1; @@ -8389,7 +8391,7 @@ int set_veto_stream(int file_des) { if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) return printSocketReadError(); - LOG(logINFO, ("Setting vetostream: %u\n", (int)arg)); + LOG(logDEBUG1, ("Setting vetostream: %u\n", (int)arg)); #ifndef GOTTHARD2D functionNotImplemented(); @@ -8450,7 +8452,7 @@ int set_veto_algorithm(int file_des) { enum vetoAlgorithm alg = args[0]; enum ethernetInterface interface = args[1]; - LOG(logINFO, ("Setting vetoalgorithm (interface: %d): %u\n", (int)interface, + LOG(logDEBUG1, ("Setting vetoalgorithm (interface: %d): %u\n", (int)interface, (int)alg)); #ifndef GOTTHARD2D @@ -8614,7 +8616,7 @@ int set_gain_mode(int file_des) { if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) return printSocketReadError(); enum gainMode gainmode = arg; - LOG(logINFO, ("Setting gain mode %d\n", (int)gainmode)); + LOG(logDEBUG1, ("Setting gain mode %d\n", (int)gainmode)); #ifndef JUNGFRAUD functionNotImplemented(); @@ -8730,7 +8732,7 @@ int set_flip_rows(int file_des) { if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) return printSocketReadError(); - LOG(logINFO, ("Setting flip rows: %u\n", (int)arg)); + LOG(logDEBUG1, ("Setting flip rows: %u\n", (int)arg)); #ifndef JUNGFRAUD functionNotImplemented(); @@ -8766,3 +8768,58 @@ int set_flip_rows(int file_des) { #endif return Server_SendResult(file_des, INT32, NULL, 0); } + + +int get_filter_cell(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + int retval = -1; + + LOG(logDEBUG1, ("Getting filter cell\n")); + +#ifndef JUNGFRAUD + functionNotImplemented(); +#else + // get only + retval = getFilterCell(); + LOG(logDEBUG1, ("filter cell retval: %u\n", retval)); +#endif + return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); +} + +int set_filter_cell(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + int arg = -1; + + if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) + return printSocketReadError(); + LOG(logDEBUG1, ("Setting filter cell: %u\n", (int)arg)); + +#ifndef JUNGFRAUD + functionNotImplemented(); +#else + // only set + if (Server_VerifyLock() == OK) { + + if (arg < 0 || arg > MAX_FILTER_CELL_VAL) { + ret = FAIL; + sprintf(mess, + "Could not set filter cell. Invalid argument %d. Options: 0 - %d\n", + arg, MAX_FILTER_CELL_VAL); + LOG(logERROR, (mess)); + } + // only for chipv1.1 + else if (getChipVersion() == 10) { + ret = FAIL; + strcpy(mess, "Could not set filter cell. Only available for " + "chip version 1.1\n"); + LOG(logERROR, (mess)); + } else { + setFilterCell(arg); + // no validation as it might take time to update status register if acquiring + } + } +#endif + return Server_SendResult(file_des, INT32, NULL, 0); +} \ No newline at end of file diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 66cfaa607..ca08d77fb 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 { diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 9113889e4..d32124547 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1632,6 +1632,14 @@ void Module::setGainMode(const slsDetectorDefs::gainMode mode) { sendToDetector(F_SET_GAIN_MODE, mode, nullptr); } +int Module::getFilterCell() const { + return sendToDetector(F_GET_FILTER_CELL); +} + +void Module::setFilterCell(int value) { + sendToDetector(F_SET_FILTER_CELL, value, nullptr); +} + // Gotthard Specific slsDetectorDefs::ROI Module::getROI() const { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 240ea045a..7dbbbb774 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -375,7 +375,9 @@ class Module : public virtual slsDetectorDefs { void setStorageCellDelay(int64_t value); gainMode getGainMode() const; void setGainMode(const gainMode mode); - + int getFilterCell() const; + void setFilterCell(int value); + /************************************************** * * * Gotthard Specific * diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index 741565e90..64c0bd91f 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -496,8 +496,7 @@ TEST_CASE("filtercell", "[.cmd]") { if (det_type == defs::JUNGFRAU) { // chip version 1.1 if (det.getChipVersion().squash() * 10 == 11) { - auto prev_val = det.getFilterCell().tsquash( - "inconsistent #additional storage cells to test"); + auto prev_val = det.getFilterCell(); { std::ostringstream oss; proxy.Call("filtercell", {"1"}, -1, PUT, oss); diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index a7736368b..19748de11 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -239,6 +239,8 @@ enum detFuncs { F_SET_COMP_DISABLE_TIME, F_GET_FLIP_ROWS, F_SET_FLIP_ROWS, + F_GET_FILTER_CELL, + F_SET_FILTER_CELL, NUM_DET_FUNCTIONS, RECEIVER_ENUM_START = 256, /**< detector function should not exceed this @@ -585,6 +587,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_SET_COMP_DISABLE_TIME: return "F_SET_COMP_DISABLE_TIME"; case F_GET_FLIP_ROWS: return "F_GET_FLIP_ROWS"; case F_SET_FLIP_ROWS: return "F_SET_FLIP_ROWS"; + case F_GET_FILTER_CELL: return "F_GET_FILTER_CELL"; + case F_SET_FILTER_CELL: return "F_SET_FILTER_CELL"; case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS"; case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START"; From aaa9f9f4ad65093b3e1f5760dbdf93fd4ac4ae9f Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 9 Aug 2021 12:13:55 +0200 Subject: [PATCH 4/4] 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 {