| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 9)

Creating G2-Meters

This section describes the steps for creating any kind of G2-meter. Types of G2-Meters lists all G2-meters and describes what each type does.

Before you can create a G2-meter, you must create a user-defined class called a G2-meter class. Every G2-meter is an instance of such a class.

To create a G2-meter class:

  1. Create a new class definition on a workspace:

  2. Give the class a unique name.

  3. Specify the class's direct superiors as quantitative-variable and g2-meter-data-service.

The g2-meter-data-service is a mixin class that sets the data server to g2-meter, and gives the class an additional attribute called g2-meter-name. For information about mixin classes, see Using Mixin Classes.

You can customize and subclass a G2-meter class in any way, as with any user-defined class. You can define as many customized G2-meter classes as you need. Such customization does not affect the essential operation of the class, so this chapter refers only to G2-classes in general.

To create a G2-meter:

  1. Create an instance of a G2-meter class.

  2. Edit the g2-meter-name attribute of the meter to specify the type of meter.

  3. Edit the meter's Names attribute to specify any available name.

  4. Edit the meter's Validity-interval attribute to be 0 seconds.

    The meter's Validity-interval cannot be supplied, because data derived by monitoring G2's performance has no intrinsic validity interval. Hence the g2-meter data server cannot supply explicit expiration times.

  5. Edit the meter's Default-update-interval to be 1 second.

    To correctly reflect the simulator's performance, the meter must be updated every second. The G2 Simulator is a superseded capability. For more information, see Appendix F, Superseded Practices.

  6. If you want to display the meter's readings on a graph, change History-keeping-spec to keep history.

  7. Create a display to show the meter's value. You can use any type of display. For information on displays, see Chapter 32, Readout Tables, Dials, and Meters.

If G2-meter-data-service-on? is enabled, the G2-meter begins functioning and displaying data as soon as you have completed its definition.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 9)

Copyright © 1997 Gensym Corporation, Inc.