fastcs.transports.tango.util#

Members

cast_from_tango_type

Casts a value from tango to FastCS datatype.

cast_to_tango_type

Casts a value from FastCS to tango datatype.

get_server_metadata_from_attribute

Gets the metadata for a Tango field from an attribute.

get_server_metadata_from_datatype

Gets the metadata for a Tango field from a FastCS datatype.

tango_dev_class_name

Map a controller id to a valid Python class name for a Tango device class.

tango_dev_name

Build the three-segment Tango device name for a controller.

validate_tango_id

Reject controller ids that wouldn't be safe in a Tango device-name segment.

fastcs.transports.tango.util.validate_tango_id(id: str) None[source]#

Reject controller ids that wouldn’t be safe in a Tango device-name segment.

fastcs.transports.tango.util.tango_dev_class_name(id: str) str[source]#

Map a controller id to a valid Python class name for a Tango device class.

Hyphens are replaced with underscores; a leading digit is prefixed with X. Assumes id has already been accepted by validate_tango_id.

fastcs.transports.tango.util.tango_dev_name(id: str, dsr_instance: str) str[source]#

Build the three-segment Tango device name for a controller.

The id forms the leading segment, followed by the per-id Tango device class and the DSR instance name. Assumes id has been accepted by validate_tango_id.

fastcs.transports.tango.util.get_server_metadata_from_attribute(attribute: Attribute[int | float | bool | str | Enum | ndarray, AttributeIORef]) dict[str, Any][source]#

Gets the metadata for a Tango field from an attribute.

fastcs.transports.tango.util.get_server_metadata_from_datatype(datatype: DataType[int | float | bool | str | Enum | ndarray]) dict[str, str][source]#

Gets the metadata for a Tango field from a FastCS datatype.

fastcs.transports.tango.util.cast_to_tango_type(datatype: DataType[DType_T], value: DType_T) object[source]#

Casts a value from FastCS to tango datatype.

fastcs.transports.tango.util.cast_from_tango_type(datatype: DataType[DType_T], value: object) DType_T[source]#

Casts a value from tango to FastCS datatype.