-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce5d585
commit 1ee4b02
Showing
5 changed files
with
106 additions
and
11 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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
from .ensure_connected import ensure_connected | ||
from .prepare_trigger_and_dets import ( | ||
prepare_static_seq_table_flyer_and_detectors_with_same_trigger, | ||
) | ||
|
||
__all__ = ["prepare_static_seq_table_flyer_and_detectors_with_same_trigger"] | ||
__all__ = [ | ||
"prepare_static_seq_table_flyer_and_detectors_with_same_trigger", | ||
"ensure_connected", | ||
] |
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,22 @@ | ||
import bluesky.plan_stubs as bps | ||
|
||
from ophyd_async.core.device import Device | ||
from ophyd_async.core.utils import DEFAULT_TIMEOUT, wait_for_connection | ||
|
||
|
||
def ensure_connected( | ||
*devices: Device, | ||
sim: bool = False, | ||
timeout: float = DEFAULT_TIMEOUT, | ||
force_reconnect=False, | ||
): | ||
yield from bps.wait_for( | ||
[ | ||
lambda: wait_for_connection( | ||
**{ | ||
device.name: device.connect(sim, timeout, force_reconnect) | ||
for device in devices | ||
} | ||
) | ||
] | ||
) |
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