Forwarded attributes in PyTango
|
|
---|---|
Hi there, I am exploring forwarded attributes feature in PyTango 9.2.4. As per documentation, if "__root_attr" attribute property is not specified, the attribute is not created by the Tango kernel and is therefore not visible for the external world. The state of the device to which the forwarded attribute belongs to is set to ALARM (if not already FAULT) and a detailed error report is available in the device status. However, I get the following error when ran the device server (with/without the __root_att attribute property):
Please note that I tried the same with Java and it works as expected. It seems that I am missing some configuration in the python code. Is there any documentation available for the same? Sample code is attached to this post. Any inputs will be helpful. Kind regards, Jyotin |
|
|
---|---|
Hi there, With inputs from Geoff Mant, this issue has been resolved. Resolution: The server will run if one changes the forward attribute definition to: The attribute name field was missing in the Forwarded Attribute definition (server code attached in previous post).GitHub Issue: Unable to create Forwarded attributes in Python 9.2.4 #231 Kind regards, Jyotin |
|
|
---|---|
Hi Everyone, I need a bit of help in reading forwarded attributes in the code. Let's say device "A" implements forwarded attribute of the root device "B". I want to use the Forwarded Attribute value inside device A. If I use, inside device A's server code, it returns an Attribute class object as:
How to get the value of FwdAttr2 inside A class? I went through the Attribute class APIs but it doesn't provide a method to read attribute value. Source code for Device A is attached to this post for testing. One way of reading forwarded attributes in the code is by creating AttributeProxy/DeviceProxy of device "A" inside device "A" source code and reading the attribute. But to me, this seems as a TANGO anti-pattern. Can anyone please guide on this issue? Kind regards, Jyotin |
|
|
---|---|
Po As far as I know, this is actually the way. I don't think this is an anti-pattern.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |