Polling properties for dynamically created attributes are ignored
|
|
---|---|
In a device server, I create a dynamic attribute that I would like to be polled. However, despite setting the polling period in code, the attribute is not marked as polled in Jive upon creation: I need to manually check the Polled checkbox under Polling menu, and manually specify the polling interval. With the exception of polling, the attribute is created normally, and behaves as expected. Code:
I noticed that when adding a normal (non-dynamic) polled attribute in Pogo, Tango will generate effectively the same code: The only difference is that add_attribute() is not called explicitly, and that set_change_event() is called, though I don't understand why as events are not being pushed manually from the code. Still, even calling set_change_event() for my dynamic attribute doesn't change the result. Of course, Tango doesn't create the attribute inside add_dynamic_attributes(), but if I try to create the dynamic attribute in e.g. init_device(), the attribute is not created at all.Any ideas how to get this to work? |
|
|
---|---|
Hi, This is indeed a known bug which has been fixed in tango-9-lts branch but which is not yet available in an official stable release. Here is the reference to the Pull Request solving this issue: https://github.com/tango-controls/cppTango/pull/427 Kind regards, Reynald
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. |
|
|
---|---|
Reynald, thank you for your quick reply! It's good to see that a fix has been accepted. |
|
|
---|---|
For anyone interested, you can get dynamic attributes to be polled by invoking poll_attribute(atr_name, period) instead of set_polling_period(). Note, however, that there is apparently another bug related to dynamic attributes and polling that causes device restart to no longer work as described here: https://github.com/tango-controls/cppTango/issues/463. I don't know if the fix mentioned by Reynald corrects this, but so far I've not been able to find a workaround that would cause device restart to work normally. |