fix: fixed MIN_readout, and made it a class attribute with set/get functions
This commit is contained in:
parent
e9d9711aa7
commit
b9d0a5d869
@ -57,9 +57,9 @@ class Eiger9MSetup(CustomDetectorMixin):
|
||||
readout_time = (
|
||||
self.parent.scaninfo.readout_time
|
||||
if hasattr(self.parent.scaninfo, "readout_time")
|
||||
else self.parent.readout_time_min
|
||||
else self.parent.get_min_readout()
|
||||
)
|
||||
self.parent.readout_time = max(readout_time, self.parent.readout_time_min)
|
||||
self.parent.readout_time = max(readout_time, self.parent.get_min_readout())
|
||||
|
||||
def initialize_detector(self) -> None:
|
||||
"""Initialize detector"""
|
||||
@ -399,9 +399,12 @@ class Eiger9McSAXS(PSIDetectorBase):
|
||||
"describe",
|
||||
]
|
||||
|
||||
# specify Setup class
|
||||
custom_prepare_cls = Eiger9MSetup
|
||||
# specify minimum readout time for detector
|
||||
PSIDetectorBase.set_min_readout(3e-3)
|
||||
# specify class attributes
|
||||
cam = ADCpt(SLSDetectorCam, "cam1:")
|
||||
MIN_READOUT = 3e-3
|
||||
|
||||
def set_trigger(self, trigger_source: TriggerSource) -> None:
|
||||
"""Set trigger source for the detector.
|
||||
|
@ -125,9 +125,9 @@ class FalconSetup(CustomDetectorMixin):
|
||||
readout_time = (
|
||||
self.parent.scaninfo.readout_time
|
||||
if hasattr(self.parent.scaninfo, "readout_time")
|
||||
else self.parent.readout_time_min
|
||||
else self.parent.get_min_readout()
|
||||
)
|
||||
self.parent.readout_time = max(readout_time, self.parent.readout_time_min)
|
||||
self.parent.readout_time = max(readout_time, self.parent.get_min_readout())
|
||||
|
||||
def initialize_detector(self) -> None:
|
||||
"""
|
||||
@ -320,9 +320,12 @@ class FalconcSAXS(PSIDetectorBase):
|
||||
"describe",
|
||||
]
|
||||
|
||||
# specify Setup class
|
||||
custom_prepare_cls = FalconSetup
|
||||
MIN_READOUT = 3e-3
|
||||
# specify minimum readout time for detector
|
||||
PSIDetectorBase.set_min_readout(3e-3)
|
||||
|
||||
# specify class attributes
|
||||
dxp = Cpt(EpicsDXPFalcon, "dxp1:")
|
||||
mca = Cpt(EpicsMCARecord, "mca1")
|
||||
hdf5 = Cpt(FalconHDF5Plugins, "HDF1:")
|
||||
|
@ -86,9 +86,9 @@ class PilatusSetup(CustomDetectorMixin):
|
||||
readout_time = (
|
||||
self.parent.scaninfo.readout_time
|
||||
if hasattr(self.parent.scaninfo, "readout_time")
|
||||
else self.parent.readout_time_min
|
||||
else self.parent.get_min_readout()
|
||||
)
|
||||
self.parent.readout_time = max(readout_time, self.parent.readout_time_min)
|
||||
self.parent.readout_time = max(readout_time, self.parent.get_min_readout())
|
||||
|
||||
def initialize_detector(self) -> None:
|
||||
"""Initialize detector"""
|
||||
@ -410,9 +410,13 @@ class PilatuscSAXS(PSIDetectorBase):
|
||||
USER_ACCESS = [
|
||||
"describe",
|
||||
]
|
||||
|
||||
# specify Setup class
|
||||
custom_prepare_cls = PilatusSetup
|
||||
# specify minimum readout time for detector
|
||||
PSIDetectorBase.set_min_readout(3e-3)
|
||||
# specify class attributes
|
||||
cam = ADCpt(SLSDetectorCam, "cam1:")
|
||||
MIN_READOUT = 3e-3
|
||||
|
||||
def set_trigger(self, trigger_source: TriggerSource) -> None:
|
||||
"""Set trigger source for the detector"""
|
||||
|
@ -22,10 +22,23 @@ class DetectorInitError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
MIN_READOUT = 3e-3
|
||||
# MIN_READOUT = 3e-3
|
||||
|
||||
|
||||
class CustomDetectorMixin:
|
||||
"""
|
||||
Mixin class for custom detector logic
|
||||
|
||||
This class is used to implement BL specific logic for the detector.
|
||||
It is used in the PSIDetectorBase class.
|
||||
|
||||
For the integration of a new detector, the following functions should
|
||||
help with integrating functionality, but additional ones can be added.
|
||||
|
||||
Check PSIDetectorBase for the functions that are called during relevant function calls of
|
||||
stage, unstage, trigger, stop and _init.
|
||||
"""
|
||||
|
||||
def __init__(self, parent: Device = None, *args, **kwargs) -> None:
|
||||
self.parent = parent
|
||||
|
||||
@ -186,7 +199,15 @@ class PSIDetectorBase(Device):
|
||||
|
||||
custom_prepare_cls = CustomDetectorMixin
|
||||
|
||||
MIN_READOUT = 3e-3
|
||||
_MIN_READOUT = 1e-3
|
||||
|
||||
@classmethod
|
||||
def get_min_readout(cls):
|
||||
return cls._MIN_READOUT
|
||||
|
||||
@classmethod
|
||||
def set_min_readout(cls, value):
|
||||
cls._MIN_READOUT = value
|
||||
|
||||
# Specify which functions are revealed to the user in BEC client
|
||||
USER_ACCESS = [
|
||||
@ -229,7 +250,6 @@ class PSIDetectorBase(Device):
|
||||
self.std_client = None
|
||||
self.scaninfo = None
|
||||
self.filewriter = None
|
||||
self.readout_time_min = MIN_READOUT
|
||||
self.timeout = 5
|
||||
self.wait_for_connection(all_signals=True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user