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
|
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,DynamicValidationTango-specific implementation of a Control System.
- Parameters:
name (str) – Name of the control system.
tango_host (str, optional) – Tango host URL (
host:port). Default isNone, meaning theTANGO_HOSTenvironment variable is used by PyTango.catalog (Catalog, optional) – Catalog instance used to resolve PyAML device keys. Default is
None, meaning a connectedTangoCatalogis 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:
- _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.
Noneentries 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.
Noneentries 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
Nonewere 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:
- 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,AttributeListConfigorAttributeListReadOnlyConfig), orNone.- Returns:
DeviceAccess or None – Attached device access, or
NoneifrefisNone.- Raises:
pyaml.PyAMLException – If
refis an already constructed DeviceAccess, if the configured catalog has an unsupported type, or ifrefhas 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
Nonewhen 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
Nonefor 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
Nonefor Tango.- Return type:
str | None