From 629e764b2c1e5cc7418b1c9c81edae0e93355297 Mon Sep 17 00:00:00 2001 From: Joseph Ware <53935796+DiamondJoseph@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:10:48 +0000 Subject: [PATCH] Prevent issues with writing data with software scans (#685) --- src/ophyd_async/epics/adcore/_hdf_writer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ophyd_async/epics/adcore/_hdf_writer.py b/src/ophyd_async/epics/adcore/_hdf_writer.py index c33be0f8f5..fc7d1ca3fe 100644 --- a/src/ophyd_async/epics/adcore/_hdf_writer.py +++ b/src/ophyd_async/epics/adcore/_hdf_writer.py @@ -20,7 +20,7 @@ wait_for_value, ) -from ._core_io import NDArrayBaseIO, NDFileHDFIO +from ._core_io import Callback, NDArrayBaseIO, NDFileHDFIO from ._utils import ( FileWriteMode, convert_param_dtype_to_np, @@ -71,6 +71,7 @@ async def open(self, multiplier: int = 1) -> dict[str, DataKey]: # Never use custom xml layout file but use the one defined # in the source code file NDFileHDF5LayoutXML.cpp self.hdf.xml_file_name.set(""), + self.hdf.enable_callbacks.set(Callback.ENABLE), ) assert ( @@ -80,7 +81,9 @@ async def open(self, multiplier: int = 1) -> dict[str, DataKey]: # Overwrite num_capture to go forever await self.hdf.num_capture.set(0) # Wait for it to start, stashing the status that tells us when it finishes - self._capture_status = await set_and_wait_for_value(self.hdf.capture, True) + self._capture_status = await set_and_wait_for_value( + self.hdf.capture, True, wait_for_set_completion=False + ) name = self._name_provider() detector_shape = await self._dataset_describer.shape() np_dtype = await self._dataset_describer.np_datatype()