TMC Common Tango Group Client¶
Tango Group Client Code
-
class
ska_tmc_common.tango_group_client.TangoGroupClient(group_name, logger: Optional[<Mock id='139854315562128'>] = None)¶ Class for TangoGroupClient API
-
get_tango_group(group_name) → tango.Group¶ Creates a Tango Group with given name
- :param
group_name: Tango group
- :return
None
-
add_device(device_to_add: str)¶ Add device element in the Group.
- Parameters
device_to_add – string. Device FQDN to add in the group
- :return
None
-
remove_device(device_to_remove: str)¶ Removes specified elements in the device_to_remove from the Group.
- Parameters
device_to_remove – string.
FQDN of the device to be removed from group.
- :return
None
- :throws
DevFailed on failure in removing the device from the group.
-
delete_group(group_to_delete)¶ Deletes the Tango Group. :param group_to_delete: Tango group to delete.
-
get_group_device_list(forward=True)¶ Returns the list of devices in the group
- Parameters
forward – Value
- :return
list. The list of devices
- :throws
DevFailed on failure in getting group device list.
-
remove_all_device()¶ Removes all the devices from the group.
-
send_command(command_name, command_data=None)¶ Invokes command on the Tango group synchronously.
- :param
command_name: string. Name of the command to be invoked
- :param
command_data: (optional) Void. The arguments with the command.
- :return
Sequence of tango.GroupCmdReply objects.
- :throws
DevFailed on failure in executing the command.
-
send_command_async(command_name, command_data=None, callback_method=None)¶ Invokes command on the Tango group asynchronously.
- Parameters
command_name – string.
Name of the command to be invoked
- Parameters
command_data – (optional) Void.
The arguments with the command.
- Parameters
callback_method – The callback method that
should be executed upon execution
- :return
int. Request id returned by tango group. Pass this id to get_command_reply to retrieve the reply of the command.
- :throws
DevFailed on failure in executing the command.
-
get_command_reply(command_id, timeout=0)¶ Retrieves the response of the command
- Parameters
command_id – int.
It is a request identifier previously returned by one of the
:param command_inout_asynch methods.
- :param
timeout: (optional) int. Timeout in milliseconds. If no timeout is mentioned, the API waits indefinitely.
- :return
The results of an asynchronous command as tango.
GroupCmdReply object.
- :throws
DevFailed on failure in executing the command.
-