CSIM Widget Library

Last modified: Mon Jan 27 16:14:06 EST 2003

i Contents

  1. Intro - Getting Gadget Package
  2. Stripchart Widget
    1. 2.1 Description
    2. 2.2 Usage
  3. Percent (Bar) Widget
    1. 3.1 Description
    2. 3.2 Usage
  4. Canvas Widget
    1. 4.1 Description
    2. 4.2 Usage
           

1. Intro

These gadgets can be included in your simulation models by downloading Gadget Package (Some users may need to right-click.).


2 Stripchart Widget

2.1 Description

The stripchart widget displays continuously scrolling bar charts. This can be used to display a short history of a quantity. For example, it is used by the perfmod2 CPU model to display the last seconds worth of CPU and queue utilization. The stripchart widget allows for the simultaneous display of up to four separate stripcharts in four different orientations.

2.2 Usage


3 Percent (Bar) Widget

3.1 Description

The percent or "bar" widget displays the current value of a quantity as rectangular bars. This is akin to the the progress bar widget available in other widget libraries. The percent widget can be used in either vertical or horizontal orientation and can display any number of simultaneous bars.

3.2 Usage

The percent widget has one function, percent_widget. This function should be called every time the value of one of the displayed quantities changes. Here is the prototype:

void percent_widget( char *obj_name, float value, float min_value,
float max_value, int color, int pos, int out_of,
int orientation )

Simply filling out the appropriate function arguments will produce the desired behavior.

obj_name is the name of the CSIM instance that will display the stripchart. Frequently obj_name is set to MY_NAME.

value is the current value of the quantity being updated.

min_value and max_value are the bounds of the quantity being updated e.g. 0.0 and 100.0 for percent.

color is the color of the bar being updated.

pos locates the bar being updated in the list of bars displayed.

out_of is the number of bars being displayed.

orientation is the a flag to set the orientation of all the bars in the widget. 1 for horizontal and 0 for vertical.


4 Canvas Widget

4.1 Description

4.2 Usage


Aron Rubin