1 / 20

Python and the CLS and me

Python and the CLS and me. EDM Screen Display Using PYTHON. Python and the CLS and me. And Now for Something Completely Different. and me. Python and. 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)

nolen
Télécharger la présentation

Python and the CLS and me

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python and the CLS and me EDM Screen Display Using PYTHON

  2. Python and the CLS and me And Now for Something Completely Different and me Python and

  3. 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

  4. 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:

  5. So, What Happened? #2 • Be able to program Python • Be able to embed Python in an existing application • Interface Python to EPICS • Interface Python to some existing CLS libraries (epicsConnect, epicsQt, acquisition)

  6. 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

  7. 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

  8. 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.

  9. What Did I Get? Extra Box Around “Invisible” Buttons Missing Graphics Missing Words when Widget Not Long Enough Missing Engineering Units Incorrect Display Precision Python – EDM as of June 2011 EDM

  10. What’s There? • EPICS\, LOC\, and CALC\ PV’s • EDM Colors: • Color Rules • Alarm Sensitive • Invisible • Widget Visibility Rules

  11. 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.

  12. 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)

  13. 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

  14. 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”

  15. Python, Epics, EDM: Observations • 33 edm object types • Largest object implementation: 180 lines • Performance OK, but hasn’t been stress tested

  16. 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

  17. Related Python “Stuff” • Python access to CLS shared libraries done • pyEdm can coexist with those libraries

  18. pyEdm embedded Main Window: Qt UI file displayed using PyQt4 Embedded pyEdm display

  19. 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

  20. 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

More Related