From 94c3c4c0dafde679f727480f0f4e8bc4e82df1d7 Mon Sep 17 00:00:00 2001 From: Henry Pinkard <7969470+henrypinkard@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:25:26 -0700 Subject: [PATCH] notificaiton fixes --- pycromanager/acquisition/acq_eng_py/internal/engine.py | 5 +++-- pycromanager/acquisition/acq_eng_py/main/acq_notification.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pycromanager/acquisition/acq_eng_py/internal/engine.py b/pycromanager/acquisition/acq_eng_py/internal/engine.py index 8fd24205..da02f57c 100644 --- a/pycromanager/acquisition/acq_eng_py/internal/engine.py +++ b/pycromanager/acquisition/acq_eng_py/internal/engine.py @@ -385,8 +385,9 @@ def acquire_images(self, event: AcquisitionEvent, hardware_sequences_in_progress self.stop_hardware_sequences(hardware_sequences_in_progress) - event.acquisition_.post_notification(AcqNotification( - AcqNotification.Camera, event.axisPositions_, AcqNotification.Camera.POST_SEQUENCE_STOPPED)) + if event.get_sequence() is not None: + event.acquisition_.post_notification(AcqNotification( + AcqNotification.Camera, event.axisPositions_, AcqNotification.Camera.POST_SEQUENCE_STOPPED)) if timeout: raise TimeoutError("Timeout waiting for images to arrive in circular buffer") diff --git a/pycromanager/acquisition/acq_eng_py/main/acq_notification.py b/pycromanager/acquisition/acq_eng_py/main/acq_notification.py index 75adc42a..e8b77457 100644 --- a/pycromanager/acquisition/acq_eng_py/main/acq_notification.py +++ b/pycromanager/acquisition/acq_eng_py/main/acq_notification.py @@ -46,8 +46,8 @@ def __init__(self, type, payload, milestone=None): self.type = AcqNotification.Image self.payload = payload self.milestone = milestone - elif milestone in [AcqNotification.Camera.PRE_SNAP, AcqNotification.Camera.POST_EXPOSURE, - AcqNotification.Camera.PRE_SEQUENCE_STARTED]: + elif milestone in [AcqNotification.Camera.PRE_SNAP, AcqNotification.Camera.POST_SNAP, + AcqNotification.Camera.PRE_SEQUENCE_STARTED, AcqNotification.Camera.POST_SEQUENCE_STOPPED]: self.type = AcqNotification.Camera self.payload = json.loads(payload) if isinstance(payload, str) else payload # convert from '{'time': 5}' to {'time': 5} elif milestone in [AcqNotification.Hardware.PRE_HARDWARE, AcqNotification.Hardware.POST_HARDWARE]: