20
EDM Screen Display Using PYTHON Python and the CLS and me

EDM Screen Display Using PYTHON Python and the CLS and me

Embed Size (px)

Citation preview

Page 1: EDM Screen Display Using PYTHON Python and the CLS and me

EDM Screen Display Using PYTHON

Python and the CLS and me

Page 2: EDM Screen Display Using PYTHON Python and the CLS and me

and mePython and

And Now for Something Completely Different

Python and the CLS and me

Page 3: EDM Screen Display Using PYTHON Python and the CLS and me

WHY?

• I was looking for an interpreted language that would work with the GUI currently used at the HXMA beamline (a C++/Qt 3.3 application)

• I didn’t want to invent my own language

Page 4: EDM Screen Display Using PYTHON Python and the CLS and me

So, What Happened?

• I tried learning Python (July, 2010)

• But, I needed a project as a learning tool

• I wanted to be able to do a few specific things:

Page 5: EDM Screen Display Using PYTHON Python and the CLS and me

So, What Happened? #2

1. Be able to program Python

2. Be able to embed Python in an existing application

3. Interface Python to EPICS

4. Interface Python to some existing CLS libraries (epicsConnect, epicsQt, acquisition)

Page 6: EDM Screen Display Using PYTHON Python and the CLS and me

My Python Project - pyEdm

• EDM is based on “Motif”, and (to my eye) doesn’t make the best use of object-oriented programming [open to debate]

• The .edl files are highly structured

• EDM widgets share a lot of methods and data fields

Page 7: EDM Screen Display Using PYTHON Python and the CLS and me

pyEdm #2

• Success for this project was learning Python programming, NOT replacing EDM – and pyEdm does not replace EDM

• But, I learned how to use Python with EPICS (pyCa)

• AND I can display EDM files under MS-Windows

Page 8: EDM Screen Display Using PYTHON Python and the CLS and me

pyEdm #3

• EDM 1-10f has ~44,000 lines of code

• pyEdm has ~5,000 lines of code – more common code, big gains from using Qt

• I’d be surprised if adding the missing functionality (editing screens, saving screens, missing unusual features) would add another 5000 lines.

Page 9: EDM Screen Display Using PYTHON Python and the CLS and me

What Did I Get?

EDMPython – EDM as of June 2011Extra Box Around “Invisible” ButtonsMissing Words when Widget Not Long EnoughMissing GraphicsMissing Engineering UnitsIncorrect Display Precision

Page 10: EDM Screen Display Using PYTHON Python and the CLS and me

What’s There?

• EPICS\, LOC\, and CALC\ PV’s

• EDM Colors:– Color Rules– Alarm Sensitive– Invisible

• Widget Visibility Rules

Page 11: EDM Screen Display Using PYTHON Python and the CLS and me

What’s There? #2

• Widgets: shapes, lines, text, images, sliders, groups, PIP, related displays, shell buttons, message buttons, symbols, XY graph.

• Path searching for .edl files.

Page 12: EDM Screen Display Using PYTHON Python and the CLS and me

What’s Missing?

• WYSIWYG editing

• Blinking Colors

• EDM Server Mode

• EDM Screen Display from String PV

• Complete set of operating and display modes for many widgets (e.g. all combinations of text display, all XY graph modes)

Page 13: EDM Screen Display Using PYTHON Python and the CLS and me

What’s Ugly?

• “Invisible” buttons. I use them lots, and the uninvisible box around them looks bad.

• Matching the Fonts. Word placement and alignment are noticeably different on many screens.

• Suspected race condition causes occasional missing widgets on display

Page 14: EDM Screen Display Using PYTHON Python and the CLS and me

What’s Ugly? #2

• Python and QT “Ownership” rules aren’t matched up.

• Code to support dynamic loading of PV and object modules screams out “REWRITE ME!”

• Code to support CALC\ looks a lot like “C”

Page 15: EDM Screen Display Using PYTHON Python and the CLS and me

Python, Epics, EDM: Observations

• 33 edm object types

• Largest object implementation: 180 lines

• Performance OK, but hasn’t been stress tested

Page 16: EDM Screen Display Using PYTHON Python and the CLS and me

What’s Being Done Now?

• Updates to pyEdm only as required for specific EDM screens embedded in a Python/Qt4/EPICS application

• Near term:– Make available for “on-call” staff– Make available for tech staff with MS-Windows

Page 17: EDM Screen Display Using PYTHON Python and the CLS and me

Related Python “Stuff”

• Python access to CLS shared libraries done

• pyEdm can coexist with those libraries

Page 18: EDM Screen Display Using PYTHON Python and the CLS and me

pyEdm embedded

Main Window: Qt UI file displayed using PyQt4

EmbeddedpyEdmdisplay

Page 19: EDM Screen Display Using PYTHON Python and the CLS and me

My hovercraft is full of eels

There are stumbling blocks.

• Some python support isn’t straightforward (CERN ROOT, Root QT, QT, and Python are causing me grief)

• A clean python re-implementation of a class is more work than a quick interface and extra python code to deal with the C-style approach to the class

Page 20: EDM Screen Display Using PYTHON Python and the CLS and me

How Not To Hide

• Edm 1-10f

• Python 2.5.1

• pyEpics 3 (cars.uchicago.edu)

• QT 4.5

• Epics 3.14.6 and 3.14.9