Wir schaffen Wissen – heute für morgen Paul Scherrer Institut Anton Mezger caQtDM, an EPICS display manager with Qt A.C.Mezger, Paul Scherrer Institut, Switzerland Outline.

Download Report

Transcript Wir schaffen Wissen – heute für morgen Paul Scherrer Institut Anton Mezger caQtDM, an EPICS display manager with Qt A.C.Mezger, Paul Scherrer Institut, Switzerland Outline.

Wir schaffen Wissen – heute für morgen
Paul Scherrer Institut
Anton Mezger
caQtDM, an EPICS display manager with Qt
A.C.Mezger, Paul Scherrer Institut, Switzerland
Outline of the presentation
 caQtDM: what is it ?
 Qt: a new system for building graphic user interfaces.
 Qt-Display manager, Qt-Designer, components
 Qt-Designer, the GUI designer
 adl2ui: translator medm (.adl) files to xml (.ui) files
 Few remarks and hints.
 Conclusion, where is it ?
 Demo (offline for those interested).
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 2
caQtDM: what is it ?

caQtDM
•
a display manager using the Qt-Framework.
•
replacement of MEDM, it reproduces its functionality + extensions
(cameras, …)
•
used at PSI for two control systems simultaneously: EPICS (CA) and an
older home made CS used at the proton facility.
•
functionality extendable through the Qt plugin-mechanism
•
configured with the Qt-Designer using ui files or by writing scripts (pep
files: home made)
•
runs native on linux (x11) and on microsoft windows.
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 3
Qt: a new system for writing graphic user interfaces
What is the Qt-Framework (definition given by Wiki):
Qt is a cross-platform application framework that is widely used for developing
application software with a graphical user interface (GUI) (in which cases Qt is
classified as a widget toolkit)
Qt runs on the major desktop platforms and some of the mobile platforms.
Qt comes with libraries, an integrated development environment (IDE) called
QtCreator, with an user interface designer (Designer) and some third party
libraries like qwt for 2D graphics and qwtplot3d for 3D graphics.
The actual version we use is Qt 4.8.2.
For Qt 5 the C++ include file structure was changed and application software
has to be adapted.
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 4
Qt-Epics display manager: components

Qt-Designer, the graphic user interface builder tool
•

comes with Qt-SDK.
Qt-Designer plugged in control system widgets / extensions
•

developed in the context of our display manager.
adl2ui tool to translate .adl files to xml .ui files used by Qt-designer
•
developed in the context of our display manager, but can be modified
easily when using other target widgets.

caQtDM_Lib, the display and control system aware library class, used by
applications, monitors with maximum default rate of 5 Hz

caQtDM, the display manager glueying all together
Qt application = caQtdm
caQtDM_Lib
Qt Designer
CA
plugged in widgets
Description file (.ui)
adl2ui
MEDM .adl file
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 5
Qt-Designer, what can it do
•
Qt-Designer = a tool for building graphic user interfaces with widgets like
sliders, knobs, labels, buttons, ….
•
Qt-Designer offers a plug-in mechanism for introducing your own widgets and
build a rich environment with new entities. These are added to the widget box
•
Many widgets have been integrated to be used for “controls”:
•

Strip plot, cartesian plot, wheel switch, include, camera and many more

Include (composite) widget is represented in Qt-designer with its contents

Actually 30 widgets, including all MEDM objects.

Widgets are not directly CS-aware, but provide the properties and methods
to be used with applications.
Application loads through a «designer» load call the ui file.
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 6
Qt-Designer, what can it do
•
However not a graphical editor like gimp, corel draw, … While widgets are
used, you can only use widgets to draw objects.

Drawing widget for rectangles, circles, ovals, lines, triangles has been
created.
Property editor:

Can overlap and can have transparency
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 7
Qt-Designer, what can it do
Qt-Designer allows to make extensions having more interaction:

Polylines, Polygones: widget created with an integrated editor for drawing
with the mouse:

Doubletab widget: a container widget allowing two dimensional selection:
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 8
The .adl files: translation to xml files
Translator (adl2ui) is based on parser code of MEDM and generates ui
files:

Parses the .adl file and produces “includes”, you also have to parse
the underlying ui files:
• The Qt-Designer will show all the includes, but you have to be in the
directory where these are situated.
Problems:
• The widget ordering (in front or behind) is not always correct due to the
widget principle (one can correct this in Qt-Designer)
•
In Qt, the width of a text widget has to fit the text, but in MEDM the
width is not always correctly set by the user (one can correct this in QtDesigner)
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 9
A few remarks and hints

Edit with Qt-designer and “execute” display with caQtDM:
Edition and active display together using the reload function of caQtDM.

Stylesheets: Qt uses stylesheets at several levels and inheritance of styles
(CSS), One can define styles at application level, at file level (mainwindow)
and widget level
Example: color for window: Qwidget#centralWidget {background: rgba(187, 187, 187, 255);}
for included objects: Qwidget#centralWidget {background: rgba(187, 187, 187, 0);}

Display rate: display manager uses a mechanism that limits the display rate,
however by specifying the following option after the name of a pv one can change
the display rate:
channelname{“monitor”:{“maxdisplayrate”:20}}

Layouts: resizable screens can be produced with Qt-Designer (possible but not
easy)

adl2ui produces non resizable screens
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 10
Conclusion
 The Qt designer presents a good editor tool. With the plugin mechanism a
rich environment can be created.
 caQtDM reproduces correctly the behavior of MEDM and is continuously
extended.
 Many new widgets are integrated. Actually table, LEDS, toggles, cameras,
double tabwidget as well as internal channels have been added.
 the .adl translator produces correct .ui files. Some few files have to be edited
after translation.
 Resizing windows is possible, but needs a good knowledge of layouts and
can be used for simple layouts.
 Other control systems can be integrated. At PSI the display manager
services simultaneously 2 control systems (epics and a home made CS)
 EPICS 4 integration: interesting would be the standardisation of images /
cameras !
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 11
Acknowledgments:
The authors of MEDM for their code.
Elettra people for providing some widgets.
Download caQtDM from http://epics.web.psi.ch/software/caqtdm/
 Thank you for your attention
Demo on my laptop for those interested
A.C.Mezger, Paul Scherrer Institut, Villigen, Switzerland
slide 12