[Next] [Previous] [Up] [Top] [Contents] [Index]

Chapter 3 Working With Templates And Color Rules

1. Templates


A template could be any file that you use to create new displays. For example, you may want to create a number of display files that have the same default channel, that reference the same external color palette, that use the same default background and foreground colors, and that have the same size window. It would be much easier to simply create a display file that has all these attributes, and then each time you want to create a display, copy the display to a new file (see the section on the copy display option in the previous chapter). A template file could even have more precise uses. For instance, it could be precisely the same display, but the dynamic objects within it would use macros in place of channel names. A macro can be expanded to an actual channel name at run time; thus, you can use the same display to connect to different channels. When you run DM, you simply add an argument to the start up command that tells DM to replace the macro with the channel's name. See the next chapter, Chapter 4, Creating and Manipulating Objects, for more information on specifying channel names and macros, and see Chapter 9, DM: Run-time Operation, for information on expanding macros at run time.

Templates have three purposes:

1. To save time and effort when configuring display files.

2. To create a standardized color scheme for displays, so that the colors of objects are meaningful to the operator at run time.

3. To use the same color rules for all the displays on a subsystem or system, without having to configure the color rule or rules for each display.

4. To use colors efficiently, so that at run time a stack of displays does not use up too many colors on the monitor. (This applies mostly to EDD versions prior to 2.2, as these versions allocated their colors instead of sharing colors. See explanations below.)

1.1. Creating a New Display from a Template

A template file is any file that you use to create new files, in order to save time when configuring displays or to create a standard for displays in a system or subsystem. A template file could be an actual display file that is used at run-time and that is configured for a very specific purpose, but which you modify to serve another purpose. Or a template file could be a display list file that you never use at run-time, but that has some general configuration properties and attributes set so that you can create any number of displays using this template. Naturally, you will have to modify any template display file to some degree, but the amount of modifying required depends on how specific or general the information in the template file is.

To create a new display from a template:

1. Load the template file.

2. Invoke copy display from the display menu.

3. In the box that EDD brings up, enter the name of the new display in the file entry line.

4. Click execute on the choice button.

EDD opens a new display that is an exact copy of the template display with the name you gave it. Everything from the template display--every attribute, default, characteristic, property, object, and setting--is now a part of your new display. If the template file references a color template file for its colors, the new display will also reference the same file.

Figure 3-1 shows an example of a file that is used as a template for displays that monitor analog outputs during run time. Notice the macro $(chan) within the objects and near the top of the display: all macros go within parentheses and are set off by a '$' sign. At run time, the operator can expand the macro into a real channel name.

For more information on how to configure templates, you'll have to refer to the other parts of this manual. For more information on configuring global display attributes, see Chapter 2, Basic Operations. For more information on configuring particular objects, see the remaining chapters 4,5,6,7 and 8, and for information on configuring color rules, see the section Color Rules in this chapter.

Analog Template Display

1.2. Sharing Colors Among Displays

Recall from the last chapter that in EDD/DM versions prior to 2.2, displays allocated their colors and did not share them with other displays, unless they referenced a common file for their colors. If two displays had a color map that was not shared, even though the colors in their color maps were identical, the two displays used up the amount of colors equal to the sum of both their color maps. So, for instance, if two displays had an identical color map consisting of 25 colors, then when both displays were run simultaneously at run time, they would use up 50 colors between them, instead of 25. If enough displays that allocated colors in this way were run on a monitor at run time, sooner or later, depending on the color capabilities of the monitor, they eventually took up all the colors on the monitor. When this happened, any display that was brought up after all the colors had been allocated (with a related display callup button, for example) failed to load, or else failed to display all its colors. So to avoid this either the operator had to limit the number of displays he or she would use at run time, or displays had to reference a color template file.
NOTE: For EDD/DM versions 2.2 and after, displays share their colors, regardless of whether they reference a color template file. So it's not necessary for you to create a color template file if you're using 2.2 or a later version. However, blinking colors are always allocated and never shared, regardless of which version.

A color template file must consist of, at the very least, a color map and any color rules you wish to use (see the section Color Rules in this chapter for more about color rules). It is impossible for a group of displays to share colors but not color rules.

It is helpful but not requisite for a color template file to actually have objects within the drawing area. These objects are merely static as they will never be used in DM, but they can give anyone referencing the file a good idea of the color standard for which the color template file was meant. Figure 3-2 is an excellent example of a color template file. Note the objects in the drawing area: this color template, more than having a color map for other displays to share, is an actual guide that will help anyone to configure related displays according to its standard.

To reference a color template file as an external color palette:

1. Choose attributes from the modify display submenu.

2. In the text entry line that says external color palette display name, enter the name of the color template file you wish to reference.
IMPORTANT: When you reference a color template file as an external color palette, the color rules of the template file replace the color rules of the file that references the template file.

One important thing to note about color template files: when you try to edit the color rules or color map of a display that shares a color template file, a dialog box will appear. Essentially, it says that the current file uses another display for its colors or color rules, and if you wish you can receive a "local copy" of these colors. If you left-click copy in the choice button at the bottom of the dialog box, EDD will copy the color map and the color rules of the color template file to the display file you are editing, and the display will no longer share the color map or color rules with the color template file. Left-click cancel if you do not wish to do this.

A Color Template File

1.1. - Creating a New Display from a Template
To create a new display from a template:
1.2. - Sharing Colors Among Displays
To reference a color template file as an external color palette:

EDD/DM User's Manual, 2.4 - 27 MARCH 1997
[Next] [Previous] [Up] [Top] [Contents] [Index]


| LANL | Lansce | UC | DOE |

L O S   A L A M O S   N A T I O N A L    L A B O R A T O R Y
Operated by the University of California for the US Department of Energy

Copyright � 1996 UC   Disclaimer   


For problems or questions regarding this web site contact George Vaughn.