diff --git a/devices/clients/attribute_wrapper.py b/devices/clients/attribute_wrapper.py index 73b8d203913362d3d6b4b079aaaaa285e15da23a..99312919c0631f85c64cd3aec097a00b316f12f4 100644 --- a/devices/clients/attribute_wrapper.py +++ b/devices/clients/attribute_wrapper.py @@ -14,11 +14,12 @@ class attribute_wrapper(attribute): Wraps all the attributes in a wrapper class to manage most of the redundant code behind the scenes """ - def __init__(self, comms_annotation=None, datatype=None, dims=(1,), access=AttrWriteType.READ, init_value=None, **kwargs): + def __init__(self, comms_id=None, comms_annotation=None, datatype=None, dims=(1,), access=AttrWriteType.READ, init_value=None, **kwargs): """ wraps around the tango Attribute class. Provides an easier interface for 1d or 2d arrays. Also provides a way to abstract managing the communications interface. + comms_id: user-supplied identifier that is attached to this object, to identify which communication class will need to be attached comms_annotation: data passed along to the attribute. can be given any form of data. handling is up to client implementation datatype: any numpy datatype dims: dimensions of the attribute as a tuple, or (1,) for a scalar. @@ -31,6 +32,7 @@ class attribute_wrapper(attribute): if "numpy" not in str(datatype) and datatype != str: raise TypeError("Attribute needs to be a Tango-supported numpy or str type, but has type \"%s\"" % (datatype,)) + self.comms_id = comms_id # store data that can be used to identify the comms interface to use. not used by the wrapper itself self.comms_annotation = comms_annotation # store data that can be used by the comms interface. not used by the wrapper itself self.numpy_type = datatype # tango changes our attribute to their representation (E.g numpy.int64 becomes "DevLong64")