TMC Common Tango Group Client

Tango Group Client Code This class is now deprecated.

class ska_tmc_common.tango_group_client.TangoGroupClient(group_name, logger: ~typing.Optional[<Mock id='139757327029520'>] = None)

Class for TangoGroupClient API

get_tango_group(group_name) tango.Group

Creates a Tango Group with given name

:param

group_name: Tango group

Returns:

Tango group

add_device(device_to_add: str)

Add device element in the Group.

Parameters:

device_to_add – string. Device FQDN to add in the group

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.

: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

Returns:

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.

Parameters:
  • command_name – string. Name of the command to be invoked

  • command_data – (optional) Void. The arguments with the command.

Returns:

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

Returns:

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.

Returns:

The results of an asynchronous command as tango.

GroupCmdReply object.

:throws

DevFailed on failure in executing the command.