Skip to content

Commit

Permalink
notificaiton fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypinkard committed Apr 10, 2024
1 parent 5f3c5c2 commit 94c3c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pycromanager/acquisition/acq_eng_py/internal/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions pycromanager/acquisition/acq_eng_py/main/acq_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 94c3c4c

Please sign in to comment.