TMC Common Tango Group Client

Tango Group Client Code

class tmc.common.tango_group_client.TangoGroupClient(group_name, logger)

Class for TangoGroupClient API

get_tango_group(group_name)

Creates a Tango Group with given name

add_device(device_to_add)

Add device element in the Group.

Param

device_to_add: string. Device FQDN to add in the group

Returns

None

remove_device(device_to_remove)

Removes specified elements in the device_to_remove from the Group.

Param

device_to_remove: string. FQDN of the device to be removed from group.

Returns

None

Throws

DevFailed on failure in removing the device from the group.

delete_group(group_to_delete)

Deletes the Tango Group.

get_group_device_list(forward=True)

Returns the list of devices in the group

Params

None

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.

Param

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.

Param

command_name: string. Name of the command to be invoked

command_data: (optional) Void. The arguments with the command.

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

Params

command_id: int. It is a request identifier previously returned by one of the command_inout_asynch methods.

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.