bec_lib.device.Device#

class Device(*, name: str, info: dict | None = None, config: dict | None = None, parent=None, signal_info: dict | None = None)[source]#

Bases: OphydInterfaceBase

Device (bluesky interface): * trigger * read * describe * stage * unstage * pause * resume

Parameters:
  • name (dict) – The name of the device.

  • info (dict, optional) – The device info dictionary. Defaults to None.

  • parent ([type], optional) – The parent object. Defaults to None.

  • signal_info (dict, optional) – The signal info dictionary. Defaults to None.

Methods

add_device_tag

add a device tag for this device

configure

Configures the device.

describe

Describes the device and yields information about the device's signals, including the signal's name, source, shape, data type, precision etc.

describe_configuration

Describes the device configuration.

get

Gets the device value.

get_device_config

get the device config for this device

get_device_tags

get the device tags for this device

put

Puts the device value.

read

Reads the device.

read_configuration

Reads the device configuration.

remove_device_tag

remove a device tag for this device

set_device_config

set the device config for this device

set_device_tags

set the device tags for this device

set_user_parameter

set the user parameter for this device

stage

Stages the device.

stop

Stops the device.

summary

Provides a summary of the device, all associated signals and their type.

trigger

Triggers the device.

unstage

Unstages the device.

update_config

Updates the device configuration.

update_user_parameter

update the user parameter for this device :param val: New user parameter :type val: dict

Attributes

enabled

Returns True if the device is enabled, otherwise False.

full_name

Returns the full name of the device.

on_failure

get the failure behaviour for this device

read_only

Whether or not the device can be set

readout_priority

get the readout priority for this device

root

Returns the root object of the device tree.

software_trigger

Whether or not the device can be software triggered

user_parameter

get the user parameter for this device

wm

get the current position of a device

add_device_tag(val: str)#

add a device tag for this device

configure(config: dict)[source]#

Configures the device.

describe()#

Describes the device and yields information about the device’s signals, including the signal’s name, source, shape, data type, precision etc.

describe_configuration()#

Describes the device configuration.

property enabled#

Returns True if the device is enabled, otherwise False.

property full_name#

Returns the full name of the device.

get(cached=True)#

Gets the device value.

get_device_config()#

get the device config for this device

get_device_tags() list#

get the device tags for this device

property on_failure: OnFailure#

get the failure behaviour for this device

put(value: Any, wait=False)#

Puts the device value. In contrast to the set method, the put method does not return a status object and does not wait for the device to settle. However, the put method can be converted into a blocking call by setting the wait argument to True, which will be equivalent to the set method + wait.

Use the put method if you want to update a value without waiting for the device to settle. Use the set method if you want to update a value and wait for the device to settle.

Parameters:
  • value (Any) – The value to put.

  • wait (bool, optional) – If True, the method waits for the device to settle. Defaults to False.

read(cached=True, use_readback=True, filter_to_hints=False)#

Reads the device.

Parameters:
  • cached (bool, optional) – If True, the cached value is returned. Defaults to True.

  • use_readback (bool, optional) – If True, the readback value is returned, otherwise the read value. Defaults to True.

  • filter_to_hints (bool, optional) – If True, the readback value is filtered to the hinted values. Defaults to False.

Returns:

The device signals.

Return type:

dict

read_configuration(cached=True)#

Reads the device configuration.

Parameters:

cached (bool, optional) – If True, the cached value is returned. Defaults to True.

property read_only#

Whether or not the device can be set

property readout_priority: ReadoutPriority#

get the readout priority for this device

remove_device_tag(val: str)#

remove a device tag for this device

property root#

Returns the root object of the device tree.

set_device_config(val: dict)#

set the device config for this device

set_device_tags(val: list)#

set the device tags for this device

set_user_parameter(val: dict)#

set the user parameter for this device

property software_trigger#

Whether or not the device can be software triggered

stage()[source]#

Stages the device. This method should normally not be called directly, but rather via the scan server.

stop()[source]#

Stops the device.

summary()[source]#

Provides a summary of the device, all associated signals and their type.

trigger(rpc_id: str)#

Triggers the device.

unstage()[source]#

Unstages the device. This method should normally not be called directly, but rather via the scan server.

update_config(update: dict) None#

Updates the device configuration.

Parameters:

update (dict) – The update dictionary.

update_user_parameter(val: dict)#

update the user parameter for this device :param val: New user parameter :type val: dict

property user_parameter: dict#

get the user parameter for this device

property wm: None#

get the current position of a device