taurus-org / taurus

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

Configure taurus tpg trends in config.xml with multiple models #1143

Open gjover opened 3 years ago

gjover commented 3 years ago

I can not create a PanelDescription of a TaurusTrend with multiple models. Taurus trend set model need a list of models, not an string with all the models.

One solution would be to create the element to define the elements in the PanelDescrition and parse the list of elements for the setModel

cpascual commented 3 years ago

Just to clarify: this affects the trends implemented in taurus_pyqtgraph (I edited the title accordingly).

The old qwt5-based TaurusTrends' setModel() accepted strings encoding multiple whitespace-separated model names. This is a feature that we intentionally left out in the new trends because it limited the use of spaces in models. Therefore, the new implementation requires explicitly passing a list of models for more than one model.

As @gjover suggests, a possible solution is to allow enconding a list of models in the xml... but I do not see any way for providing full backwards compatibility (other than providing a configurable switch to optionally enable old xml format parsing)

cpascual commented 3 years ago

Note that the current workaround is to implement the given panel description in the config.py instead of the config.xml