Display Builder Update Kay Kasemir, Megan Grodowitz Amanda Carpenter May 2016, ESS EPICS Meeting
CS-Studio ‘BOY’
Issue: Too much on UI Thread Load *.opi file Load embedded *.opi (Linking Container) Handle PV updates Execute scripts CS-Studio “freezes”
BOY code: Change step by step? Difficult: Based on GEditorF SWT/Draw2d UI Thread Risky: BOY is used in operation Unintended side effects (Linking Container, macros, views) Rewrite Model Representation JavaFX Editor Runtime PV
Display builder Update Editor Runtime PV “Looks like BOY”, but better Model: Widgets, Properties, file format Representation: On-screen objects, JavaFX (or SWT) Runtime: PVs, scripts Representation JavaFX Model BOY Update
Load Displays: BOY vs. Display Builder UI thread (BOY) vs. Background threads (Display Builder) boy_delay1.mov vs. builder_delay1.mov (Both BOY and display.builder have 2 sec delay in file access to simulate slow file access)
Model Widgets Properties Persistence Macros Colors, Fonts Editor Runtime PV Widgets Arc, Rectangle, Label, LED, TextUpdate, .. Group (contains other widgets) Embedded Display Properties Allow changes from any thread Change notification Controlled order Persistence Loads existing *.opi files Saves in defined order Macros For ‘text’ as well as ‘x’, ‘visible’, .. Colors, Fonts Representation JavaFX Model TODO Many more properties and widgets Defaults based on ‘class’ property
Representation Java FX SWT Fixed the font size problem! Editor Runtime PV Java FX For all widgets SWT Very few widgets, just to show it’s possible Fixed the font size problem! BOY “point size” vs. pixel Representation JavaFX Model TODO Many more widgets Many properties Web Representation?
Runtime Common Widget Runtime EmbeddedDisplay Runtime Editor Runtime PV Common Widget Runtime Loads model in background Creates representation on UI thread Handles PVs and scripts (rules) in background One Jython interpreter & thread per window Throttles UI updates EmbeddedDisplay Runtime Keeps hosted display private ActionButton Runtime Replaces current or opens new window Representation JavaFX Model TODO ??
Compare BOY and display.builder
File Format Similar Concise Useful order
Widget Model: Consolidate, Refine Rectangle, Rounded Rectangle Rectangle w/ corner width, height LED with different PV behavior LED for binary PV or ‘bit’ MultiStateLED for N states
Properties: Arrays and Structures “trace_0_color”, .., “state_value_11” Actual arrays and structures: “traces[0].color”, “states[11].value” Array size only limited by memory
Keyboard Navigation in JavaFX ‘Tab’ move in widget order ‘Shift-Cursor’ move in on-screen order .. was impossible because of SWT/Draw2d mix
Alarm-sensitive Border Space-efficient, distinguishable Minor: Single-line Major: Double-line Invalid/Disconnected: Broken line .. now without widget body resize
Plotting Basics of Image and XYPlot “work”
https://twitter.com/LeedeMora, SciPy2015 on YouTube Image Widget Default color map: Viridis “perceptually uniform” https://twitter.com/LeedeMora, SciPy2015 on YouTube
Editor
Editor Palette Properties Tracker to move/resize Toolbar Selection Runtime PV Palette Properties In defined order No more off-screen value column Tracker to move/resize Snap-to-Grid Snap-to-Geometry (parallelized) Toolbar Un-do Front/back Align top/center/.., distribute Selection Rubberband, multi-widget, In and out of ‘Group’ Outline (Widget Tree) Representation JavaFX Model TODO Rulers?
Context-based Inline Editor In editor, Double-click widget for PV Name (Any widget with PV) Text (Label Widget)
Image Widget Property Comparison
Color Map Editor Comparison
Poly Editor ‘Append’ Mode ‘Edit’ Mode Toggle between modes Add points Delete last point ‘Edit’ Mode Move Add Delete points Toggle between modes
Scripts Execute in background Minimal script compatibility: val = PVUtil.getDouble(pvs[0]) pos = 100 + 20*val widget.setPropertyValue(“x”, pos) Weren’t kidding when telling you to avoid scripts because compatibility is not guaranteed. http://imgs.xkcd.com/comics/workflow.png
Rule & Script Dialog Streamlining All rules of a widget in one dialog
You should still avoid scripts .. but if you ignore this advice, you’ll find they work better than before (Long running script example)
Status Examined ~200 SNS Instrument screens Many screens complete or nearly complete! Missing widgets: Menu Button Byte Monitor .. Missing Properties XYPlot Image (Intensity Graph) Some need manual work Scripts, Rules
Outlook Implement most BOY-type Widgets & Properties Priority based on SNS instrument needs Plan to add vtype.pv.mqtt IoT Continue to allow Standalone Editor, Runtime Use outside of CS-Studio Eclipse Project?
Boy, Only Better Status Separate Model, Representation, Runtime Background threads, less freezing Minimal script compatibility Status Reads existing files Handles basic instrument displays 1/3 of BOY widgets with essential features First release end-2016
Present current state of Model Design Time Data Flow Add Widget, Set Property Editor Present current state of Model Update File Save Representation Model JFX Notify of changes
Present current state of Model Runtime Data Flow Runtime PV Scripts, (Rules) UI Event Present current state of Model Enter Text, Push Button File Update Load Representation Model JFX Notify of changes