@@ -104,9 +104,66 @@ Example
104104</display>
105105```
106106
107+ ## Phoebus Version Support
108+
109+ In some cases, the XML definitions for a widget can differ between CS Studio Phoebus versions. With phoebusgen 3.0.0 and above,
110+ versioning is supported via several methods.
111+
112+ phoebusgen will default to use the latest Phoebus released version. At this time for example:
113+
114+ ``` python
115+ >> > import phoebusgen
116+ >> > phoebusgen.phoebus_version
117+ ' 4.7.3'
118+ >> > phoebusgen.widget_versions
119+ {' arc' : ' 2.0.0' , ' ellipse' : ' 2.0.0' , ' label' : ' 2.0.0' , ' picture' : ' 2.0.0' , ' polygon' : ' 2.0.0' , ' polyline' : ' 2.0.0' ,
120+ ' rectangle' : ' 2.0.0' , ' byte_monitor' : ' 2.0.0' , ' led' : ' 2.0.0' , ' multi_state_led' : ' 2.0.0' , ' meter' : ' 3.0.0' ,
121+ ' progressbar' : ' 2.0.0' , ' symbol' : ' 2.0.0' , ' table' : ' 2.0.0' , ' tank' : ' 2.0.0' , ' text-symbol' : ' 2.0.0' ,
122+ ' textupdate' : ' 2.0.0' , ' thermometer' : ' 2.0.0' , ' action_button' : ' 2.0.0' , ' bool_button' : ' 2.0.0' , ' checkbox' : ' 2.0.0' ,
123+ ' choice' : ' 2.0.0' , ' combo' : ' 2.0.0' , ' fileselector' : ' 2.0.0' , ' radio' : ' 2.0.0' , ' scaledslider' : ' 2.0.0' ,
124+ ' scrollbar' : ' 2.0.0' , ' slide_button' : ' 2.0.0' , ' spinner' : ' 2.0.0' , ' textentry' : ' 2.0.0' , ' thumbwheel' : ' 2.0.0' ,
125+ ' databrowser' : ' 2.0.0' , ' image' : ' 2.0.0' , ' stripchart' : ' 2.1.0' , ' xyplot' : ' 3.0.0' , ' array' : ' 2.0.0' , ' tabs' : ' 2.0.0' ,
126+ ' embedded' : ' 2.0.0' , ' group' : ' 3.0.0' , ' navtabs' : ' 2.0.0' , ' template' : ' 2.0.0' , ' 3dviewer' : ' 2.0.0' ,
127+ ' webbrowser' : ' 2.0.0' }
128+ ```
129+
130+ Here are several ways to change the widget versioning:
131+
132+ - Call the change_phoebus_version method. Currently version 4.7, 4.7.1, 4.7.2, and 4.7.3 are supported. This will update
133+ all the widget version to what they were in that specific release of phoebus.
134+ - ` phoebusgen.change_phoebus_version("4.7.2") `
135+ - Add your own version definition file (overrides any other def files in ~ /.phoebusgen)
136+ - ` ~/.phoebusgen/widgets.def `
137+ - Add your own version definition file that matches ` phoebusgen.phoebus_version `
138+ - ` ~/.phoebusgen/4.7.2_widgets.def `
139+ - Change the version on an individual widget object
140+ - ` my_group = phoebusgen.widget.Group("test", 2,2,2,2); my_group.version("2.0.0") `
141+
142+ See the available versions supported in phoebusgen here: [ config directory] ( ./phoebusgen/config )
143+
144+ ``` python
145+ >> > import phoebusgen
146+ >> > phoebusgen.phoebus_version
147+ ' 4.7.3'
148+ >> > phoebusgen.change_phoebus_version(" 4.7.2" )
149+ Phoebus version manually changed to 4.7 .2.
150+ >> > b = phoebusgen.widget.Group(" test" , 2 ,2 ,2 ,2 )
151+ >> > b
152+ < ? xml version= " 1.0" ? >
153+ < widget type = " group" version= " 2.0.0" >
154+ < name> test< / name>
155+ < x> 2 < / x>
156+ < y> 2 < / y>
157+ < width> 2 < / width>
158+ < height> 2 < / height>
159+ < / widget>
160+ >> > b.predefined_line_color(" OK" )
161+ Line color not compatible with group widget version less than 3.0 .0.
162+ ```
163+
107164## Site specific color and font definitions
108165
109- Place a custom color.def or font.def in ~ /.phoebusgen/ to force phoebusgen.colors or phoebusgen.fonts to reflect your site's custom definitions.
166+ Place a custom ` color.def ` or ` font.def ` in ` ~/.phoebusgen/ ` to force phoebusgen.colors or phoebusgen.fonts to reflect your site's custom definitions.
110167
111168``` python
112169my_widget.predefined_font(phoebusgen.fonts.Header1)
0 commit comments