diff --git a/src/ophyd_async/epics/adaravis/_aravis_controller.py b/src/ophyd_async/epics/adaravis/_aravis_controller.py index 80b826db2d..d9761771c6 100644 --- a/src/ophyd_async/epics/adaravis/_aravis_controller.py +++ b/src/ophyd_async/epics/adaravis/_aravis_controller.py @@ -30,7 +30,12 @@ def get_deadtime(self, exposure: float | None) -> float: return _HIGHEST_POSSIBLE_DEADTIME async def prepare(self, trigger_info: TriggerInfo): - if (num := trigger_info.number) == 0: + num: int = ( + sum(trigger_info.number) + if isinstance(trigger_info.number, list) + else trigger_info.number + ) + if num == 0: image_mode = adcore.ImageMode.continuous else: image_mode = adcore.ImageMode.multiple diff --git a/src/ophyd_async/epics/adkinetix/_kinetix_controller.py b/src/ophyd_async/epics/adkinetix/_kinetix_controller.py index acf95850ef..b77054c326 100644 --- a/src/ophyd_async/epics/adkinetix/_kinetix_controller.py +++ b/src/ophyd_async/epics/adkinetix/_kinetix_controller.py @@ -27,9 +27,14 @@ def get_deadtime(self, exposure: float | None) -> float: return 0.001 async def prepare(self, trigger_info: TriggerInfo): + frames: int = ( + sum(trigger_info.number) + if isinstance(trigger_info.number, list) + else trigger_info.number + ) await asyncio.gather( self._drv.trigger_mode.set(KINETIX_TRIGGER_MODE_MAP[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/adpilatus/_pilatus_controller.py b/src/ophyd_async/epics/adpilatus/_pilatus_controller.py index 9e8bd54aef..f1b2ae31d0 100644 --- a/src/ophyd_async/epics/adpilatus/_pilatus_controller.py +++ b/src/ophyd_async/epics/adpilatus/_pilatus_controller.py @@ -37,11 +37,14 @@ async def prepare(self, trigger_info: TriggerInfo): await adcore.set_exposure_time_and_acquire_period_if_supplied( self, self._drv, trigger_info.livetime ) + frames: int = ( + sum(trigger_info.number) + if isinstance(trigger_info.number, list) + else trigger_info.number + ) await asyncio.gather( self._drv.trigger_mode.set(self._get_trigger_mode(trigger_info.trigger)), - self._drv.num_images.set( - 999_999 if trigger_info.number == 0 else trigger_info.number - ), + self._drv.num_images.set(999_999 if frames == 0 else frames), self._drv.image_mode.set(adcore.ImageMode.multiple), ) diff --git a/src/ophyd_async/epics/adsimdetector/_sim_controller.py b/src/ophyd_async/epics/adsimdetector/_sim_controller.py index 10b8516ece..9107bffc9b 100644 --- a/src/ophyd_async/epics/adsimdetector/_sim_controller.py +++ b/src/ophyd_async/epics/adsimdetector/_sim_controller.py @@ -31,8 +31,13 @@ async def prepare(self, trigger_info: TriggerInfo): self.frame_timeout = ( DEFAULT_TIMEOUT + await self.driver.acquire_time.get_value() ) + frames: int = ( + sum(trigger_info.number) + if isinstance(trigger_info.number, list) + else trigger_info.number + ) await asyncio.gather( - self.driver.num_images.set(trigger_info.number), + self.driver.num_images.set(frames), self.driver.image_mode.set(adcore.ImageMode.multiple), ) diff --git a/src/ophyd_async/epics/advimba/_vimba_controller.py b/src/ophyd_async/epics/advimba/_vimba_controller.py index f9ce2a8d02..445306577e 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 = ( + sum(trigger_info.number) + if isinstance(trigger_info.number, list) + else 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..0ec47017e4 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 = ( + sum(trigger_info.number) + if isinstance(trigger_info.number, list) + else 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..79189db033 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,9 +30,14 @@ async def prepare(self, trigger_info: TriggerInfo): async def arm(self): assert self._trigger_info.livetime assert self.period + frames: int = ( + sum(self._trigger_info.number) + if isinstance(self._trigger_info.number, list) + else self._trigger_info.number + ) self.task = asyncio.create_task( self._coroutine_for_image_writing( - self._trigger_info.livetime, self.period, self._trigger_info.number + self._trigger_info.livetime, self.period, frames ) )