yat4tango: issue when adding dynamic spectrum attributes
|
|
---|---|
Dear all, I write you about some issues regarding yat4tango library. I'm currently using it to dynamically add attributes to my device server (it is more flexible than the current suggested way to add dyn attributes in Tango and it seems possible also to add forwarded attributes). I've found this issue when adding spectrum attributes and then setting attribute properties. The sample code is (try-catch block not shown):
The last line produces this exception:
This has driven me nuts the whole day (think it is a bug but better ask…). The error seems in the get_properties(Tango::AttributeConfig_3 &conf) and get_properties(Tango::AttributeConfig_5 &conf) methods of the attrgetsetprop.cpp. When converting from AttributeConfig_3 to AttributeConfig_5 the max_dim_x property (which is initialized to LONG_MAX by yat for spectrum & image attrs) seems implicitly converted to int (e.g. conf.max_dim_x= -1). Hence, when conf.max_dim_x and max_dim_x are compared in the sanity check there is a mismatch. By the way the set_properties() method should not supposed to change the hard-coded properties, no? Do you have suggestions or could you in case confirm if it is a bug or not? I've temporarily fixed the issue by modifying the constructor of spectrum dyn attributes (did the same for image) from:
to: I thank you very much for your help, Simone
****************************************************************
Simone Riggi INAF, Osservatorio Astrofisico di Catania Via S. Sofia 78 95123, Catania - Italy phone: +39 095 7332 extension 282 e-mail: simone.riggi@gmail.com, sriggi@oact.inaf.it skype: simone.riggi **************************************************************** |
|
|
---|---|
Hi Simone, Reading your comments, the problem seems to be located in Tango (to be confirmed cause it's late:). Changing the ctors code sounds like a workaround. However, your mods clearly make sense. I even don't remember why I used LONG_MAX instead of the max dimensions specified in the yat4tango::DynamicAttributeInfo. I will adopt your proposal asap. Thanks for reporting. N. |
|
|
---|---|
Done! Please check out the SVN trunk. |
|
|
---|---|
At the speed of light - wow ! |
|
|
---|---|
By the way the set_properties() method should not supposed to change the hard-coded properties, no?Only part of the attribute' properties is mutable. Question is: which part of the properties set is mutable? This is certainly written somewhere in the Tango bible… |
|
|
---|---|
AndyI go to the gym. yat4Tango support is now closed till Monday |
|
|
---|---|
Many thanks for your prompt support!
****************************************************************
Simone Riggi INAF, Osservatorio Astrofisico di Catania Via S. Sofia 78 95123, Catania - Italy phone: +39 095 7332 extension 282 e-mail: simone.riggi@gmail.com, sriggi@oact.inaf.it skype: simone.riggi **************************************************************** |