refactor: addressed comments from review; fixed docstring; add DeviceClassInitError
This commit is contained in:
parent
8a19ce1508
commit
bda859e93d
@ -38,6 +38,13 @@ class EigerTimeoutError(EigerError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class DeviceClassInitError(EigerError):
|
||||||
|
"""Raised when initiation of the device class fails,
|
||||||
|
due to missing device manager or not started in sim_mode."""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class SLSDetectorCam(Device):
|
class SLSDetectorCam(Device):
|
||||||
"""SLS Detector Camera - Eiger 9M
|
"""SLS Detector Camera - Eiger 9M
|
||||||
|
|
||||||
@ -134,7 +141,7 @@ class Eiger9McSAXS(DetectorBase):
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
if device_manager is None and not sim_mode:
|
if device_manager is None and not sim_mode:
|
||||||
raise Exception(
|
raise DeviceClassInitError(
|
||||||
f"No device manager for device: {name}, and not started sim_mode: {sim_mode}. Add DeviceManager to initialization or init with sim_mode=True"
|
f"No device manager for device: {name}, and not started sim_mode: {sim_mode}. Add DeviceManager to initialization or init with sim_mode=True"
|
||||||
)
|
)
|
||||||
self.sim_mode = sim_mode
|
self.sim_mode = sim_mode
|
||||||
|
@ -37,6 +37,13 @@ class PilatusTimeoutError(PilatusError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class DeviceClassInitError(PilatusError):
|
||||||
|
"""Raised when initiation of the device class fails,
|
||||||
|
due to missing device manager or not started in sim_mode."""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TriggerSource(enum.IntEnum):
|
class TriggerSource(enum.IntEnum):
|
||||||
INTERNAL = 0
|
INTERNAL = 0
|
||||||
EXT_ENABLE = 1
|
EXT_ENABLE = 1
|
||||||
@ -127,7 +134,7 @@ class PilatuscSAXS(DetectorBase):
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
if device_manager is None and not sim_mode:
|
if device_manager is None and not sim_mode:
|
||||||
raise Exception(
|
raise DeviceClassInitError(
|
||||||
f"No device manager for device: {name}, and not started sim_mode: {sim_mode}. Add DeviceManager to initialization or init with sim_mode=True"
|
f"No device manager for device: {name}, and not started sim_mode: {sim_mode}. Add DeviceManager to initialization or init with sim_mode=True"
|
||||||
)
|
)
|
||||||
self.sim_mode = sim_mode
|
self.sim_mode = sim_mode
|
||||||
@ -416,7 +423,11 @@ class PilatuscSAXS(DetectorBase):
|
|||||||
|
|
||||||
# TODO might be useful for base class
|
# TODO might be useful for base class
|
||||||
def pre_scan(self) -> None:
|
def pre_scan(self) -> None:
|
||||||
""" " Pre_scan gets executed right before"""
|
"""Pre_scan is an (optional) function that is executed by BEC just before the scan core
|
||||||
|
|
||||||
|
For the pilatus detector, it is used to arm the detector for the acquisition,
|
||||||
|
because the detector times out after ˜7-8seconds without seeing a trigger.
|
||||||
|
"""
|
||||||
self._arm_acquisition()
|
self._arm_acquisition()
|
||||||
|
|
||||||
def _arm_acquisition(self) -> None:
|
def _arm_acquisition(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user