kasemir / org.csstudio.display.builder

Update of org.csstudio.opibuilder.*
Eclipse Public License 1.0
2 stars 10 forks source link

Image widget's "color map" rule, generates invalid script #515

Closed MaticPogacnik closed 5 years ago

MaticPogacnik commented 5 years ago

Rule for Image widget to change color map generates invalid script:

` from org.csstudio.display.builder.runtime.script import PVUtil

if true: widget.setPropertyValue('color_map', "GRAY")

else: widget.setPropertyValue('color_map', "GRAY") `

Which is not working as setPropertyValue is expecting ColorMap object as second parameter not string. Workaround for now is custom script, which use predefined PredefinedColorMaps class.

kasemir commented 5 years ago

Yes, sorry. As shown in the plots_image.bob and scripts/select_colormap.py example, one needs to use a script because the color map could be one of the predefined ones, or a custom one. Too hard to handle all that in a rule.