tango.pyaml.tango_catalog#

Catalog resolving keys that are direct Tango attribute references.

Unlike StaticCatalog, no explicit mapping is needed: the catalog key is the Tango attribute path. In connected mode the attribute configuration (unit, limits, writability, data format) is fetched from Tango to build the appropriate device access object.

Classes

TangoCatalog([disconnected])

Catalog resolving keys that are direct Tango attribute references.

class tango.pyaml.tango_catalog.TangoCatalog(disconnected=False)#

Bases: Catalog, DynamicValidation

Catalog resolving keys that are direct Tango attribute references.

Keys can be plain Tango attribute paths (domain/family/member/attribute) or indexed references into a SPECTRUM attribute (domain/family/member/attribute@index).

Parameters:

disconnected (bool, optional) – If true, resolve Tango attribute names without querying Tango. Default is False.

_WRITABLE_TYPES#

Tango write types for which a writable Attribute is built.

Type:

set of tango.AttrWriteType

_disconnected#

True when Tango is never queried.

Type:

bool

_refs#

Cache of resolved devices indexed by (id(control_system), key).

Type:

dict of (int, str) to DeviceAccess

_data_formats#

Data format of each resolved key, with the same indexing as _refs.

Type:

dict of (int, str) to tango.AttrDataFormat

resolve(key, control_system=None)#

Resolve a Tango attribute reference into a DeviceAccess.

is_disconnected()#

Tell whether the catalog works without querying Tango.

get_data_format(key, control_system=None)#

Return the Tango data format for a resolved attribute.

Notes

Resolved DeviceAccess objects are bound to one control-system context because metadata lookup depends on that control system’s Tango host.

get_data_format(key, control_system=None)#

Return the Tango data format for a resolved attribute.

Parameters:
  • key (str) – Catalog key (must have been resolved at least once, or will be resolved now).

  • control_system (object) – Tango control-system context used for Tango host handling.

Returns:

tango.AttrDataFormat – Data format reported by Tango, or FMT_UNKNOWN in disconnected mode.

Return type:

AttrDataFormat

is_disconnected()#

Tell whether the catalog works without querying Tango.

Returns:

boolTrue in disconnected mode.

Return type:

bool

resolve(key, control_system=None)#

Resolve a Tango attribute reference into a DeviceAccess.

Supports two key formats:

In connected mode (disconnected=False) indexed keys additionally verify that the Tango attribute is a SPECTRUM.

Parameters:
  • key (str) – Plain attribute path or indexed path (attribute@index).

  • control_system (object) – Tango control-system context used for Tango host handling.

Returns:

DeviceAccess – Resolved device access, cached for subsequent calls.

Raises:

pyaml.PyAMLException – If the key is malformed, the Tango call fails, or (in connected mode) an indexed key targets a non-SPECTRUM attribute.

Return type:

DeviceAccess