taurus-org / taurus

Moved to https://gitlab.com/taurus-org/taurus
http://taurus-scada.org
43 stars 46 forks source link

Dynamically add widgets #1045

Closed felocru closed 4 years ago

felocru commented 4 years ago

Hi, I hope someone can guide me. I am adding attributes dynamically with PyTango's add_attributes method. I would like to know what is the best approach to visualize these attributes in Tauros. I am currently thinking of executing the command that adds the attributes before initializing the taurus application. I thought that through the TaurusCommandButton button to execute the command, but doing so will not make the new attributes displayed in the GUI. I have found the TaurusBaseModel.refresh andTangoDevInfo.refreshAttributes methods but I don't know if these will help me refresh the GUI to visualize the new attributes. Thanks for your help.

cmft commented 4 years ago

Hi @felocru , Which kind of taurus widget are you using?
Some ideas:

Hope this help you

reszelaz commented 4 years ago

Just an idea on how to improve the taurus device widget or a TaurusDevice core object... If I'm not mistaken in Tango 9 there is an event mechanism for this kind of interface changes. I have never tried it but I think that this example should be useful. So, basically whenever the interface is changing the widget could automatically add/remove the corresponding attribute/commands sub-widgets.

felocru commented 4 years ago

Thank you very much for giving me some ideas. I had my doubts if this feature was available. But now I have it clearer. I will do some tests and add my comments. Regards.