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/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index e0f737703..18f6c9b22 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 8c7ccc597..57136a3a3 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -2670,7 +2670,28 @@ enum vetoAlgorithm getVetoAlgorithm(enum ethernetInterface interface) { } void setVetoAlgorithm(enum ethernetInterface interface, - enum vetoAlgorithm alg) {} + enum vetoAlgorithm alg) { + uint32_t addr = CONFIG_REG; + uint32_t value = bus_r(addr); + switch (alg) { + // more to follow + case DEFAULT_ALGORITHM: + if (interface == I3GBE) { + LOG(logINFO, ("Setting default veto algorithm for 3Gbe\n")); + value &= (~CONFIG_VETO_CH_3GB_ALG_MSK); + value |= CONFIG_VETO_CH_3GB_ALG_DEFAULT_VAL; + } else { + LOG(logINFO, ("Setting default veto algorithm for 10Gbe\n")); + value &= (~CONFIG_VETO_CH_10GB_ALG_MSK); + value |= CONFIG_VETO_CH_10GB_ALG_DEFAULT_VAL; + } + break; + default: + LOG(logERROR, ("unknown algorithm %d for 3gbe\n", alg)); + return; + } + bus_w(addr, value); +} void setBadChannels(int nch, int *channels) { LOG(logINFO, ("Setting %d bad channels\n", nch)); 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.h b/slsDetectorSoftware/src/Module.h index 240ea045a..45278ead9 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 getStorageCellStart() const; + void setStorageCellStart(int pos); + /************************************************** * * * Gotthard Specific * diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index fbf82c419..4299573fd 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -5,8 +5,8 @@ #define APIGUI 0x210225 #define APICTB 0x210729 #define APIGOTTHARD 0x210729 -#define APIGOTTHARD2 0x210729 #define APIMYTHEN3 0x210729 #define APIMOENCH 0x210729 #define APIEIGER 0x210729 #define APIJUNGFRAU 0x210802 +#define APIGOTTHARD2 0x210806