Measurement • 93
Gocator 2000 Family
Built-in Function
Built-in Function
Descriptions
int exists(char *name)
Tests for the existence of a measurement by name.
Parameter:
name – Name of a measurement
Return:
0 – measurement does not exist
1 – measurement exists
signed long long value (char *name)
Retrieves the value of a measurement by name.
Parameter:
name - Name of a measurement
Return:
Value of the measurement
0 – if measurement does not exist
signed long long decision (char *name)
Retrieves the decision of a measurement by name.
Parameter:
name - Name of a measurement
Return:
Decision of the measurement
0 – if measurement does not exist
int output(signed long long value, signed
long long decision)
Output a value and decision. The only last output value / decision in a script
run is kept and passed to the Gocator output.
Parameters:
value - Value output by the script
decision - Decision value output by the script. Can only be 0 or 1
Return:
0 – if not successful
1 – successful
Example: Manhattan distance
The following example demonstrates how to create a custom measurement that is based on the values
from other measurements.
// Constants for thresholds
signed long long decisionMin = 0;
signed long long decisionMax = 40000;
// Function to compute absolute value
signed long long abs(signed long long a)
{
if (a > 0) return a;
else return -a;
}
// Get the values from Width/Height measurements.
// Values are accessed with the ‘value’ function, and
// decisions with the ‘decision’ function.
signed long long width = value("Width");
signed long long height = value("Height");
// Calculate Manhattan Distance value and decision
signed long long manhattan = abs(width) + abs(height);
int result = (manhattan > decisionMin) && (manhattan < decisionMax);
// Emit final value and decision using the ‘output’ function
output(manhattan, result);
Summary of Contents for Gocator 2000 Family
Page 1: ...User s Manual Gocator 2000 Family Version 2 2 1 0 Revision A...
Page 164: ...Specifications 164 Gocator 2000 Family Envelope 61 25 40 5 4 15 82 9 95 7...
Page 166: ...Specifications 166 Gocator 2000 Family Envelope 33 90 80 2 9 84 3 99 7 10 6...
Page 168: ...Specifications 168 Gocator 2000 Family Envelope 190 210 33 141 3 155 7 4 11...
Page 170: ...Specifications 170 Gocator 2000 Family Envelope 33 300 400 214 9 229 2 10 3 3 2...
Page 172: ...Specifications 172 Gocator 2000 Family Envelope 33 400 500 216 2 230 6 3 9 11...