Title: EPICS Lab Part 2: Channel Access Clients
Author: Andrew Johnson

EPICS EDM Lab Part 2: 

EDM Tips
EDM makes use of all three mouse buttons.  This makes it tricky to use at first.  Here are some tips:
•	Left-click selects an existing widget.
•	Left-double-click opens the properties window for an existing widget.  
•	Left-drag adds a widget to your display.  Left-drag the mouse ("left-rubber-band") to make a rectangle that is the size of the widget you want to create.  When you let go of the mouse button, a menu pops up and you can select the type of widget you want to add.
•	Middle-click on a blank area of the window opens a menu that allows you to save your file, switch between edit mode and execute mode, and paste a copied widget.
•	Middle-click on a selected widget allows you to copy, paste, raise, lower, and rotate the widget.
•	Middle-drag a region selects multiple widgets.
EDM has good online help.  To open it, middle-click an empty area of your display and select Help.  In the window that pops up, click Objects or Line Objects.
EDM Exercise 4: Colors, Macros
We will see how macros get passed to related displays.
Open example3 and save it as “example4”. This will be our main display that launches two related displays.
Add a label (Graphic/Static text) that shows “User $(user)”.
Add two Control/Related Display buttons:
Set “File” to “relatedDsp”, macros to “param=1”, label to “Rel. 1”
Button #2: File: “relatedDsp”, macros: “param=2”, Label: “Rel. 2”
Add a text entry control, and set its Control PV to “$(user):xxxExample”. This PV name will also be used in a color rule inside the related display.
Add an exit button. Check the “Exit Program” option.
Create a new display to be used as the related display, save it as “relatedDsp”:
Create a static text object with Text Value  set to “Related Display, param=$(param)”
Create a rectangle, choose a dynamic color “test1” for line color, use the PV name “$(user):xxxExample” for Color PV.
Create an exit button. Do not check the “Exit Program”  option.
Save “relatedDsp”  and close it.
Execute “example4”
Click the Related Display button, the associated display should appear and the static text object should display the symbol value
Change the value of the PV from the example1 text control, the rectangle color should be determined by the color rule. Try values -1,5,10, and 20.
Click the Exit Button on each related display.
Click the Exit Button on “example4”, the main screen.
Does this exit edm?

EDM Exercise 5: Command Button and Embedded Displays
Open any of the examples.
Add a shell command button to start StripTool:
	Create a Control/Shell Command, set “Shell Command” to “StripTool”.		 
Execute.
Note how you can drag & drop (middle button) PV names from an edm object to StripTool’s channel name field.

Go back to Edit mode.
Add Graphics/Embedded Display by rubber banding a large area and Selecting Graphics/Embedded Window: Set “File” to “relatedDsp”, Set “Display Source” to “Form”.
Execute.
Note: You might need to set “Display Size” to be larger of the file “relatedDsp” and edit the Embedded Window Properties. Change the Display size by Middle Clicking the display background   and selecting “Display Properties” Change the height to a smaller size like 200 and the width to 400. Make sure all of your items are still visible.

EDM Exercise 6: Display Schemes
Create a new display using File/New
From the middle mouse button menu, select “Display Properties”.
In here, you can change the background color and select default fonts and colors for newly created display elements. Select a background color, click OK.
You would save the “Display Scheme” in case you want to create a standard setup (background color etc.) for part or all of your displays. In fact EDM automatically loads the file names “$EDMFILES/default.scheme” on startup, so by saving a scheme under that name, you determine the start-up defaults.
One quirk/feature is that EDM wants to save & load all display schemes in a global EDM configuration directory ($EDMFILES). That makes sense when you want to share display schemes with others, especially for the “default.scheme”. For this training however, keep all your files in your home/edm directory. 
Invoke the middle-button menu again, select Save Display Scheme, navigate to your home/edm directory, and create “training.scheme” (yes, the Motif-type file dialog is strange).
From the main window, choose File/Exit. There will be a warning because you didn’t save the display. That’s OK: We don’t care about the display, we only wanted to create a “Scheme”!
Restart edm, load one of your example displays, select “Load Display Scheme...” and load your “training.scheme” file. What changes when you do that?

EDM Exercise 7: Symbols
Create a new display, save it as “switch”.
Follow the “Creating symbol” slides to create the states of a simple switch:
broken, open, closed
Details:
Create an invisible rectangle
Draw invariant symbol components
Copy image and paste two copies to the display
Draw state dependent components
Arrange images in a rows/columns ordering, first state is upper-left, last is lower-right
If any objects have been grouped, un-group them now
Click middle button, choose Auto make symbol
Save symbol file as “switch” & close the display.
Create new display “example7”
Add text entry to control e.g. “$(user):aiExample”
Add a symbol instance (Monitor/Symbol)
Use symbol file recently created, use same PV as referenced in text entry object. Select 3 items, configure each as follows:
Item 1:     0 >= PV value < 1
Item 2:     1 >= PV value < 2
Item 3:     2 >= PV value < 3
Execute example7