mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
Revert "J9compdisable"
This commit is contained in:
@ -156,28 +156,4 @@ def test_period(virtual_jf_detectors):
|
||||
d.period = t
|
||||
assert d.period == 10e-6
|
||||
|
||||
def test_gainmode(virtual_jf_detectors):
|
||||
d = ExperimentalDetector()
|
||||
assert d.gainMode == gainMode.NORMAL_GAIN_MODE
|
||||
|
||||
gain_list = [
|
||||
gainMode.NORMAL_GAIN_MODE,
|
||||
gainMode.FORCE_SWITCH_G1,
|
||||
gainMode.FORCE_SWITCH_G2,
|
||||
]
|
||||
|
||||
# Set all viable gain for Jungfrau to make sure nothing is crashing
|
||||
for gain in gain_list:
|
||||
d.gainMode = gain
|
||||
assert d.gainMode == gain
|
||||
|
||||
d.setGainMode(gainMode.FORCE_SWITCH_G1, [1])
|
||||
assert d.gainMode == [
|
||||
gainMode.NORMAL_GAIN_MODE,
|
||||
gainMode.FORCE_SWITCH_G1,
|
||||
gainMode.FORCE_SWITCH_G2,
|
||||
]
|
||||
|
||||
d.gainMode = gainMode.FORCE_SWITCH_G1
|
||||
assert d.gainMode == gainMode.FORCE_SWITCH_G1
|
||||
|
||||
|
@ -2165,26 +2165,6 @@ class Detector(CppDetectorApi):
|
||||
def selinterface(self, i):
|
||||
ut.set_using_dict(self.selectUDPInterface, i)
|
||||
|
||||
@property
|
||||
def gainmodelist(self):
|
||||
"""List of gainmode implemented for this detector."""
|
||||
return self.getGainModeList()
|
||||
|
||||
@property
|
||||
def gainmode(self):
|
||||
"""
|
||||
[Jungfrau] Detector gain mode. Enum: gainMode
|
||||
Note
|
||||
-----
|
||||
|
||||
[Jungfrau] NORMAL_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2
|
||||
"""
|
||||
return element_if_equal(self.getGainMode())
|
||||
|
||||
@gainmode.setter
|
||||
def gainmode(self, value):
|
||||
self.setGainMode(value)
|
||||
|
||||
"""
|
||||
---------------------------<<<Gotthard2 specific>>>---------------------------
|
||||
"""
|
||||
|
@ -1,20 +1,17 @@
|
||||
"""
|
||||
Automatically improt all enums from slsDetectorDefs and give an
|
||||
alias with their name in the enum module. All names from the enum
|
||||
module is later imported into slsdet
|
||||
|
||||
Example: detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||
Usage can later be:
|
||||
|
||||
from slsdet import detectorType
|
||||
if dt === detectorType.EIGER:
|
||||
#do something
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import _slsdet
|
||||
for name, cls in _slsdet.slsDetectorDefs.__dict__.items():
|
||||
if isinstance(cls, type):
|
||||
exec(f'{name} = {cls.__module__}.{cls.__qualname__}')
|
||||
|
||||
runStatus = _slsdet.slsDetectorDefs.runStatus
|
||||
speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
||||
detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||
frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
||||
fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
||||
dimension = _slsdet.slsDetectorDefs.dimension
|
||||
externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
||||
timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||
burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
||||
M3_GainCaps = _slsdet.slsDetectorDefs.M3_GainCaps
|
@ -1002,17 +1002,6 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(sls::ns, sls::Positions)) &
|
||||
Detector::setStorageCellDelay,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getGainModeList",
|
||||
(std::vector<defs::gainMode>(Detector::*)() const) &
|
||||
Detector::getGainModeList)
|
||||
.def("getGainMode",
|
||||
(Result<defs::gainMode>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getGainMode,
|
||||
py::arg() = Positions{})
|
||||
.def("setGainMode",
|
||||
(void (Detector::*)(defs::gainMode, sls::Positions)) &
|
||||
Detector::setGainMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getROI",
|
||||
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getROI,
|
||||
|
@ -305,10 +305,4 @@ void init_enums(py::module &m) {
|
||||
.value("DEFAULT_ALGORITHM",
|
||||
slsDetectorDefs::vetoAlgorithm::DEFAULT_ALGORITHM)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::gainMode>(Defs, "gainMode")
|
||||
.value("NORMAL_GAIN_MODE", slsDetectorDefs::gainMode::NORMAL_GAIN_MODE)
|
||||
.value("FORCE_SWITCH_G1", slsDetectorDefs::gainMode::FORCE_SWITCH_G1)
|
||||
.value("FORCE_SWITCH_G2", slsDetectorDefs::gainMode::FORCE_SWITCH_G2)
|
||||
.export_values();
|
||||
}
|
||||
|
Reference in New Issue
Block a user