perf(std_daq): only reset backend if status is not idle

This commit is contained in:
gac-x02da
2025-06-16 20:26:09 +02:00
parent ae85d179f5
commit b098109880

View File

@@ -367,10 +367,13 @@ class PcoEdge5M(PSIDeviceBase, PcoEdgeBase):
"""Stop the camera acquisition and set it to idle state"""
self.set_idle().wait()
status = DeviceStatus(self)
self.backend.add_status_callback(
status, success=[StdDaqStatus.IDLE], error=[StdDaqStatus.REJECTED, StdDaqStatus.ERROR]
)
self.backend.stop()
if self.backend.status != StdDaqStatus.IDLE:
self.backend.add_status_callback(
status, success=[StdDaqStatus.IDLE], error=[StdDaqStatus.REJECTED, StdDaqStatus.ERROR]
)
self.backend.stop()
else:
status.set_finished()
return status
@property
@@ -526,6 +529,7 @@ class PcoEdge5M(PSIDeviceBase, PcoEdgeBase):
successful=True,
hinted_location={"data": "data"},
)
logger.info(f"Finished writing to {self.target_file}")
status = self.acq_done()
status.add_callback(_create_dataset)