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

Chapter 5 Graphics Objects

1. General Characteristics and Properties

The name of this subclass, graphics, is a kind of misnomer, for all objects--whether they be monitors, controllers, or plots--are graphics. Yet graphics is still a useful name for this subclass because people generally use these objects to enhance the overall appearance of the display and to provide visual aids for the operators. For instance, you will often want to add a title to the display using the text object in this subclass so that at run-time the operator knows exactly what the display is for--for a certain subsystem or for a specific process variable. Thus, graphics objects are mostly static, that is, they do not connect to channels at run-time, but they can also be dynamic when a color rule modifies them or they are modified by the visibility modifier.

1.1. Static and Dynamic Objects

Graphics objects are the only object subclass that can be both static and dynamic. The other subclasses are dynamic only. When you draw a graphics object, it is either automatically static or dynamic. Whether it is one or the other depends on the 'default color modifier' attribute and 'default visibility modifier' attribute in the Display Attribute window. If these defaults are set to anything other than static, then all graphics objects drawn will be automatically dynamic. If either of these defaults are set to static, then all graphics objects will be automatically static. When a graphics object is dynamic, it will have three properties in its property sheet that a static graphics object lacks: 'channel for dynamics,' 'color rule name,' and 'color rule arguments.'

To change a static graphics object to a dynamic one:

1. Bring up the object's property sheet.

2. Change the setting of the 'color modifier' property from static to rule. You can do this by holding down the right mouse button while the property is highlighted, which will bring up a menu with two options: static and rule. Choose rule.

You can also change a static graphics object to a dynamic one by changing the 'visibility modifier' property to either of its two dynamic settings. To do this:

3. Bring up the object's property sheet.

4. Hold down the right mouse button on the visibility modifier property, bringing up a menu with three options: static, if zero and if not zero.

5. Choose either if zero or if not zero.

To change a dynamic object to a static one:

1. Bring up the object's property sheet.

2. Change the 'color rule modifier' property and the 'visibility rule modifier' property to static by bringing up the menu for each property (hold down the right mouse button while the property is highlighted) and choosing static from the menu.

The property sheet for the object will change accordingly. See Figure 5-2 in the section on rectangles for an examples of a property sheet for a static rectangle. See Figure 5-3 for an example of a property sheet for a dynamic rectangle.

1.2. Channel for Dynamics

All graphics objects that are dynamic have a property called 'channel for dynamics.' In this property you specify a channel name for the graphics object.
NOTE: All graphics objects that have the 'visibility modifier' turned on must specify a channel name in this property, or else they will display the standard error message at run-time. You do not have to specify a channel in this property for a color rule. The channel that the color rule monitors is specified in the color rule arguments property (see Working With Templates And Color Rules in Chapter 3 ).

Remember from the introduction that the term channel can refer to any record or any record's field in an EPICS database that is accessible via Channel Access. However, since Channel Access was untied from the EPICS database, DM can now monitor and control non-EPICS process variables. Therefore, how you specify a channel name depends on the context you are working in. The main thing to remember is that channel names are case sensitive. Also, remember that DM passes to Channel Access the entire name string, including spaces.

Below follows a description of EPICS record names. Though EPICS-specific, it should be relevant even for non-EPICS process variables.

Basically, the format for a channel name is the record name and then the field name. The record name and field name are separated by a period ('.'). In addition, the record name may consist of several elements, identifying which database or subsystem it belongs to, as well as the record's particular name within that subsystem or database. However, record naming conventions vary from project to project and from site to site. An example of a channel name that you might enter in the text-entry line for the 'channel for dynamics' property might resemble the following:

Demo:ao1 is a record's name in a database. Demo is an element of a record name that identifies it as a record in a certain database, in this case the demo database. Ao1 is simply the record's particular name within that database. SEVR, on the other hand, refers to a field name in an EPICS record, in this case, an analog output record. The entire name is case sensitive, and the field name must always be uppercase, while the record name must match the case of record name in the database.

Any channel name must consist of a record name. A field name is optional because DM will automatically connect to the VAL field of a channel when no field name is specified. This goes for channel names with macro substitutions as well as other channel names. If you do specify the VAL field in a channel name, DM will still connect to the VAL field properly.

In EDD you can use macros that you can replace at run-time by a real channel name when you run DM. A macro is typically used to replace a record name, since record names vary for each individual record, while the field name is generally not replaced by a macro since field names are the same for each type of record. For example, all analog output records have the same set of fields. The following shows the format for a macro:

where chan is the macro string which is indicated by the dollar sign and parentheses $(). SEVR is the field name.

This macro could be expanded into a real channel name so that the object that contains this macro could be used to monitor the SEVR field for any EPICS record that contains such a field. The dollar sign and parentheses are characters that DM recognizes as containing a substitution string, the substitution string being any string of characters. In other words, chan in the above example could be channel or name or channame1 or whatever.

Macros can also be nested; that is, a macro can be placed within another macro. So, for instance, you could use two macros, one within the other, in place of two elements in a record name. An example of nested macros would be:


1.3. The Color, Default Edge and Fill Style Properties

All graphics objects, unlike objects in the other subclasses, only have one color property, aptly called the 'color' property. Nearly all the objects in the other subclasses have two color properties: 'foreground color' and 'background color'. The 'color' property of graphics objects inherits the 'default foreground color' in the Display Attributes window. You can change this color by holding down the left button on the property's color bar and choosing the desired color from the menu that appears. The 'color property' has no significance for an image object.

All graphics objects have 'edge style' and 'fill style' properties. These properties are inherited from the 'default edge and fill style' attributes in the Display Attribute Window and determine how the foreground and background colors are used. Each graphics object uses these properties differently, so you must refer to the section on each object for more information on edge and fill styles.

1.4. Visibility Modifiers

Graphics objects are the only objects that have the 'visibility modifier' property. There is a 'visibility modifier' attribute in the Display Attribute window, which is a default that all graphics objects inherit when you create them. In addition, each graphics object has a 'visibility modifier' property that sets the visibility modifier for that object, so you can override the 'visibility modifier' default setting.

If you highlight the 'visibility modifier' property in an object's property window and hold down the right mouse button, a menu with three options appears:

The if zero or if not zero options are the dynamic settings. They turn the visibility modifier on.

The visibility modifier monitors the channel specified in the 'channel for dynamics' property. As you can guess from the option names in the menu, the visibility modifier monitors a channel's values only according to whether it is zero or a number not equal to zero. It does not distinguish between 11 and 44 for example. Thus, you can see that its main use will be to monitor discrete or binary channels, though you could conceivably monitor analog channels to see if the channel is anything other than zero. The if in the options refers to when the visibility modifier will make the object appear: when set to the if not zero option, the object will appear when the channel's value is equal to any number other than zero and disappear when it equals zero; when set to the if zero option, the object will appear when the channel is equal to zero and disappear when equal to anything other than zero.

One thing to note is that when there is a problem with the channel connection--either a mistake in the channel name in the 'channel for dynamics' property or a problem with the IOC or channel access--during run-time a graphics object using the visibility modifier setting will be white and will display the message that all dynamic objects display when their channel connection does not work:

Not connected
No val
1.1. - Static and Dynamic Objects
To change a static graphics object to a dynamic one:
To change a dynamic object to a static one:
1.2. - Channel for Dynamics
1.3. - The Color, Default Edge and Fill Style Properties
1.4. - Visibility Modifiers

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.