diff --git a/python/sls_detector/detector.py b/python/sls_detector/detector.py index 39353d5ec..6b87ae2d9 100755 --- a/python/sls_detector/detector.py +++ b/python/sls_detector/detector.py @@ -332,43 +332,43 @@ class Detector: """ return self._api.getFirmwareVersion() - @property - def flags(self): - """Read and set flags. Accepts both single flag as - string or list of flags. + # @property + # def flags(self): + # """Read and set flags. Accepts both single flag as + # string or list of flags. - Raises - -------- - RuntimeError - If flag not recognized + # Raises + # -------- + # RuntimeError + # If flag not recognized - Examples - ---------- + # Examples + # ---------- - :: + # :: - #Eiger - detector.flags - >> ['storeinram', 'parallel'] + # #Eiger + # detector.flags + # >> ['storeinram', 'parallel'] - detector.flags = 'nonparallel' - detector.flags - >> ['storeinram', 'nonparallel'] + # detector.flags = 'nonparallel' + # detector.flags + # >> ['storeinram', 'nonparallel'] - detector.flags = ['continous', 'parallel'] + # detector.flags = ['continous', 'parallel'] - """ - return self._api.getReadoutFlags() + # """ + # return self._api.getReadoutFlags() - @flags.setter - def flags(self, flags): - if isinstance(flags, str): - self._api.setReadoutFlag(flags) - elif isinstance(flags, Iterable): - for f in flags: - self._api.setReadoutFlag(f) + # @flags.setter + # def flags(self, flags): + # if isinstance(flags, str): + # self._api.setReadoutFlag(flags) + # elif isinstance(flags, Iterable): + # for f in flags: + # self._api.setReadoutFlag(f) @property def frames_caught(self): diff --git a/python/src/DetectorPythonInterface.h b/python/src/DetectorPythonInterface.h index f55bdc13c..ffd2b7503 100755 --- a/python/src/DetectorPythonInterface.h +++ b/python/src/DetectorPythonInterface.h @@ -428,10 +428,10 @@ class DetectorPythonInterface { return det.getADC(adc, mod_id); } - std::vector getReadoutFlags(); + // std::vector getReadoutFlags(); - // note singular - void setReadoutFlag(const std::string flag_name); + // // note singular + // void setReadoutFlag(const std::string flag_name); // name to enum transltion of dac int getDacVthreshold() { @@ -900,75 +900,75 @@ slsDetectorDefs::dacIndex DetectorPythonInterface::dacNameToEnum(std::string dac // overflow of single subframes */ // }; -std::vector DetectorPythonInterface::getReadoutFlags() { - std::vector flags; - auto r = det.setReadOutFlags(); - if (r & slsDetectorDefs::readOutFlags::STORE_IN_RAM) - flags.push_back("storeinram"); - if (r & slsDetectorDefs::readOutFlags::READ_HITS) - flags.push_back("readhits"); - if (r & slsDetectorDefs::readOutFlags::ZERO_COMPRESSION) - flags.push_back("zerocompression"); - if (r & slsDetectorDefs::readOutFlags::PUMP_PROBE_MODE) - flags.push_back("pumpprobe"); - if (r & slsDetectorDefs::readOutFlags::BACKGROUND_CORRECTIONS) - flags.push_back("backgroundcorrections"); - if (r & slsDetectorDefs::readOutFlags::TOT_MODE) - flags.push_back("tot"); - if (r & slsDetectorDefs::readOutFlags::CONTINOUS_RO) - flags.push_back("continous"); - if (r & slsDetectorDefs::readOutFlags::PARALLEL) - flags.push_back("parallel"); - if (r & slsDetectorDefs::readOutFlags::NONPARALLEL) - flags.push_back("nonparallel"); - if (r & slsDetectorDefs::readOutFlags::DIGITAL_ONLY) - flags.push_back("digital"); - if (r & slsDetectorDefs::readOutFlags::ANALOG_AND_DIGITAL) - flags.push_back("analog_digital"); - if (r & slsDetectorDefs::readOutFlags::DUT_CLK) - flags.push_back("dutclk"); - if (r & slsDetectorDefs::readOutFlags::NOOVERFLOW) - flags.push_back("nooverflow"); - if (r & slsDetectorDefs::readOutFlags::SHOW_OVERFLOW) - flags.push_back("overflow"); - return flags; -} +// std::vector DetectorPythonInterface::getReadoutFlags() { +// std::vector flags; +// auto r = det.setReadOutFlags(); +// if (r & slsDetectorDefs::readOutFlags::STORE_IN_RAM) +// flags.push_back("storeinram"); +// if (r & slsDetectorDefs::readOutFlags::READ_HITS) +// flags.push_back("readhits"); +// if (r & slsDetectorDefs::readOutFlags::ZERO_COMPRESSION) +// flags.push_back("zerocompression"); +// if (r & slsDetectorDefs::readOutFlags::PUMP_PROBE_MODE) +// flags.push_back("pumpprobe"); +// if (r & slsDetectorDefs::readOutFlags::BACKGROUND_CORRECTIONS) +// flags.push_back("backgroundcorrections"); +// if (r & slsDetectorDefs::readOutFlags::TOT_MODE) +// flags.push_back("tot"); +// if (r & slsDetectorDefs::readOutFlags::CONTINOUS_RO) +// flags.push_back("continous"); +// if (r & slsDetectorDefs::readOutFlags::PARALLEL) +// flags.push_back("parallel"); +// if (r & slsDetectorDefs::readOutFlags::NONPARALLEL) +// flags.push_back("nonparallel"); +// if (r & slsDetectorDefs::readOutFlags::DIGITAL_ONLY) +// flags.push_back("digital"); +// if (r & slsDetectorDefs::readOutFlags::ANALOG_AND_DIGITAL) +// flags.push_back("analog_digital"); +// if (r & slsDetectorDefs::readOutFlags::DUT_CLK) +// flags.push_back("dutclk"); +// if (r & slsDetectorDefs::readOutFlags::NOOVERFLOW) +// flags.push_back("nooverflow"); +// if (r & slsDetectorDefs::readOutFlags::SHOW_OVERFLOW) +// flags.push_back("overflow"); +// return flags; +// } -// note singular -void DetectorPythonInterface::setReadoutFlag(const std::string flag_name) { - if (flag_name == "none") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::NORMAL_READOUT); - else if (flag_name == "storeinram") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::STORE_IN_RAM); - else if (flag_name == "readhits") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::READ_HITS); - else if (flag_name == "zerocompression") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::ZERO_COMPRESSION); - else if (flag_name == "pumpprobe") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::PUMP_PROBE_MODE); - else if (flag_name == "backgroundcorrections") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::BACKGROUND_CORRECTIONS); - else if (flag_name == "tot") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::TOT_MODE); - else if (flag_name == "continous") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::CONTINOUS_RO); - else if (flag_name == "parallel") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::PARALLEL); - else if (flag_name == "nonparallel") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::NONPARALLEL); - else if (flag_name == "digital") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::DIGITAL_ONLY); - else if (flag_name == "analog_digital") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::ANALOG_AND_DIGITAL); - else if (flag_name == "dutclk") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::DUT_CLK); - else if (flag_name == "nooverflow") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::NOOVERFLOW); - else if (flag_name == "overflow") - det.setReadOutFlags(slsDetectorDefs::readOutFlags::SHOW_OVERFLOW); - else - throw std::runtime_error("Flag name not recognized"); -} +// // note singular +// void DetectorPythonInterface::setReadoutFlag(const std::string flag_name) { +// if (flag_name == "none") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::NORMAL_READOUT); +// else if (flag_name == "storeinram") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::STORE_IN_RAM); +// else if (flag_name == "readhits") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::READ_HITS); +// else if (flag_name == "zerocompression") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::ZERO_COMPRESSION); +// else if (flag_name == "pumpprobe") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::PUMP_PROBE_MODE); +// else if (flag_name == "backgroundcorrections") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::BACKGROUND_CORRECTIONS); +// else if (flag_name == "tot") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::TOT_MODE); +// else if (flag_name == "continous") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::CONTINOUS_RO); +// else if (flag_name == "parallel") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::PARALLEL); +// else if (flag_name == "nonparallel") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::NONPARALLEL); +// else if (flag_name == "digital") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::DIGITAL_ONLY); +// else if (flag_name == "analog_digital") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::ANALOG_AND_DIGITAL); +// else if (flag_name == "dutclk") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::DUT_CLK); +// else if (flag_name == "nooverflow") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::NOOVERFLOW); +// else if (flag_name == "overflow") +// det.setReadOutFlags(slsDetectorDefs::readOutFlags::SHOW_OVERFLOW); +// else +// throw std::runtime_error("Flag name not recognized"); +// } std::vector DetectorPythonInterface::getRateCorrection() { std::vector rate_corr; diff --git a/python/src/main.cpp b/python/src/main.cpp index 4adb78ef1..66914fead 100755 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -293,8 +293,8 @@ PYBIND11_MODULE(_sls_detector, m) { .def("getReceiverLock", &DetectorPythonInterface::getReceiverLock) .def("setReceiverLock", &DetectorPythonInterface::setReceiverLock) - .def("getReadoutFlags", &DetectorPythonInterface::getReadoutFlags) - .def("setReadoutFlag", &DetectorPythonInterface::setReadoutFlag) + // .def("getReadoutFlags", &DetectorPythonInterface::getReadoutFlags) + // .def("setReadoutFlag", &DetectorPythonInterface::setReadoutFlag) .def("setFileFormat", &DetectorPythonInterface::setFileFormat) .def("getFileFormat", &DetectorPythonInterface::getFileFormat) diff --git a/tests/include/tests/globals.h b/tests/include/tests/globals.h index beed08716..d4d5b3ff3 100644 --- a/tests/include/tests/globals.h +++ b/tests/include/tests/globals.h @@ -2,7 +2,7 @@ using dt = slsDetectorDefs::detectorType; using di = slsDetectorDefs::dacIndex; using ti = slsDetectorDefs::timerIndex; -using ro = slsDetectorDefs::readOutFlags; +// using ro = slsDetectorDefs::readOutFlags; using sv = slsDetectorDefs::speedVariable; using defs = slsDetectorDefs;