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.
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.
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.