F-16_ViperDenUpX.zip > gauges > AERIT-F104S-ASA-Gauges > dsd_random_number_readme.txt
 
Back to zip content
Gauge: dsd_random_number.gau
There are two separate sub-gauges, both of which will generate pseudo-random numbers and assign 
them to xml L:variables.
=======================
The first is dsd_random_number!random_number
This gauge generates a continually changing series of random numbers which are assigned 
to L:variables.
The L:Vars are in the form 'dsd_random_XX' with the values of XX ranging from 00 to 99.
The default number of values is 36, with a minimum of 1 and a maximum of 100.  
The number of values is specified as a parameter in panel.cfg
This entry:
gauge56=dsd_random_number!random_number,  5,5,20,20,12
specifies 12 values.
Note that it takes a while to generate all the values, 
as you can only generate 1 on each gauge update.  
On initialization, each element in the array is set to a value of -1, 
so you can test against that value before you use the L:Var for anything.  
The gauge continues to update the values throughout its life.
In effect, it continually scrolls through the list of L:Vars, 
assigning a new value to one L:Var on each gauge update.  
The more values you have chosen, the less frequently the values will change.
========================================================================
The second sub-gauge, dsd_random_number!single_instance, works exactly the same way, 
except it does not update the values generated.  
It creates one set and then just leaves the L:Vars alone.
These L:Vars are named 'dsd_single_random_XX'.  
Again, XX is a value between 00 and 99.  
The number of values generated is still specified on the panel.cfg line, 
and the default is again 36. 
Because the L:Var names are different, the two sub-gauges can be placed on the same panel. 
As such, you can have one set of randomly generated, constant values, 
along with a set of random values that changes over time.

Doug Dawson
Toronto, Canada
April 26, 2005
douglassdawson@netscape.net