tango.pyaml.controlsystem#

Tango implementation of the pyAML control system.

TangoControlSystem resolves pyAML device references through a Catalog, prefixes Tango attribute paths with the configured Tango host and caches the resulting device access objects.

Classes

TangoControlSystem(name[, tango_host, ...])

Tango-specific implementation of a Control System.

class tango.pyaml.controlsystem.TangoControlSystem(name, tango_host=None, catalog=None, debug_level=None, lazy_devices=True, timeout_ms=3000)#

Bases: ControlSystem, DynamicValidation

Tango-specific implementation of a Control System.

Parameters:
  • name (str) – Name of the control system.

  • tango_host (str, optional) – Tango host URL (host:port). Default is None, meaning the TANGO_HOST environment variable is used by PyTango.

  • catalog (Catalog, optional) – Catalog instance used to resolve PyAML device keys. Default is None, meaning a connected TangoCatalog is created automatically (keys are resolved directly as Tango attribute paths).

  • debug_level (str or int, optional) – Debug verbosity level. Such as INFO, DEBUG, WARNING, ERROR, CRITICAL. Or 10, 20, 30, 40, 50.

  • lazy_devices (bool, optional) – Reserved for lazy device creation. Default is True.

  • timeout_ms (int, optional) – Device timeout in milliseconds. Default is 3000.

_name#

Name of the control system.

Type:

str

_tango_host#

Configured Tango host.

Type:

str or None

_catalog#

Catalog used to resolve device keys. Always set, defaulting to a connected TangoCatalog when none is supplied.

Type:

Catalog

_debug_level#

Requested log level.

Type:

str or int or None

_lazy_devices#

Lazy device creation flag.

Type:

bool

_timeout_ms#

Device timeout in milliseconds.

Type:

int

attach(devs)#

Attach a list of device accesses to this control system.

attach_array(devs)#

Attach a list of device accesses to this control system.

get_device_access(ref)#

Resolve a public device reference for this Tango control system.

name()#

Return the name of the control system.

get_tango_host()#

Return the Tango host configured for this control system.

get_aggregator()#

Return a new empty aggregator of device accesses.

scalar_aggregator()#

Return the module name used for handling aggregator of DeviceAccess.

vector_aggregator()#

Return the module name used for handling aggregator of DeviceVectorAccess.

get_catalog()#

Return the catalog that references all control system devices.

Initialize the ControlSystem.

attach(devs)#

Attach a list of device accesses to this control system.

Parameters:

devs (list of DeviceAccess) – Tango attributes to attach. None entries are preserved.

Returns:

list of DeviceAccess – Attached device accesses, in the same order as devs.

Return type:

list[DeviceAccess]

attach_array(devs)#

Attach a list of device accesses to this control system.

Parameters:

devs (list of DeviceAccess) – Tango attributes to attach. None entries are preserved.

Returns:

list of DeviceAccess – Attached device accesses, in the same order as devs.

Return type:

list[DeviceAccess]

get_aggregator()#

Return a new empty aggregator of device accesses.

If None were returned, serialized readings/writings would be performed by the pyAML core instead.

Returns:

MultiAttribute – New empty MultiAttribute.

Return type:

MultiAttribute | None

get_catalog()#

Return the catalog that references all control system devices.

Returns:

Catalog – The catalog used to resolve device keys (a default connected TangoCatalog when none was supplied at construction).

Return type:

Catalog

get_device_access(ref)#

Resolve a public device reference for this Tango control system.

YAML references are opaque strings resolved by the configured backend catalog. Public Python APIs may pass Tango backend configuration models. Already constructed DeviceAccess instances are intentionally rejected: attach() remains the internal compatibility API for those.

Parameters:

ref (str or pydantic.BaseModel or None) – Catalog key, Tango configuration model (AttributeConfig, AttributeReadOnlyConfig, AttributeListConfig or AttributeListReadOnlyConfig), or None.

Returns:

DeviceAccess or None – Attached device access, or None if ref is None.

Raises:

pyaml.PyAMLException – If ref is an already constructed DeviceAccess, if the configured catalog has an unsupported type, or if ref has an unsupported type.

Return type:

DeviceAccess | None

get_tango_host()#

Return the Tango host configured for this control system.

Returns:

str or None – Tango host URL, or None when unconfigured.

Return type:

str | None

name()#

Return the name of the control system.

Returns:

str – Name of the control system.

Return type:

str

scalar_aggregator()#

Return the module name used for handling aggregator of DeviceAccess.

Returns:

str or None – Aggregator module name. Always None for Tango.

Return type:

str | None

vector_aggregator()#

Return the module name used for handling aggregator of DeviceVectorAccess.

Returns:

str or None – Aggregator module name. Always None for Tango.

Return type:

str | None