Dynamic Attribute in CPP

Hi all,

I have written code to read file and create dynamic attribute accordingly in "init" method. But while launching device first time, it is not reflecting on atkpanel until I hit "init" command.

Meanwhile, I have printed each lines of file while reading it and it is shown on console perfectly. It means "init" method is called automatically while launching the device and file is also read. But not reflecting on atkpanel until I hit "init".

Why this is happening?

Thanks & Regards,
Pritesh
In addition to, how to assign properties to attributes that created dynamically in C++ as well as JAVA?

I shall be thankful if anyone help me out.
Thanks & Regards,
Pritesh
When adding dynamic attributes to a device class you change the device interface. atkpanel will not read the new interface automatically. Clicking on " init" forces atkpanel to build a new proxy to the device and discover the new interface.

In TANGO V9 an event is sent when the interface changes. This will enable clients like atkpanel to detect the interface change automatically.

Assigning properties to an attribute means storing them in the database. Sorry I don' t have an example of code right now to share with you.

Andy
Hi Andy,

Thank you for your guidance. I will look forward to use events as you said. Still I am confused why it is working fine in JAVA.

And for second question, I was not able to find exactly where attributes(with theirs properties) are stored in Tango database?

Thanks & Regards,
Pritesh
Hi Pritest

Can you give me a example or some info on how to realise dynamic attributes in device? i follow "HOW TO ADD DYNAMIC ATTRIBUTES TO A DEVICE CLASS"(http://www.tango-controls.org/resources/howto/how-add-dynamic-attributes-device-class/) to learn dynamic attribute, but i can't make it.

In "HOW TO ADD DYNAMIC ATTRIBUTES TO A DEVICE CLASS" these is:
Pogo generates method(s) named DynAttr::add_<Dyn attr class name>_dynamic_attribute(string att_name) which do this job for you.
But i can't find
DynAttr::add_<Dyn attr class name>_dynamic_attribute(string att_name)
in code generated by Pogo!

I use Pogo 8.4.5a on Ubuntu 14.04, what's the problem?

thanks
Edited 8 years ago
Hi Jimmy,

In add_dynamic_attribute() function, that line will be commented in POGO generated code. Using that line, you can create dynamic attributes.

Hope this will help you.

Thanks & Regards,
Pritesh
 
Register or login to create to post a reply.