-
Notifications
You must be signed in to change notification settings - Fork 10
/
display.builder.html
1380 lines (1090 loc) · 48 KB
/
display.builder.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Display Builder</title>
<link rel="stylesheet" href="PLUGINS_ROOT/PRODUCT_PLUGIN/book.css" type="text/css"></link>
<link rel="stylesheet" href="section_numbers.css" type="text/css"></link>
<style>
table {
border: 1px solid black;
}
th {
padding: 6px;
text-align: center;
border-bottom: 1px solid #777;
}
td {
padding: 6px;
text-align: left;
border-bottom: 1px solid #ddd;
}
</style>
</head>
<body>
<!-- Aiming for one long file to allow printing of the complete 'manual'.
Exception: javadoc API
-->
<h1>Display Builder</h1>
<b>Table of Contents</b>
<!-- Topics are duplicated in toc.xml -->
<ol>
<li><a href="#overview">Overview</a></li>
<li><a href="#get_started">Getting Started</a></li>
<li><a href="#editor">Display Editor</a></li>
<li><a href="#conversion">BOY <i>*.opi</i> File Conversion</a></li>
<li><a href="#classes">Widget Classes</a></li>
<li><a href="#runtime">Display Builder Runtime</a></li>
<li><a href="#perspective">Display Runtime Perspective, Full-screen, Standalone</a></li>
<li><a href="#widgets">Widgets</a></li>
<li><a href="#properties">Properties</a></li>
<li><a href="#rules">Rules</a></li>
<li><a href="#scripts">Scripts</a></li>
</ol>
<!-- ====================================================== -->
<h2><a name="overview">Overview</a></h2>
<!-- ====================================================== -->
<p>The Display Builder is a panel editor and runtime for control system displays.
</p>
<h2><a name="get_started">Getting Started</a></h2>
<h3>Display Builder Examples</h3>
<p>The Display Builder example files demonstrate many of its widgets and features.
</p>
<center>
<img src="images/GettingStarted_samples1.png" alt="CS-Studio > Utilities > Install Samples" width="400" style="vertical-align:top;padding-right:16px"/>
<img src="images/GettingStarted_samples2.png" alt="X/Y Plot Widget example" width="400" style="vertical-align:top"/>
</center>
<p>Open the menu <b>CS-Studio</b> > <b>Utilities</b> > <b>Install Samples</b>.
Select <i>Display Builder</i> and click OK.
The examples will be in a project folder named "Display Builder".
</p>
<p>Start the first example display, <b>01_main.bob</b>, by right-clicking on the file in the Navigator and selecting
<b>Open With...</b> > <b>Display Runtime</b>.
</p>
<!-- ====================================================== -->
<h2><a name="editor">Display Editor</a></h2>
<!-- ====================================================== -->
<p>You use the Display Editor to create new display files or to modify existing display files.
</p>
<h3>Display Editor Perspective</h3>
<p>The Display Editor perspective offers the tools and settings needed to edit
Display Builder (*.bob) files.
From CS-Studio, the Display Editor perspective
can be opened from the menu bar: <b>Window</b> > <b>Open Perspective</b> > <b>Other...</b>,
then select <b>Display Editor</b>.
</p>
<p>Alternatively, if you are already inside the display editor,
right-click in the central Editor part and select <b>Open Editor Perspective</b>.
This will open the Display Editor perspective,
or - in case are already in that perspective -
a dialog will ask if you want to reset the perspective to its default layout.
</p>
<h3>Creating a New Display</h3>
<p>From within the Display Editor perspective, right-click on a project in the Navigator and select
<b>New</b> > <b>New Display</b>.
This will open the New Display wizard where you enter the name of your new display file.
</p>
<p>Alternatively, you can use the menu
<b>File</b> > <b>New...</b>, and under <i>Display Editor</i>, select <b>New Display</b>.
Then choose a container and name for the new display file in the New Display wizard.
</p>
<h3>Editing an Existing Display</h3>
<p>Right-click on a <i>*.bob</i> or <i>*.opi</i> file in the Navigator and select
<b>Open With...</b> > <b>Display Editor</b> (or <b>Other</b> > <b>Display Editor</b>).
</p>
<p>If you are already executing a display, you can open that display file in the editor
by right-clicking anywhere in the display runtime and selecting <b>Open in Editor</b>.
</p>
<h3>Executing a display from the Editor</h3>
<p>Right-click anywhere in the editor pane and select <b>Execute Display</b>
to start a Display Runtime for the file.
This will automatically save the file, so any pending changes
will be written to the *.bob file.
</p>
<h3>Adding Widgets</h3>
<p>There are two fundamental ways of adding widgets to a display:
</p>
<ul>
<li>Select widget in Palette and "Rubberband" the desired location:<br/>
Click on a widget type in the <em>Widget Palette</em>,
then draw a "Rubberband" type rectangle in the editor,
i.e. click the left mouse button where the top-left corner
of the new widget should be.
Keeping the left mouse button depressed,
drag the mouse to the desired bottom-right corner of the new widget.
Release the mouse button to create the new widget in the
desired location with the desired size.
</li>
<li>Drag a widget from the Palette:<br/>
Click on a widget type in the <em>Widget Palette</em>,
and drag it, keeping the left mouse button depressed,
into the editor.
As soon as the mouse button is released,
the widget is added to the editor.
<strong>Note:</strong> While dragging the widget,
the dragging outline image is not displayed on all platforms
because of a known issue in the FXCanvas class on Java 8. It will be solved in the
upcoming Java 9 release.
</li>
</ul>
<p>
Either way you add a widget, if the <em>Align widgets to Grid</em> option is selected in the toolbar,
the new widget location will snap to the closest grid position.
</p>
<p>
The newly added widget will be automatically selected,
allowing you to quickly move or resize it as described below.
</p>
<img src="images/DragAndDrop_adding_widget.png" alt="Adding widgets from Widget Palette." style="float:right;margin:0 0 0px 8px;"/>
<h3>Editing Widgets</h3>
<p>Most of the editing is performed dragging things around:</p>
<ul>
<li>Add widgets dragging them from the <em>Widget Palette</em> into the editor as described above,</li>
<li>select one or more widgets by "rubber banding" around them,</li>
<li>move selected widgets,</li>
<li>resize selected widgets,</li>
<li>add text, images or files by dragging it from outside into the editor.</li>
</ul>
<h4 style="clear:right">Selecting Widgets</h4>
<p>
The easiest way to select a single widget is by clicking on it.
De-select it by clicking it again, or by clicking on the background
of the display where there is no widget.
</p>
<p>
To select multiple widgets, hold the 'Control' key
and then click on widgets to add them to the selection.
To de-select one widget from a multi-widget selection,
hold the 'Control' key and then click
on an already selected widget.
</p>
<h4>Rubber Band Selection</h4>
<p>
The easiest way to select multiple nearby widgets is by rubber banding around it.
Click on the editor's background and, while keeping the mouse button depressed,
drag until the dashed rubber band encloses all the widgets of interest.
When you release the mouse button,
the selected widgets will be surrounded by the selection outline.
</p>
<p>
Once one or more widgets are selected, they can be moved and resized as a single entity,
as explained in the following paragraphs.
In addition, the properties of all selected widgets can be adjusted in the
<a href="#properties">Properties Panel</a>.
</p>
<center>
<img src="images/DragAndDrop_rubber_band_selection.png" alt="Rubber band selection." width="600"/>
</center>
<h4>Moving Widgets</h4>
<img src="images/DragAndDrop_moving.png" alt="Moving a widget." style="float:right;margin:0 0 0px 8px;"/>
<p>
Once widgets are selected, it is possible to move them around by clicking inside the selection
outline and dragging. The selection outline will follow the cursor movements until the
mouse button will be released, and the widgets will be actually moved.
</p>
<p>
If the
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/grid.png"/>
<em>Align widgets to Grid</em> button is selected, then the selection outline
will align to grid points when moving.
</p>
<p>
If the
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/snap.png"/>
<em>Snap to widgets</em> button is selected, then the selection outline
will align to existing widgets' edges when moving, displaying a cyan alignment ruler.
</p>
<p>
If the
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/coords.png"/>
<em>Widget Coordinates</em> button is selected, and the selection outline is
large enough to accomodate the additional information,
selection outline will indicate the location and size.
</p>
<p>
If the
<em>Shift Key</em> is held while moving the selected widgets,
the move is restricted to a horizontal or vertical move.
</p>
<h4 style="clear:right">Resizing Widgets</h4>
<img src="images/DragAndDrop_resizing.png" alt="Resizing a widget." style="float:right;margin:0 0 0px 8px;"/>
<p>
Once widgets are selected, it is possible to resize them by clicking inside one of the
selection outline's handles and dragging. The selection outline will follow the cursor
movements until the mouse button will be released, and the widgets will be actually resized.
</p>
<p>
The
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/grid.png"/>
<em>Align widgets to Grid</em>,
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/snap.png"/>
<em>Snap to widgets</em>
and
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/coords.png"/>
<em>Widget Coordinates</em> buttons again control if the resized region
snaps to grid coordinates or other widgets,
optionally displaying the location and size.
</p>
<h4 style="clear:right">D & D From Outside</h4>
<p>
Different entities dragged from outside the editor can be dropped in. When the nature
of these entities is compatible, the editor will accept the drag an drop operation
creating a series of widgets.
</p>
<h4>Dropping Images</h4>
<p>
An image (possibly dragged from a web browser) can be dropped into the editor.
That image will be saved into a temporary location and Picture widget will be
created pointing the the saved image file.
</p>
<p>
<strong>Note:</strong> The created Picture widget will have its top-left
corner at the location (possibly snapped to grid) wher the cursor was when
the image was dropped.
</p>
<p>
The created widget will be automatically sized the to dropped image size.
</p>
<center>
<img src="images/DragAndDrop_image_drag.png" alt="Image drag." width="400" style="vertical-align:middle;padding-right:8px"/>
<font size="32">➟</font>
<img src="images/DragAndDrop_image_drop.png" alt="Image drop." width="400" style="vertical-align:middle;padding-left:8px"/>
</center>
<h4>Dropping Files</h4>
<p>
Image files (with extension <code>.bmp</code>, <code>.gif</code>, <code>.jpeg</code>,
<code>.jpg</code>, <code>.png</code>, and <code>.svg</code>) and OPI files (with extension
<code>.bob</code>, and <code>.opi</code>) can be dropped into the editor.
A single image file will create a Picture widget, or a Symbol one if the ALT modifier key is
pressed during the operation. Multiple image files will create a
Symbol widget, while OPI files will create
Embedded Display ones. The created widget will reference the dropped file,
using (if possible) a relative path location.
</p>
<p>
Multiple files can be dropped at once. Each one will create its own corresponding
widget (Picture or Embedded Display), that will be offset by a grid step in
both coordinates from the preceeding one.
</p>
<h4 style="clear:right">Dropping URLs</h4>
<p>
When dropping a URL into the editor, one of the following situations occurs:
</p>
<ul>
<li>
The URL string ends with one of the supported image extensions (<code>.bmp</code>,
<code>.gif</code>, <code>.jpeg</code>, <code>.jpg</code>, and <code>.png</code>),
then a Picture widget will be created and positioned under the (possibly aligned
to grid) cursor position;
</li>
<li>
The URL string ends with one of the supported OPI extensions (<code>.bob</code>,
and <code>.opi</code>), then an Embedded Display widget will be created and
positioned under the (possibly aligned to grid) cursor position;
</li>
<li>
Otherwise a dialog will open allowing the user to chose the widget to be
created.
</li>
</ul>
<center>
<img src="images/DragAndDrop_url.png" alt="Dropping an URL."/>
</center>
<h4>Dropping Text</h4>
<p>
Text may be composed of a single or multiple lines. Each line could be
interpreted as a PV name. For this reason a dialog will open allowing to select
a single Label widget (displaying the whole text), multiple Label Widgets
(displaying a line each), or multiple widgets (of the same type) using each
line as a PV name.
</p>
<p>
Multiple widgets will be offset by a grid step in booth coordinates from the
preceding one.
</p>
<center>
<img src="images/DragAndDrop_text1.png" alt="Text drag." width="200" style="vertical-align:middle;padding-right:8px"/>
<font size="32">➟</font>
<img src="images/DragAndDrop_text2.png" alt="Text drop." width="300" style="vertical-align:middle;padding-left:8px"/>
<font size="32">➟</font>
<img src="images/DragAndDrop_text3.png" alt="Widgets created." width="300" style="vertical-align:middle;padding-left:8px"/>
</center>
<!-- ====================================================== -->
<h2 style="clear:right"><a name="conversion">BOY <i>*.opi</i> File Conversion</a></h2>
<!-- ====================================================== -->
<p>The Display builder automatically convert BOY <i>*.opi</i> files.
Whenever you open a <i>*.opi</i> file, the Display Builder maps all legacy widgets
to the new widgets and their corresponding properties.
</p>
<p>In many cases, existing <i>*.opi</i> require no changes at all to execute properly
in the Display Builder runtime.
This means you can simply select an existing <i>*.opi</i> file
in the Navigator and use the <b>Open With...</b> > <b>Display Runtime</b> context menu
to execute the display.
Likewise, actions that open related displays in legacy <i>*.opi</i> file format
will automatically load, convert and execute those.
</p>
<p>Sometimes, you may want to slightly rearrange widgets to look better
in the Display Runtime.
In rare cases, you will have to edit the file because widget behavior has changed.
Also beware that most <a href="#scripts">scripts</a> associated with the display need to be updated.
Scripts are the most likely cause of failures in converted files.
Finally, you might simply want to change the display to get new behavior.
</p>
<p>To edit, simply right-click on any <i>*.opi</i> file in the Navigator and use
<b>Open With...</b> > <b>Display Editor</b> to load the legacy file into the Display Builder editor.
If you are already executing the file in the Display Builder runtime,
use the context menu to <b>Open in Editor</b>.
You can now edit the file.
When saving the file, the file name is changed to <i>*.bob</i>.
</p>
<h3>Transition Hints</h3>
<p>Whenever the Display Builder is asked to open a <i>*.opi</i> file,
it will check for an alternate <i>*.bob</i> file.
</p>
<p>To transition from BOY to the Display Builder, it is thus best
to start with the existing <i>*.opi</i> files.
For those files that need to be adjusted,
edit the <i>*.opi</i> file and save it as a new <i>*.bob</i> file,
but keep the previous <i>*.opi</i> file.
This way, BOY can still be used with the existing files,
while the Display Builder will select the converted files,
and both tools can thus be used in parallel until all
files that need adjustments have been updated.
</p>
<p>If the only change required in a <i>*.opi</i> file
relates to a script, that script can be made bilingual
by following the Display Builder <a href="#get_started">example</a>
from <i>Display Builder/script_util/porting.opi</i> and
<i>Display Builder/script_util/portable.py</i>.
</p>
<!-- ====================================================== -->
<h2><a name="classes">Widget Classes</a></h2>
<!-- ====================================================== -->
<h3>Defining Widget Classes</h3>
<p>Create a new display file via <b>New</b> > <b>New Display</b>,
but enter a file name like "classes.bcf" that ends in <b>*.bcf</b>
instead of the usual "*.bob" to create a class file.
</p>
<p>When the display editor is used for class files,
each property of a widget has a check box next to it
to mark this property as being included in the class definition.
For example, drag a <b>Label</b> widget from the palette
into the editor.
Set its name to TITLE.
Then check the x, y, font, color and transparent properties
and set them as shown in the screenshot.
</p>
<img src="images/class_def.png"/>
<p>This defines a "TITLE" class for labels:
Its position is always in the upper left corner of the display (x and y set to 0).
It uses a certain font and colors.
</p>
<h3>Using Widget Classes</h3>
<p>Open the menu <b>Edit</b> > <b>Preferences</b> to locate the Display Builder settings.
Note the "Widget Class Files:" setting which allows for a list of class files,
separating multiple entries with a semicolon.
The class files are loaded when the display builder starts for the first time.
They are re-loaded whenever you save a class file,
or via the <b>Re-load Widget Classes</b> context menu of the display file editor.
</p>
<p>When you now open the display editor to create a new display,
i.e. a "*.bob" file and add a label to the display,
note that the "class" property has a drop-down list that includes
"TITLE" as a known class name.
Selecting "TITLE" will apply the x, y, font, color and transparent
settings that were defined in the class.
Furthermore, these properties are marked with a
<img src="PLUGINS_ROOT/org.csstudio.display.builder.editor/icons/class_property.png"/>
in the property panel, they cannot be modified.
</p>
<img src="images/class_use.png"/>
<p>The display is saved with all the settings of the widget,
including those that were provided by the class.
Whenever a display is executed in the display builder runtime,
the current class settings are applied.
If the current class files don't define a "TITLE" class for labels,
the display will appear as it was last saved.
If the current class files do define a "TITLE" class for labels,
those will be applied, meaning you can update
the class definition files and those new settings will then
be applied when a display is executed.
</p>
<!-- ====================================================== -->
<h2><a name="runtime">Display Builder Runtime</a></h2>
<!-- ====================================================== -->
<h3>Display Builder Runtime</h3>
<p>When you execute a display, the Display Builder runtime
opens the <i>*.bob</i> (or legacy <i>*.opi</i>) file,
connects to process variables, displays their value in Text Update widgets etc.
</p>
<p>When you right-click on a widget,
the first entry in the context menu which shows the name of the widget
opens an information panel for the widget.
Additional entries allow saving a snapshot of the display,
or to re-load the display.
</p>
<!-- ====================================================== -->
<h2><a name="perspective">Display Runtime Perspective, Full-screen, Standalone</a></h2>
<!-- ====================================================== -->
<h3>Display Runtime Perspective</h3>
<p>The Display Runtime Perspective is initially empty, meant to display runtime panels.
</p>
<p>For a production setup,
use the Display Builder "Top Displays" preference to configure a list of top level displays,
i.e. starting points for your users.
</p>
<p>Then open the Display Runtime Perspective, and use either the menu
<b>File</b> > <b>Top Displays</b>
or the Top Displays drop-down button in the tool bar to open these
from within the Display Runtime Perspective.
Display runtime panels can then be arranged by dragging their title tabs
into the desired location.
</p>
<p>Typically, at least one such Display Runtime Perspective with a pre-arranged
displays layout is then saved as a named Perspective
and used as a default layout.
</p>
<h3>Full-screen Mode</h3>
<p>The <b>Full-screen</b> entry in the runtime panel context menu
allows toggling the workbench window into and out of full-screen mode.
In full-screen mode, the menu, toolbar and status bar are hidden to
maximize the area available for display runtimes.
Only the title tabs of each display are still shown.
Exact details depend on the operating system.
For Mac OS X, the menu bar is hidden but remains accessible when moving the
mouse to the top of the screen. On Linux, the menu is turned off.
If supported by the operating system, the full-screen mode selects
a window mode in which the window becomes the only visible window
on the monitor, always on top of all other windows on that computer display.
</p>
<p>To exit full-screen mode and restore the menu, toolbar and status bar,
invoke the <b>Exit Full-screen</b> entry in the runtime panel context menu.
</p>
<h3>Standalone Window Mode</h3>
<p>Selecting <b>Change to Standalone Window</b> from the runtime panel context menu
closes the display runtime panel in the workbench window and instead opens
that runtime as a plain standalone window.
</p>
<p>Advantage:</p>
<ul>
<li>Minimal visual decorations. No toolbar, no perspective switcher, no display title tab.
Maximum space for display
</li>
<li>Slightly faster display updates because of top-level JavaFX window, not embedded in SWT</li>
</ul>
<p>Disadvantage:</p>
<ul>
<li>No context menu to inspect widgets, email screenshot etc.</li>
<li>No toolbar to navigate back to the previous display or to zoom in/out.</li>
<li>Cannot 'save' layout in context of Perspective</li>
<li>No way to re-attach standalone window to workbench</li>
</ul>
<!-- ====================================================== -->
<h2><a name="widgets">Widgets</a></h2>
<!-- ====================================================== -->
<p>Widgets are the components of Display Builder displays.
In the editor, you add Widgets to the display by dragging them
from the Widget Palette into the editor.
Then you typically adjust the location and size,
and enter a text or PV name by configuring the corresponding property.
</p>
<p>The following is a brief description of core widgets.
For details on each widget refer to the
<a href="#get_started">example displays.</a>
They showcase each widget and explain their key properties.
</p>
<p>The search field in the palette allows to filter widgets, showing only the ones containing the typed text (case insensitive).
Pressing the clear button (the small ✖ button inside the right edge of the search field) will reset the search,
displaying all widgets.
</p>
<h3>Graphic Widgets</h3>
<!-- ============== -->
<p>These widgets represent static content.</p>
<h4>Label Widget</h4>
<!-- ^^^^^^^^^^^^^ -->
<p>One or more lines of text.
Use to create labels or descriptions.
</p>
<h4>Arc, Ellipse, Rectangle, Polygon, Polyline Widget</h4>
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<p>Graphic elements for creating basic diagrams.</p>
<p>For Polygon and Polyline refer to example display
to learn about editor support for creating and modifying
the points of a polygon/line.
</p>
<h4>Picture Widget</h4>
<!-- ^^^^^^^^^^^^^^^ -->
<p>Widget for adding images (PNG, GIF, ..) to the display.</p>
<h3>Monitor Widgets</h3>
<!-- ============== -->
<p>These widgets show the current value of a PV.</p>
<h4>Text Update Widget</h4>
<!-- ^^^^^^^^^^^^^^^^ -->
<p>Main widget for displaying the current value of a PV.</p>
<h4>Byte Monitor, LED, Progress bar, Tank, Thermometer Widget</h4>
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<p>Widgets that display the current value of a PV in a graphical way.</p>
<h3>Control Widgets</h3>
<!-- ================= -->
<p>These widgets allow you to change the value of a PV.</p>
<h3>Plot Widgets</h3>
<!-- ============== -->
<p>These widgets create plot, typically requiring waveforms or multiple PVs.</p>
<h3>Structure Widgets</h3>
<!-- ============== -->
<p>These widgets structure several basic widgets or complete displays witnin a display.</p>
<h4>Group Widget</h4>
<!-- ^^^^^^^^^^^ -->
<p>Groups several basic widgets, by default adding a labelled border around them.</p>
<h4>Embedded Display Widget</h4>
<!-- ^^^^^^^^^^^^^^^^^^^^ -->
<p>Includes another display within the current display.
The embedded display is usually a smaller, re-usable display
that utilized macros instead of complete PV names.
The embedded display widget can then include that sub-display
with suitable macros.
</p>
<!-- ====================================================== -->
<h2><a name="properties">Properties</a></h2>
<!-- ====================================================== -->
<img src="images/tracker.png" alt="Tracker" style="float:right;margin:0 0 0px 8px;"/>
<p>Every widget has properties <b>x</b>, <b>y</b>, <b>width</b> and <b>height</b>
that define its position and size within the display.
While these properties can be entered in the Properties View,
a widget can also be moved interactively by moving the selected widget
in the editor with the mouse,
and the size can be changed by moving the square handles in the corner of the selected widget with the mouse.
</p>
<p><b>Label</b> widgets have a <b>text</b> property for configuring the text
shown in the label.
Many widgets have a <b>pv_name</b> property for configuring the name of the
PV that the widget will display or control at runtime.
These key properties can be edited by double-clicking the selected widget
and then entering the text or pv_name.
</p>
<h3 style="clear:right">Properties View</h3>
<img src="images/properties_palette.png" alt="Properties View" style="float:right;margin:0 0 0px 8px;"/>
<p>In general, properties are edited in the <b>Properties View</b>.
It lists every property of a widget with its current value,
and except for very few static properties it allows entering or selecting different values.
</p>
<h3>Search Field</h3>
The search field allows to filter properties, showing only the ones containing the typed text (case insensitive).
Pressing the clear button (the small ✖ button inside the right edge of the search field) will reset the search,
displaying all properties. Each time a new widget is selected, the search field is automatically reset.
<h3>Property Names</h3>
<p>The "Properties" panel will show each property with a description like "X Position", "Text" or "PV Name".
This is the localized description of each property which might be different in for example a German version of the Display Builder.
Each property also has a unique name that is used in the <i>*.bob</i> file
or when accessing a property from a <a href="#rules">rule</a> or <a href="#scripts">script</a>.
The name of a property is typically based on the simplified English description, all lower case:
<b>x</b>, <b>text</b>, <b>pv_name</b>.
</p>
<p>The Property View shows the underlying name of each property in a tool tip
that appears when you hover the mouse over the property description.
In the following description of properties, we always use the property name.
</p>
<h3>Common Properties</h3>
<h4>type</h4>
<p>Type of widget (e.g. label, text_update). Each widget has both a localizable (translatable)
type name and an internal type name used to identify the widget type in display files.
</p>
<h4>name</h4>
<p>Used to identify the widget. Is best made unique within the display.
</p>
<h4>x, y, width, height</h4>
<p>Location and size of the widget.
Can be configured in the Property view, but are typically adjusted using the
mouse on the selected widget.
</p>
<h4>text</h4>
<p>Text that a Label widget displays. Can also be configured via double-click on the widget.
</p>
<h4>pv_name</h4>
<p>The PV that the widget uses to read or write values. Can also be configured via double-click on the widget.
</p>
<h4>actions</h4>
<p>Attach Actions that do things like open displays or run scripts.
Primarily used with the <b>Action Button</b> widget.
</p>
<h4>text</h4>
<p>Text that is displayed in a <b>Label</b> widget or used
as the title of a <b>Group</b> widget.
</p>
<h4>pv_name</h4>
<p>All but the plain Graphics widget have at least one PV name.
At runtime, the widget connects to this PV, displays its current value,
and in the case of Control widgets also writes to it when you interact with the widget.
</p>
<h4>format, precision</h4>
<p>Text-based widgets have several formatting options for displaying the current value of a PV.
For formats that use the <b>precision</b>, a precision of -1 uses the precision
provided by the PV.
</p>
<ul>
<li><b>Default:</b>
Show a number as a decimal, an enumerated value via its label, and text as text.
</li>
<li><b>Decimal</b>
Show numeric and enumerated values as a decimal like "3.14"
<b>Precision</b> determines the number of digits after the decimal points, 2 in this example.
</li>
<li><b>Exponential:</b>
Show numeric values in exponential notation like 3.14E0.
<b>Precision</b> determines the number of digits after the decimal points, 2 in this example.
</li>
<li><b>Engineering:</b>
Similar to exponential notation but always using an exponent
that is a multiple of 3 to correspond to the common orders-of-magnitude
'micro', 'milli', 'kilo', 'mega' etc.
The number 31400 would be displayed as "31.4000E3" when using a precision of 4.
</li>
<li><b>Hexadecimal:</b>
Shows 255 as "0xFF". Truncates all numbers to integers.
</li>
<li><b>Compact:</b>
Formats numbers within the range of 0.0001 to 10000 as decimal,
otherwise uses exponential notation.
Typically results in the shortest representation.
</li>
<li><b>String:</b>
Text is displayed as provided.
Byte arrays are converted to text using UTF-8 encoding.
</li>
<li><b>Sexagesimal:</b>
Shows number as degrees or hours, minutes, and seconds with colons between the three fields.
The integer part of the number determines the hours respectively degrees.
The fractional part is expressed as minutes and seconds plus fractions of a second.
For example, "12:45:10.2", is the number 12.752833 expressed as 12 degrees or hours, 45 minutes, and 10.2 seconds.
The <b>precision</b> determines the number of digits after the first colon.
For precisions of 0, 1, 2, 3, 4, 5, and 6 the number above would be expressed as
13, 12:5, 12:45, 12:45:1, 12:45:10, 12:45:10.2, and 12:45:10.20, respectively.
</li>
<li><b>Sexagesimal DMS:</b>
Similar to sexagesimal, but assuming that the number is in radians
and 2π represent 360 degrees.
When displaying a number, it is converted to degrees by multiplying it by 180/π before formatting it.
When parsing DMS, the result is divided by 180/π to convert degrees into radians.
<i>(If you ever actually use this option, please let me know!)</i>
</li>
<li><b>Sexagesimal HMS:</b>
Similar to sexagesimal, but assuming that the number is in radians
and 2π represent 24 hours.
When displaying a number, it is converted to degrees by multiplying it by 12/π before formatting it.
When parsing HMS, the result is divided by 12/π to convert hours into radians.
<i>(Same here, let me know!)</i>
</li>
</ul>
<h4>rules</h4>
<p>Each widget has several additional properties that for example allow the configuration
of colors, the formatting of texts etc.
Ideally, you can create a functional control system display by configuring the basic
properties of a widget, relying on the default behavior of a widget.
For special cases, widgets can use <a href="#rules">Rules</a> that dynamically
assign widget property values based on conditional expressions.
</p>
<h4>scripts</h4>
<p>Similar to Rules but even more flexible are <a href="#scripts">Scripts</a>
that dynamically control widget appearance and behavior.
</p>
<h3>Array and Structure Properties</h3>
<p>Some widgets contain properties that are arrays and/or structures.
For example, the <b>Multi-State LED</b> has a <b>states</b> property that is an array.
The elements of the array are in turn structures with a <b>value</b> and a <b>color</b>.
For access from Rules or Scripts these properties can be accessed via names (for structured
properties) and indices (for array properties).
Example:
</p>
<pre>states[0].value</pre>
<pre>states[1].color</pre>
<h3>Boolean and Enumeration Properties</h3>
Boolean and enumeration properties have a combo-box control to select the valid value. In case
the property value must contain one or more macros, the <b>Edit Macros</b> button close to the
combo-box must be pressed, and the combo-box becomes editable and ready to contain the needed
"macroized" value string (see <b>Vertical Alignment</b> property in the figure above).
<!-- ====================================================== -->
<h2><a name="rules">Rules</a></h2>
<!-- ====================================================== -->
<p>Rules are the suggested way to obtain customized, dynamic behaviors beyond the capability of
<a href="#properties">widget properties</a> alone.
The alternative to rules are <a href="#scripts">scripts</a>.
Rules are recommended over scripts. While rules are more limited than scripts,
their API is expected to remain stable as the Display Builder evolves.
Scripts on the other hand are very likely to require adjustments
when updating to a new version of the Display Builder.
</p>
<p>Unlike scripts, rules require no code aside from simple expressions. Rules set widget property
values according to boolean expressions using their input PVs. Since the execution of a rule is
triggered by its trigger PVs, at least one input PV is needed for a rule.
</p>
<h3>Attaching a Rule to a Widget</h3>
<p>In order to edit the Rules for a widget, first select it, then click on the button
for its Rules property in the Properties palette. This will open the Rules dialog.
</p>
<center>
<img src="images/Rules.png" alt="Rules Dialog" style="height:456px;"/>
</center>
<p>
In the example shown in the screenshot, a rule named "New Rule" sets the "text" property of a Label widget.
It is triggered by a "sim://ramp" PV.
Whenever the value of that PV is greater than zero, the "text" property will be set to "Positive".
Whenever the value of that PV is less or equal than zero, the "text" property will be set to a
value that the user of that dialog was just about to enter as the screenshot was taken.
</p>
<p>Key features include:</p>
<ul>
<li>Rule Name: Add and remove rules here. Select a rule to edit its properties.</li>
<li>PVName: Add and remove input PVs for the rule. If "Trigger" is checked (true),
then the rule will execute whenever the PV's value changes.</li>
<li>Property ID: The property which is affected by the rule.</li>
<li>Boolean Expression: The expression which is evaluated when the rule executes. If it is
true, the property's value will be set to the expression's "Value" field. The expression may simply be
"true" or "True", in which case the value is always used (this is most useful when "Value as Expression"
is checked).
</li>
<li>Value: The value to use for the property if the boolean expression of that row is valid.
</li>
</ul>
<h3>Boolean Expressions</h3>
<p>The standard comparison operators (<, >, ==, <=, >=, and !=) may be used. Logical
operators may also be used. All input PVs of the rule are accessible as follows:
</p>
<center>
<table>
<tr>
<th>Value Type</th>
<th>Syntax</th>
<th>Example</th>
</tr>
<tr>
<td>double value</td>
<td><code>pv{index}</code></td>
<td><code>pv0 > pv1</code></td>
</tr>
<tr>
<td>long int. value</td>
<td><code>pvInt{index}</code></td>
<td><code>pvInt0 == 5</code></td>
</tr>
<tr>
<td>alarm severity code</td>
<td><code>pvSev{index}</code></td>
<td><code>pvSev > 0</code></td>
</tr>
<tr>
<td style="border-bottom: 0px">string value</td>
<td style="border-bottom: 0px"><code>pvStr{index}</code></td>
<td style="border-bottom: 0px"><code>pvStr0 == "happy"</code></td>
</tr>
</table>
</center>
<h3>Value as Expression</h3>
<p>
Assume a rule for the "width" property of a widget.