jddd training for advanced users elke sombrowski

41
jddd Training for advanced users Elke Sombrowski

Upload: nichole-perks

Post on 31-Mar-2015

230 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Jddd Training for advanced users Elke Sombrowski

jddd Training for advanced users

Elke Sombrowski

Page 2: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 2

MVS Vakuum Übersichtmit freundlicher Genehmigung von M. Boehnert

jddd panels at Desy

MPS Interlock Übersicht

mit freundlicher Genehmigung von S. May

HASYLAB - FLASHControl Center

mit freundlicher Genehmigung von M. Trompeter

AMTF Interlock Bedienfeld

Page 3: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 3

Statistics

The number of created panel is growing rapidly at Desy.

Nearly 100 Desy people attended a basic jddd training.

In this new training you will learn how to design “good” panels using advanced jddd features.

Page 4: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 4

Content

What is “good” panel design?

> Optimal panel size

> Design hints for colors

> Design hint for On/Off Switches

> Structure your panel

> Tips to avoid long panel startup times

Making complex panels

> The LocationChooser: Paint one panel for all locations

> Using dynamic components

> Buttons with special functions

> Exercises 1

> Plots…

> Tables, AliveComponent

> JavaScript for simple calculations

Page 5: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 5

Content

> Using an indirect address

> Layers

> Exercises 2

Debugging methods

> How to monitor the panel performance

> Panel runtime during the last 365 days

> File dependencies

Miscellaneous

> SVN folder structure

> Tips for ddd to jddd panel conversion

> How to start jddd

> Save sessions

> Status displays

> How to make bug reports

Page 6: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 6

What is “good” panel design?Optimal panel size

Design hint for panel size:

> If the panel if permanently running, use a full screen or half screen size.

> If the panel is running only short times on demand, don’t use a full screen size, because you can’t see the panels behind.

Page 7: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 7

What is “good” panel design?Design hints for colors

A panel with design hints for colors is available in the SVN:

/svn/examples/design_hints.xml

Page 8: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 8

What is “good” panel design?Design hint for On/Off Switches

Using a ToggleButton for switching a device on and off is dangerous, because it’s not clear if the button text describes the state or the action.

In ddd there are different solutions how to display On/Off Switches.

In jddd we propose to use a checkbox with “bigSize” setting.

Page 9: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 9

What is “good” panel design?Structure your panel

>Use TabbedPanes

>Use LayeredPanes instead of groups

>Use Include Components for identical components with different base address

Page 10: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 10

What is “good” panel design?Tips to avoid long panel startup times

Graphical widgets in Java have slow startup times try to reduce the number of widgets in your panel:

> If possible replace nested If components by a Switch

Page 11: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 11

What is “good” panel design?Tips to avoid long panel startup times

Graphical widgets in Java have slow startup times try to reduce the number of widgets in your panel:

>Replace If component containing coloured rectangles by a ColouredIndicator

>Use IncludeComponents and images in their original size to avoid size recalculation.

Page 12: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 12

Making complex panelsThe LocationChooser: Paint one panel for all locations

A LocationChooser changes the base address of the whole panel.

Page 13: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 13

Making complex panelsThe LocationChooser: Paint one panel for all locations

A LocationChooser in the new “rpc_test” panel:

/svn/global/propertiesTable.xml

Page 14: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 14

Making complex panelsUsing dynamic components

Dynamic list:

> Place only one “row” of components in the editor

> Set base address for the list: TTF2.VAC/PUMP_STATION/*/

> Set address for all components, e.g. ///DREHZAHL

> In run mode all locations are read from DOOCS

> The list is automatically filled for all locations

> Optional: use “regexFilter” and “checkAdr”

Page 15: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 15

Making complex panelsUsing dynamic components

paint a singlecomponent read x, z-pos from DOOCS

use dynamic include component

Dynamic includes for displaying BPMs

Page 16: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 16

Making complex panelsUsing dynamic components

Dynamic includes for displaying BPMs

Page 17: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 17

Making complex panelsButtons with special functions

Page 18: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 18

Making complex panelsButtons with special functions

Restore button:A button with “restore” function highlights all restorable values on mouse over(values with expert property “restoreValue”).A mouse click restores the highlighted values.See also: /svn/examples/RestoreButton.xml

Page 19: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 19

Exercises 1

> Exercises

1a) Create a panel with a DynamicList for pump stations including pump station name, Drehzahl, online status (base address of the dynamic list is: TTF2.VAC/PUMP_STATION/*/).

1b) Add a button with “Set component property” function to set a regex filter for the dynamic list.

2) Create a panel with a DynamicIncludes component for BPMs. The BPM component should change it’s color if it is enabled (use e.g. TTF2.FEEDBACK/ORBIT/9ACC2.X/BPM_ENABLE).

3) Create a panel with arbitrary singenerator settings and use a “Restore” button for restoring old values.

Page 20: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 20

Making complex panelsHistory Plots: Scales and Data Tip

unusedLimits during run-time

Scale infofrom serverxxx.EGU@ start of plot

Enable Data Tipsin editorOrRun-time

Data Tip: store user comments

Page 21: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 21

Making complex panelsPlotsHistorien und Zeitreihendarstellungen

Maximum; tmax

Minimum; tmin

2 x standard deviation

mean value

candlestick representation

fourier transformation

Page 22: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 22

Time Domain Correlation Plot

> refAdr: data for X-scale

> adr0..adrN:can be xxx.TDor single values with “interpretation” as I or Q

>Run-time:single values are displayed as horizontal or vertical lines

Page 23: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 23

Time Domain Plots

Enables “Persistence Mode”

1/16 resolution Full resolution

Mean of 16 values or max value, calculated on server

Auto mode:No more than onevalue per pixel:speed-up drawing

Page 24: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 24

Making complex panelsPlots

Master scale

> Plots with the same masterXScale zoom simultaneously within a jddd application

Page 25: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 25

Making complex panelsTables

A table displays the content of an array.

A colormap can be used to highlight values.

Page 26: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 26

Making complex panelsAlive Component

> The Alive component is a transparent layered pane where one or multiple components can be placed.

> In run mode the components change their position or size related to control system values.

> Example: BPM position display

Page 27: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 27

Making complex panelsJavaScript for simple calculations

The "dataOp" property is used to perform mathematical operations with control system values using JavaScript syntax. This property is an expert property and is available for the jddd components Button, Value, ProgressBar, ColouredIndicator, StatusRegister and Switch.

An example how to use this property is available as tooltiptext in the properties table, e.g.:

dataOp = $adr*2+${FAC/DEV/LOC/PROP}

At runtime "$adr" and "${FAC/DEV/LOC/PROP}" are replaced by the values read from the corresponding addresses.

See also:/svn/examples/dataOp.xml

Page 28: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 28

Making complex panelsUsing an indirect address

The property "indirectAdr" is a control system value containing an address string.

The indirect address can be placed either in the "indirectAdr" property or directly in the "adr" or the buttons "xmlFile" property. In the "adr” or "xmlFile" property an indirect address string has to be marked by "${indirect address string}".

For example:indirectAdr = ///ADR_SV.LEFTadr = ${///SADR}xmlFile = commonFCT_CODE_${///FCT_CODE}.xml

See also:/svn/examples/IndirectAddress.xml

Page 29: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 29

Making complex panelsLayers

> Each component can be placed on a specific layer, which is visible or invisibe at runtime.

> The predefined layers are "NONE" and "EDIT". Additional layer names may be set in the expert property "layerList" of the background "EditorPanel”.

> By default new components are placed at layer "NONE", which means that they are always visible at runtime.

> The "EDIT" layer is used for components, which are only visible in edit mode.

> If a layer name starts with "!" it is invisible at panel startup.

Page 30: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 30

Making complex panelsLayers

Layers can be toggled at runtime:

> In the context menu

>With a Checkbox

Page 31: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 31

Exercises 2

> Exercises 1) Plot Exercise…

2a) Create a panel containing 3 different spectrum plots of singenerator data (e.g. TEST.DOOCS/SINGENERATOR/SIN/DATA.TD). Use the master scale to zoom all plots at the same time.

2b) Start the panel twice and test the zoom functionality.

3) Create a panel with an AliveComponent, which moves a circle. Use singenerator data (TEST.DOOCS/SINGENERATOR/SIN/DATA.TD) for testing.

4) Repaint the /svn/examples/dataOp.xml panel.

5) Create a panel with an Oval and a Rectangle. Use layers to show/hide these components.

Page 32: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 32

Debugging methodsHow to monitor the panel performance

>Watch the memory bar (in the upper right corner of the application) It displays Used/Max memory

> In the About panel: Check the component count

Check the number of calls per second

Page 33: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 33

Debugging methodsPanel runtime during the last 365 days

Page 34: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 34

Debugging methodsFile dependencies

Jddd provides information about SVN file dependencies:

> 1.Tab: displays all file paths with the wanted file name

> 2. Tab: displays all include components and files opened on a button click

> 3. Tab: displays where the file is used as include component and from which panels it can be started

Page 35: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 35

MiscellaneousSVN folder structure

Conventions for SVN file names and folder structure:

> The main panel has to contain the word “main”. This file is displayed in bold letters in the SVN browser.

>Use “images” folder for image files.

>Use “includes” folder for included components.

>Use “expert” folder for expert panels.

Page 36: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 36

MiscellaneousTips for ddd to jddd panel conversion

> To convert from ddd into jddd one has to start ddd, load a, select the panel in the list (e.g. "main_select"), click on file and on "Test: Save as XML".

Page 37: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 37

MiscellaneousTips for ddd to jddd panel conversion

Reworking the converted panel:

> Buttons which are placed on top of each other have to be replaced by a single button in jddd.

> Alive and StatusRegister components have to be reworked, because they cannot be converted correctly.

> Use LayeredPanes instead of rectangles to structure your panel.

> Replace nested "If" components by a "Switch” component if possible.

> Replace “If” components showing coloured rectangles by a ColouredIndicator if possible.

> Use a TabbedPane to combine standard and expert view in one panel.

> Think about using new jddd widgets like DynamicList, DynamicIncludes, Tables…

Page 38: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 38

MiscellaneousHow to start jddd

> Start jddd via Java Webstart from your browser

> Start jddd via command line (works only at Desy and only on Linux or Mac):

jddd-run -file /svn/examples/test.xml

jddd-launcher -file /svn/examples/test.xml

(see jddd help page for command line options)

> Your Java Webstart link for special panels: javaws ‘http

://ttfinfo2.desy.de//common/applications/jddd_xml/svn_jnlp.jsp?run=true&file=/svn/global/WatchdogOverview.xml&address=TTF2.SYSTEM/TTF2DAQ5.WATCH//'

Page 39: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 39

MiscellaneousSave sessions

A session saves a set of jddd panel names, sizes, positions and special settings.

Page 40: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 40

MiscellaneousStatus displays

jddd panels can be saved as png files on a local disk with a selected update rate (the default is 60 seconds). For writing png's with jddd you have to use the -png option like:

jddd-run -file /svn/examples/singenerator.xml -png /home/elkes –rate 10

Here is an example how to display these panel pictures in a web browser:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html> <head> <title>Test jddd png Output</title> <script type="text/javascript"> setInterval('reloadImage()', 2000); // 2 seconds function reloadImage() { img = document.getElementById('theimage'); img.src = '/home/elkes/singenerator.png?' + Math.random(); } </script> </head> <body> <h1>Test png file creation!</h1> <p><img src="/home/elkes/singenerator.png" name="testbild"id="theimage"></p> </body></html>

Page 41: Jddd Training for advanced users Elke Sombrowski

Elke Sombrowski | Training for advanced jddd users | May 2013 | Seite 41

MiscellaneousHow to make bug reports

> The bug report should contain the following information: Operating system

jddd version number

Panel name and path in SVN

Screenshot

Detailed description

> Please send your bug report to [email protected]