Group

Group class

class tango.Group(name)

Bases: object

A Tango Group represents a hierarchy of tango devices. The hierarchy may have more than one level. The main goal is to group devices with same attribute(s)/command(s) to be able to do parallel requests.

add(self, subgroup, timeout_ms=-1) → None

Attaches a (sub)_RealGroup.

To remove the subgroup use the remove() method.

Parameters:
subgroup:(str)
timeout_ms:(int) If timeout_ms parameter is different from -1, the client side timeout associated to each device composing the _RealGroup added is set to timeout_ms milliseconds. If timeout_ms is -1, timeouts are not changed.
Return:

None

Throws:

TypeError, ArgumentError

command_inout(self, cmd_name, forward=True) → sequence<GroupCmdReply>

command_inout (self, cmd_name, param, forward=True) -> sequence<GroupCmdReply>

command_inout (self, cmd_name, param_list, forward=True) -> sequence<GroupCmdReply>

Just a shortcut to do:
self.command_inout_reply(self.command_inout_asynch(...))
Parameters:
cmd_name:(str) Command name
param:(any) parameter value
param_list:(tango.DeviceDataList) sequence of parameters. When given, it’s length must match the group size.
forward:(bool) If it is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices.
Return:

(sequence<GroupCmdReply>)

read_attribute(self, attr_name, forward=True) → sequence<GroupAttrReply>
Just a shortcut to do:
self.read_attribute_reply(self.read_attribute_asynch(...))
read_attributes(self, attr_names, forward=True) → sequence<GroupAttrReply>
Just a shortcut to do:
self.read_attributes_reply(self.read_attributes_asynch(...))
write_attribute(self, attr_name, value, forward=True, multi=False) → sequence<GroupReply>
Just a shortcut to do:
self.write_attribute_reply(self.write_attribute_asynch(...))

GroupReply classes

Group member functions do not return the same as their DeviceProxy counterparts, but objects that contain them. This is:

  • write attribute family returns tango.GroupReplyList
  • read attribute family returns tango.GroupAttrReplyList
  • command inout family returns tango.GroupCmdReplyList

The Group*ReplyList objects are just list-like objects containing GroupReply, GroupAttrReply and GroupCmdReply elements that will be described now.

Note also that GroupReply is the base of GroupCmdReply and GroupAttrReply.

class tango.GroupReply

This is the base class for the result of an operation on a PyTangoGroup, being it a write attribute, read attribute, or command inout operation.

It has some trivial common operations:

  • has_failed(self) -> bool
  • group_element_enabled(self) ->bool
  • dev_name(self) -> str
  • obj_name(self) -> str
  • get_err_stack(self) -> DevErrorList
class tango.GroupAttrReply
get_data(self, extract_as=ExtractAs.Numpy) → DeviceAttribute
Get the DeviceAttribute.
Parameters:
extract_as:(ExtractAs)
Return:

(DeviceAttribute) Whatever is stored there, or None.

class tango.GroupCmdReply
get_data(self) → any
Get the actual value stored in the GroupCmdRply, the command output value. It’s the same as self.get_data_raw().extract()
Parameters:None
Return:(any) Whatever is stored there, or None.