ophyd_async.plan_stubs#

Plan stubs for connecting, setting up and flying devices.

Package Contents#

Functions#

ensure_connected

Plan stub to ensure devices are connected with a given timeout.

setup_ndattributes

setup_ndstats_sum

Set up nd stats sum nd attribute for a detector.

apply_panda_settings

Apply given settings to a panda device.

apply_settings

Set every SignalRW to the given value in Settings. If value is None ignore it.

apply_settings_if_different

Set every SignalRW in settings, only if it is different to the current value.

get_current_settings

Get current settings on Device.

retrieve_settings

Retrieve named Settings for a Device from a provider.

store_settings

Walk a Device for SignalRWs and store their values.

API#

ophyd_async.plan_stubs.ensure_connected(*devices: Device, mock: bool | LazyMock = False, timeout: float = DEFAULT_TIMEOUT, force_reconnect=False)[source]#

Plan stub to ensure devices are connected with a given timeout.

ophyd_async.plan_stubs.setup_ndattributes(device: NDArrayBaseIO, ndattributes: Sequence[NDAttributeParam | NDAttributePv])[source]#
ophyd_async.plan_stubs.setup_ndstats_sum(detector: AreaDetector)[source]#

Set up nd stats sum nd attribute for a detector.

ophyd_async.plan_stubs.apply_panda_settings(settings: Settings[HDFPanda]) MsgGenerator[None][source]#

Apply given settings to a panda device.

ophyd_async.plan_stubs.apply_settings(settings: Settings) MsgGenerator[None][source]#

Set every SignalRW to the given value in Settings. If value is None ignore it.

ophyd_async.plan_stubs.apply_settings_if_different(settings: Settings, apply_plan: Callable[[Settings], MsgGenerator[None]], current_settings: Settings | None = None) MsgGenerator[None][source]#

Set every SignalRW in settings, only if it is different to the current value.

Parameters:
  • apply_plan – A device specific plan which takes the Settings to apply and applies them to the Device. Used to add device specific ordering to setting the signals.

  • current_settings – If given, should be a superset of settings containing the current value of the Settings in the Device. If not given it will be created by reading just the signals given in settings.

ophyd_async.plan_stubs.get_current_settings(device: Device, only_config: bool = False) MsgGenerator[Settings][source]#

Get current settings on Device.

If only_config is True, get current configuration settings on Configurable.

ophyd_async.plan_stubs.retrieve_settings(provider: SettingsProvider, name: str, device: Device, only_config: bool = False) MsgGenerator[Settings][source]#

Retrieve named Settings for a Device from a provider.

If only_config is True, retrieve only configuration settings on Configurable.

Parameters:
  • provider – The provider to retrieve the settings from.

  • name – The name of the settings to retrieve.

  • device – The Device to retrieve the settings for.

  • only_config – If True, retrieve only configuration settings.

ophyd_async.plan_stubs.store_settings(provider: SettingsProvider, name: str, device: Device, only_config: bool = False) MsgGenerator[None][source]#

Walk a Device for SignalRWs and store their values.

If only_config is True, store only configuration settings on Configurable.

Parameters:
  • provider – The provider to store the settings with.

  • name – The name to store the settings under.

  • device – The Device to walk for SignalRWs.

  • only_config – If True, store only configuration settings.