Forwarded + Dynamic attributes proposal

Hi,

Using tag "9.2.2" of github cppTango I noticed that tango doesn't seem to properly manage the creation of forwarded attributes when they are dynamically created. In my opinion, there are 3 different scenarios in which forwarded attributes can be created:

1.- Static creation. This is what pogo does, for example. This seems to already be properly managed.
2.- Dynamic creation with root_attribute specified in constructor. In this case the root attribute used will be the one passed in the constructor (tango DB value, if defined, should be always ignored).
3.- Dynamic creation without root_attribute specified in constructor. In this case the root attribute will be the one defined in tango DB.

In cases 2 and 3 if root attribute is not correctly defined then the device will got to Alarm state and status will give a clue of what is wrong: all dynamic attributes will be created, but the ones with incorrect root attribute definition will throw an exception when read or writen.

You can easily test the all above options using the attached TestFwd device server (gziped in "TestFwd.tgz"). You will have to play with their root attribute definition (for example using jive) in order to reproduce all cases mentioned above. If assusmes that "sys/tg_test/1/double_scalar" is available. It defines 3 forwarded attributes:
- TestFwdAttr: this is a static attribute defined using pogo (it can be used for testing case 1 above).
- TestFwdDyn1: this is a dynamic attribute with root attribute defined in the constructor (it can be used for testing case 2 above).
- TestFwdDyn2: this is a dynamic attribute with root attribute not defined in the constructor (it can be used for testing case 3 above).

The attached patch "fwd.patch" seems to work fine in my case. I propose to include it into tango master or use it as a first approach for developing a better patch (I'm far from a tango core expert, so I may have introduced other bugs while trying to solve this issue). If you find it useful I can make a pull request directly in github. Note that it also fixes a bug I found when the dynamic forwarded attributes are created (this is the patch for "multiattribute.cpp"): it looks like the write value is not correctly initialized and you can randomly get a coredump when reading them (you may need to restart the server several times to get the error).

Regards,
Jairo
Hi Jairo,

Could you please create a pull request with your changes? This is now the way to contribute proposals.

Thank you in advance.

Best regards,
Hi,

Sorry for taking sooo long, but finally I made a pull request on cppTango. See:
https://github.com/tango-controls/cppTango/pull/342
Edited 7 years ago
 
Register or login to create to post a reply.