Commit b51774c4 authored by Jerome Carnis's avatar Jerome Carnis 🦊
Browse files

deviceEigerP11.py: add some types

parent 2bf96bc2
Pipeline #28443 passed with stages
in 9 minutes and 23 seconds
......@@ -154,7 +154,7 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(["EigerStream", "ImageAppendix", VALUE], path)
@expose_method({"Name": "FilePrefix", "Exposure": "FrameTime", "Frames": "Nimages"})
def acquire_frame(self, Name, Exposure, Frames) -> None:
def acquire_frame(self, Name: str, Exposure: str, Frames: str) -> None:
nb_frames = int(self.to_device_unit("Nimages", Frames).m)
self._config_interface(
saving_directory="shotDir", prefix=Name, nb_frames=nb_frames
......@@ -174,7 +174,7 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_value(ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + nb_frames)
@expose_method({"Exposure": "FrameTime"})
def live_view(self, Exposure) -> None:
def live_view(self, Exposure: str) -> None:
"""
Live view of the Eiger detector.
......@@ -232,7 +232,12 @@ class EigerTrigger(Device):
is used.
"""
def __init__(self, detector, device_id=None, config=None) -> None:
def __init__(
self,
detector: DeviceTangoEigerDetector,
device_id: Optional[str] = None,
config: Optional[Dict[Tuple[str, str], Any]] = None,
) -> None:
self.detector = detector
Device.__init__(self, device_id, config)
self.connect()
......@@ -273,7 +278,7 @@ class EigerTrigger(Device):
)
@expose_method({"Exposure": ATTR_TRIGGER_PULSE_WIDTH, "Frames": ATTR_TRIGGERS_SP})
def acquire_frame(self, Exposure, Frames) -> None:
def acquire_frame(self, Exposure: str, Frames: str) -> None:
nb_frames = self.to_device_unit(ATTR_TRIGGERS_SP, Frames).m
exposure_time = self.to_device_unit(ATTR_TRIGGER_PULSE_WIDTH, Exposure).m
self.set_value(ATTR_TRIGGERS_SP, nb_frames)
......@@ -315,7 +320,7 @@ class EigerScanner(DeviceScanner):
self,
detector: DeviceTangoEigerDetector,
device_id: Optional[str] = None,
config: Optional[Dict[str, Any]] = None,
config: Optional[Dict[Tuple[str, str], Any]] = None,
) -> None:
self.detector = detector
DeviceScanner.__init__(self, device_id, config)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment