dodal.common.beamlines.beamline_utils#
Functions
|
|
|
|
|
Method to allow generic creation of singleton devices. |
|
|
|
|
|
|
|
|
- dodal.common.beamlines.beamline_utils.set_beamline(beamline: str)[source]#
- Parameters:
beamline (
str
)
- dodal.common.beamlines.beamline_utils.active_device_is_same_type(active_device: Device | Device, device: Callable[[...], Device | Device]) bool [source]#
- dodal.common.beamlines.beamline_utils.wait_for_connection(device: Device | Device, timeout: float = DEFAULT_CONNECTION_TIMEOUT, mock: bool = False) None [source]#
- dodal.common.beamlines.beamline_utils.device_instantiation(device_factory: Callable[[...], T], name: str, prefix: str, wait: bool, fake: bool, post_create: Callable[[T], None] | None = None, bl_prefix: bool = True, **kwargs) T [source]#
Method to allow generic creation of singleton devices. Meant to be used to easily define lists of devices in beamline files. Additional keyword arguments are passed directly to the device constructor.
- Parameters:
device_factory (
Callable
[...
,TypeVar
(T
, bound=Device
|Device
)]) – Callable the device classname (
str
) – str the name for ophydprefix (
str
) – str the PV prefix for the most (usually all) componentswait (
bool
) – bool whether to run .wait_for_connection()fake (
bool
) – bool whether to fake with ophyd.simpost_create (
Optional
[Callable
[[TypeVar
(T
, bound=Device
|Device
)],None
]], default:None
) – Callable (optional) a function to be run on the device after creationbl_prefix (
bool
, default:True
) – bool if true, add the beamline prefix when instantiating, if false the complete PV prefix must be supplied.
- Return type:
TypeVar
(T
, bound=Device
|Device
)- Returns:
The instance of the device.
- dodal.common.beamlines.beamline_utils.set_directory_provider(provider: UpdatingDirectoryProvider)[source]#
- Parameters:
provider (
UpdatingDirectoryProvider
)
- dodal.common.beamlines.beamline_utils.get_directory_provider() UpdatingDirectoryProvider [source]#
- Return type: