mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
M3: polarity, interpolation, pump probe (#421)
* wip, adding m3 functions: polarity, inerpolation, pumpprobe * added interpol, polarity, pump probe, analog pulsing, digital pulsing * tests * binaries in * update release * added python polarity enum * fixed python and minor readability in mythen3.c * binarie sin * added all the m3 funcs also in list.c and enablingall counters for enabling interpolation * binarie sin
This commit is contained in:
@ -3498,10 +3498,60 @@ class Detector(CppDetectorApi):
|
||||
|
||||
def readout(self):
|
||||
"""
|
||||
Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
|
||||
[Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
|
||||
"""
|
||||
self.startDetectorReadout()
|
||||
|
||||
@property
|
||||
@element
|
||||
def polarity(self):
|
||||
"""[Mythen3] Set positive or negative polarity. Enum: polarity"""
|
||||
return self.getPolarity()
|
||||
|
||||
@polarity.setter
|
||||
def polarity(self, value):
|
||||
ut.set_using_dict(self.setPolarity, value)
|
||||
|
||||
@property
|
||||
@element
|
||||
def interpolation(self):
|
||||
"""[Mythen3] Enable or disable interpolation. Enabling also enables all counters """
|
||||
return self.getInterpolation()
|
||||
|
||||
@interpolation.setter
|
||||
def interpolation(self, value):
|
||||
ut.set_using_dict(self.setInterpolation, value)
|
||||
|
||||
@property
|
||||
@element
|
||||
def pumpprobe(self):
|
||||
"""[Mythen3] Enable or disable pump probe mode. """
|
||||
return self.getPumpProbe()
|
||||
|
||||
@pumpprobe.setter
|
||||
def pumpprobe(self, value):
|
||||
ut.set_using_dict(self.setPumpProbe, value)
|
||||
|
||||
@property
|
||||
@element
|
||||
def apulse(self):
|
||||
"""[Mythen3] Enable or disable analog pulsing. """
|
||||
return self.getAnalogPulsing()
|
||||
|
||||
@apulse.setter
|
||||
def apulse(self, value):
|
||||
ut.set_using_dict(self.setAnalogPulsing, value)
|
||||
|
||||
@property
|
||||
@element
|
||||
def dpulse(self):
|
||||
"""[Mythen3] Enable or disable digital pulsing. """
|
||||
return self.getDigitalPulsing()
|
||||
|
||||
@dpulse.setter
|
||||
def dpulse(self, value):
|
||||
ut.set_using_dict(self.setDigitalPulsing, value)
|
||||
|
||||
|
||||
"""
|
||||
---------------------------<<<Debug>>>---------------------------
|
||||
|
@ -1290,6 +1290,46 @@ void init_det(py::module &m) {
|
||||
.def("getGainCaps",
|
||||
(Result<int>(Detector::*)(sls::Positions)) & Detector::getGainCaps,
|
||||
py::arg() = Positions{})
|
||||
.def("getPolarity",
|
||||
(Result<defs::polarity>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getPolarity,
|
||||
py::arg() = Positions{})
|
||||
.def("setPolarity",
|
||||
(void (Detector::*)(defs::polarity, sls::Positions)) &
|
||||
Detector::setPolarity,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getInterpolation",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getInterpolation,
|
||||
py::arg() = Positions{})
|
||||
.def("setInterpolation",
|
||||
(void (Detector::*)(bool, sls::Positions)) &
|
||||
Detector::setInterpolation,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getPumpProbe",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getPumpProbe,
|
||||
py::arg() = Positions{})
|
||||
.def("setPumpProbe",
|
||||
(void (Detector::*)(bool, sls::Positions)) &
|
||||
Detector::setPumpProbe,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getAnalogPulsing",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getAnalogPulsing,
|
||||
py::arg() = Positions{})
|
||||
.def("setAnalogPulsing",
|
||||
(void (Detector::*)(bool, sls::Positions)) &
|
||||
Detector::setAnalogPulsing,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getDigitalPulsing",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDigitalPulsing,
|
||||
py::arg() = Positions{})
|
||||
.def("setDigitalPulsing",
|
||||
(void (Detector::*)(bool, sls::Positions)) &
|
||||
Detector::setDigitalPulsing,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getNumberOfAnalogSamples",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getNumberOfAnalogSamples,
|
||||
|
@ -315,4 +315,9 @@ void init_enums(py::module &m) {
|
||||
.value("FIX_G2", slsDetectorDefs::gainMode::FIX_G2)
|
||||
.value("FIX_G0", slsDetectorDefs::gainMode::FIX_G0)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::polarity>(Defs, "polarity")
|
||||
.value("POSITIVE", slsDetectorDefs::polarity::POSITIVE)
|
||||
.value("NEGATIVE", slsDetectorDefs::polarity::NEGATIVE)
|
||||
.export_values();
|
||||
}
|
||||
|
Reference in New Issue
Block a user