Skip to content

Commit

Permalink
Replace collect while completing with the error catching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
abbiemery committed May 22, 2024
1 parent 8fc16ee commit 4a862af
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/ophyd_async/plan_stubs/fly.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List

import bluesky.plan_stubs as bps
from bluesky.utils import short_uid

from ophyd_async.core.detector import DetectorTrigger, StandardDetector, TriggerInfo
from ophyd_async.core.flyer import HardwareTriggeredFlyable
Expand Down Expand Up @@ -47,9 +48,22 @@ def time_resolved_fly_and_collect_with_static_seq_table(
yield from bps.kickoff_all(flyer, *detectors)

# collect_while_completing
yield from bps.collect_while_completing(
[flyer], detectors, flush_period=0.5, stream_name=stream_name
)
group = short_uid(label="complete")
yield from bps.complete_all(*detectors, flyer, group=group, wait=False)
done = False
while not done:
try:
yield from bps.wait(group=group, timeout=0.5)
except TimeoutError:
pass
else:
done = True
yield from bps.collect(
*detectors,
return_payload=False,
name=stream_name,
)
yield from bps.wait(group=group)


def prepare_static_seq_table_flyer_and_detectors_with_same_trigger(
Expand Down

0 comments on commit 4a862af

Please sign in to comment.