Utilily Functions
Shared methods in package.
- class SubscriptionEvent(name, node, value, source_timestamp, server_timestamp, data)[source]
Convert the event to a dataclass for better ergonomics.
- __init__(name, node, value, source_timestamp, server_timestamp, data)
- are_points_within_dish_limits(points)[source]
Check if the given points are within the dishes limits.
- Return type:
bool
- convert_opcua_type_to_python_type(opcua_type)[source]
Get the python data type for the given opcua type.
- Return type:
type
- generate_component_state_key_from_opcua_path(opcua_node_path)[source]
Generate a component state key.
- Parameters:
opcua_node_path (Node) – OPCUA Node
- Returns:
generated key
- Return type:
str
- generate_component_state_key_from_tango_attr(tango_name)[source]
Generate a component state key.
- Parameters:
tango_name (str) – Tango attribute name
- Returns:
generated key
- Return type:
str
- generate_tango_name_from_opcua_path(opcua_node_path)[source]
Generate a tango attribute name.
- Parameters:
opcua_node_path (Node) – OPCUA Node
- Returns:
generated name
- Return type:
str
- get_attribute_data_type_as_python_type(scu, opcua_node_path)[source]
Get the python data type for an opcua attribute.
- Return type:
Optional[type]
- get_immutable_user_id(tango_trl, logger=None)[source]
Get the unique ID which is used for taking and retaking authority from the DSC.
Input of the form trl=”mid-dish/ds-manager/SKA001” Output has pattern LMC-SKA001-obfuscated(trl)
- Return type:
str
- get_tai_timestamp_from_datetime(datetime_obj)[source]
Convert a datetime object into a TAI timestamp.
- Return type:
float
- get_tai_timestamp_from_unix_s(unix_s)[source]
Calculate atomic time in seconds from unix time in seconds.
- Parameters:
unix_s (
float) – Unix time in seconds- Return type:
float- Returns:
atomic time (tai) in seconds