Skip to content

Commit cd31bbf

Browse files
authored
Merge pull request #37 from als-epics/version_docs
Update docs for widget versioning
2 parents 9f6896d + f1116dc commit cd31bbf

File tree

3 files changed

+78
-2
lines changed

3 files changed

+78
-2
lines changed

.docbuild/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Phoebusgen can be downloded via pip, `see here <https://pypi.org/project/phoebus
1313

1414
Look at :doc:`the widget docs <source/phoebusgen.widget>` and :doc:`the screen docs <source/phoebusgen.screen>`.
1515

16+
To update the widget versioning, check the phoebusgen.phoebus_version and phoebusgen.widget_versions variables, along with
17+
the phoebusgen.change_widget_version method.
18+
1619
.. toctree::
1720
:maxdepth: 2
1821
:caption: Contents:

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [3.0.0] - 2024-09-08
9+
10+
### Added
11+
12+
- Widget versioning support via the change_phoebus_version method and optional files in ~/.phoebusgen
13+
- More tests
14+
15+
### Changed
16+
17+
- line_color and predefined_line_color to check the version for the Group widget
18+
19+
### Fixed
20+
21+
- Missing Color property on the XY Plot widget
22+
23+
## [2.8.0] - 2024-09-08
924

1025
### Added
1126

@@ -20,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2035
- Widget base class now inherits from a shared Generic class which is also
2136
used for new classes StripChartTrace, XYPlotTrace, StripChartYAxis, etc.
2237
- Switched from versioneer to setuptools_scm for package versioning
38+
- Switched from setup.py to pyproject.toml
2339

2440
### Removed
2541

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
112169
my_widget.predefined_font(phoebusgen.fonts.Header1)

0 commit comments

Comments
 (0)