-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move i22 generic plans (but do not expose to BlueAPI)
- Loading branch information
1 parent
7afeb2b
commit ced4b8f
Showing
3 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import bluesky.plan_stubs as bps | ||
from bluesky.protocols import Flyable | ||
|
||
from dls_bluesky_core.core import MsgGenerator, group_uuid | ||
|
||
|
||
def fly_and_collect( | ||
flyer: Flyable, flush_period: float = 0.5, checkpoint_every_collect: bool = False | ||
) -> MsgGenerator: | ||
yield from bps.kickoff(flyer) | ||
complete_group = group_uuid("complete") | ||
yield from bps.complete(flyer, group=complete_group) | ||
done = False | ||
while not done: | ||
try: | ||
yield from bps.wait(group=complete_group, timeout=flush_period) | ||
except TimeoutError: | ||
pass | ||
else: | ||
done = True | ||
yield from bps.collect(flyer, stream=True, return_payload=False) | ||
if checkpoint_every_collect: | ||
yield from bps.checkpoint() |