From e7c72bacb3be76abcf2e970232d24dd65a3c73ec Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh Date: Wed, 18 Sep 2024 13:55:48 +0000 Subject: [PATCH] initial changes --- src/ophyd_async/epics/advimba/_vimba_controller.py | 7 ++++++- src/ophyd_async/epics/eiger/_eiger_controller.py | 7 ++++++- src/ophyd_async/plan_stubs/_fly.py | 1 + .../demo/_pattern_detector/_pattern_detector_controller.py | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ophyd_async/epics/advimba/_vimba_controller.py b/src/ophyd_async/epics/advimba/_vimba_controller.py index f9ce2a8d02..7562b13396 100644 --- a/src/ophyd_async/epics/advimba/_vimba_controller.py +++ b/src/ophyd_async/epics/advimba/_vimba_controller.py @@ -34,10 +34,15 @@ def get_deadtime(self, exposure: float | None) -> float: return 0.001 async def prepare(self, trigger_info: TriggerInfo): + frames: int = 0 + if type(trigger_info.number) is list: + frames = sum(trigger_info.number) + elif type(trigger_info.number) is int: + frames = trigger_info.number await asyncio.gather( self._drv.trigger_mode.set(TRIGGER_MODE[trigger_info.trigger]), self._drv.exposure_mode.set(EXPOSE_OUT_MODE[trigger_info.trigger]), - self._drv.num_images.set(trigger_info.number), + self._drv.num_images.set(frames), self._drv.image_mode.set(adcore.ImageMode.multiple), ) if trigger_info.livetime is not None and trigger_info.trigger not in [ diff --git a/src/ophyd_async/epics/eiger/_eiger_controller.py b/src/ophyd_async/epics/eiger/_eiger_controller.py index bed28c2d49..94a9952376 100644 --- a/src/ophyd_async/epics/eiger/_eiger_controller.py +++ b/src/ophyd_async/epics/eiger/_eiger_controller.py @@ -37,11 +37,16 @@ async def set_energy(self, energy: float, tolerance: float = 0.1): await self._drv.photon_energy.set(energy) async def prepare(self, trigger_info: TriggerInfo): + frames: int = 0 + if type(trigger_info.number) is list: + frames = sum(trigger_info.number) + elif type(trigger_info.number) is int: + frames = trigger_info.number coros = [ self._drv.trigger_mode.set( EIGER_TRIGGER_MODE_MAP[trigger_info.trigger].value ), - self._drv.num_images.set(trigger_info.number), + self._drv.num_images.set(frames), ] if trigger_info.livetime is not None: coros.extend( diff --git a/src/ophyd_async/plan_stubs/_fly.py b/src/ophyd_async/plan_stubs/_fly.py index 552485b9af..972c8b73e1 100644 --- a/src/ophyd_async/plan_stubs/_fly.py +++ b/src/ophyd_async/plan_stubs/_fly.py @@ -43,6 +43,7 @@ def prepare_static_seq_table_flyer_and_detectors_with_same_trigger( shutter_time: float, repeats: int = 1, period: float = 0.0, + frame_timeout: float | None = None, ): """Prepare a hardware triggered flyable and one or more detectors. diff --git a/src/ophyd_async/sim/demo/_pattern_detector/_pattern_detector_controller.py b/src/ophyd_async/sim/demo/_pattern_detector/_pattern_detector_controller.py index 45dcddc9c0..0b7cdfef9b 100644 --- a/src/ophyd_async/sim/demo/_pattern_detector/_pattern_detector_controller.py +++ b/src/ophyd_async/sim/demo/_pattern_detector/_pattern_detector_controller.py @@ -30,6 +30,7 @@ async def prepare(self, trigger_info: TriggerInfo): async def arm(self): assert self._trigger_info.livetime assert self.period + self.task = asyncio.create_task( self._coroutine_for_image_writing( self._trigger_info.livetime, self.period, self._trigger_info.number