PyDM 1.7
PyDM 1.7 Release Notes
Hello, everyone. After a significant period (six months!) without any releases, we are finally releasing PyDM 1.7. There have been almost 150 commits since the last release (1.6.5), so there's quite a lot of features and bug fixes (see below for the full lists). Before you get to those lists, please read the info about our plan for releasing PyDM 2.0, which is happening some time in the next few months.
PyDM 2.0 Coming Soon!
PyDM 1.7 is intended to be the final minor version in the 1.0 series. The next non-bugfix release will almost definitely be 2.0, which will be centered around big changes to the flow of data between PyDM plugins and widgets. This will allow us to support sources of structured data, where multiple pieces of data are all sent as a single structure. This will allow us to support a whole new set of control system protocols, like EPICS7's PVAccess.
This will be a big overhaul, and there will be some breaking changes to the way things work - mostly in the data plugin department, but a few other places too. We'll publish migration guides to help you get any custom data plugins and widgets you have up in running in 2.0. Another change to be aware of is that we will be ending support for Python2.7 - all v2.0-and-up releases will only support Python 3.6 and higher.
Our plan is to have a separate '2.0' branch of the PyDM repository available (probably with pre-release tagged versions) for a few months, and let the user community try it out before finally merging it in and releasing 2.0 proper. Stay tuned!
New Features in 1.7
- A new widget, PyDMTemplateRepeater, has been created. This new widget lets you specify a .ui file as a "template", and then specify a .json file as a "data source" that will fill in multiple instances of that template with values. The PyDMTemplateRepeater can lay out the instances vertically, horizontally, or in a 'flow' layout, which is like a grid layout that wraps to new rows as the row fills. If you use this widget in a python-based display, you can directly supply a list of dictionaries to use as a data source - giving you the possibility to hook it up to databases, web APIs, etc. This widget was built to create huge displays with lists of controls for dozens of devices, in a dynamic way, without having to write any code (unless you want to!).
- PyDMLabels can now set their text via the Widget Rules system. This is pretty powerful, and lets you display custom text when a channel value (or multiple channels) change.
- PyDMComboBox widgets can now be used with plain-old integer value channels. You can specify the text to display for each value inside Qt Designer (right click and chose 'Edit Items'). Integer values that don't correspond to a pre-defined string will just appear as an empty string in the combo box. (Thanks @ivany4)
- The shorter EDM-style macro syntax ("key1=val1,key2=val2") now works in all widgets with a 'macros' field, in addition to the original JSON macro syntax.
- All PyDM drawing widgets now have configurable Pen Cap and Join Style properties. (Thanks @hhslepicka)
- PyDMRelatedDisplayButtons can now have multiple files specified on the same button. If you specify multiple files (which is now a QStringList property, rather than just a string), the button will give you a drop-down menu to let you choose a particular file to launch. This re-creates a feature available in MEDM.
- PyDMPrimitiveWidget can now be subclassed with additional constructor parameters. (Thanks @hhslepicka)
- PyDM now has a new
pydm.data_plugins.connection_queue()
context manager that will establish channel connections in a batch. PyDM now uses this feature internally when loading all displays. When instantiating large numbers of widgets, this results in faster connections and less user-interface pausing. See #467 for an example of how it is used - it may be useful in python-based displays or custom widgets that dynamically establish connections to channels. - PyDM now waits until the display appears on-screen before establishing connections. This doesn't affect the total time that it takes to display a screen and establish the connections, but does make PyDM feel more responsive to users - they don't have to wait for all the channels to connect before seeing the screen.
- PyDMEmbeddedDisplay widgets have a new property, 'loadWhenShown'. This property will prevent the display from actually loading and connecting to widgets until it is actually visible on the screen. In cases where you have a display with a bunch of PyDMEmbeddedDisplay widgets inside tabs, this can make your display load much faster.
- PyDMEmbeddedDisplay now works outside of PyDMApplication, including in Qt Designer. (Although in Qt Designer, you can't edit the content of an embedded window from the embedded window's parent - you'll still have to open it on its own to edit it.)
- PyDM's CI has been moved to Azure Pipelines. (Thanks @hhslepicka)
Bug Fixes in 1.7
- The ability to middle-click a widget to see its channel address works again (Thanks @hhslepicka)
- PyDM now strips whitespace from the beginning and end of channel address strings (Thanks @hhslepicka)
- Fixed
pydm.utilities.establish_widget_connections
, which never worked due to logic errors. - Fix a crash in PyDMWaveformPlot when all elements of the waveform data were +inf or -inf. (Thanks @hhslepicka)
- Stylesheet properties now properly cascade to child widgets. (Thanks @hhslepicka)
- The (always unused) 'channel' property on PyDMImageView has been hidden from Qt Designer (Thanks @hhslepicka)
- PyDMLogDisplay now cleans up the log handler when it closes (Thanks @hhslepicka)
- Fix a bug in setup.py when loading the requirements.txt file (Thanks @hhslepicka)
- requirements.txt has been updated to better separate testing and CI requirements from the core PyDM requirements (Thanks @hhslepicka)
- PyDMSliders will no longer crash PyDM if you try to use them without any specified high and low limits. (Thanks @ivany4)
- Fix a crash when inserting a tab into PyDMTabWidget in Qt Designer (Thanks @ivany4)
- Fix painting bug in PyDMByteWidget (Thanks @hhslepicka)
- Hard-coded paths have been removed from some of PyDM's tests (Thanks @hhslepicka)
Refactoring
- Value text formatting (setting precision, setting exponential format, appending unit strings, etc) functionality has now been moved out of PyDMBaseWidget and into its own mixin class. This means that text-formatting properties have been removed from widgets where they aren't relevant.