/*
 * ENUM: SE_PREDEFINED_FUNCTION_ENUM
 *
 *   General comment:
 *      Comments for individual functions should signify argument usage by
 *      labeling the argument with capital letters, such that A = first arg.,
 *      B = second arg., etc.
 */
typedef enum
{
/*
****************************************************
* Standard math operators.
****************************************************
*/
/*
* Unary
*/
/*
* Binary, first of ordered arguments is "left" of the operator
* the second is "right"
*/
SE_FUNC_ADD, (notes)
SE_FUNC_DIV, (notes)
SE_FUNC_MOD, (notes)
SE_FUNC_MULT, (notes)
SE_FUNC_SUB, (notes)
/*
*********************************************************
* Trigonometric functions; each should take one argument.
* See the standard C math library for details.
*********************************************************
*/
SE_FUNC_COS, (notes)
SE_FUNC_SIN, (notes)
SE_FUNC_TAN, (notes)
SE_FUNC_ACOS, (notes)
SE_FUNC_ASIN, (notes)
SE_FUNC_ATAN, (notes)
SE_FUNC_ATAN2, (notes)
SE_FUNC_HYPOT, (notes)
/*
****************************************************
* Other math functions
* See the standard C math library for details.
****************************************************
*/
SE_FUNC_ABS, (notes)
SE_FUNC_EXP, (notes)
SE_FUNC_LN, (notes)
SE_FUNC_LOG, (notes)
SE_FUNC_POW, (notes)
SE_FUNC_SQRT, (notes)
SE_FUNC_MAX, (notes)
SE_FUNC_MIN, (notes)
/*
****************************************************
* Logical operators
* The logical operators work like C logical operators.
* Operands with the value of "O" are interpreted as FALSE,
* while operands with non zero values are TRUE.
* These functions will return 0 for FALSE and 1 for TRUE.
****************************************************
*/
/*
* Unary
*/
SE_FUNC_NOT, (notes)
/*
* Binary, first of ordered arguments is "left" of the operator
* the second is "right"
*/
SE_FUNC_AND, (notes)
SE_FUNC_EQUAL, (notes)
SE_FUNC_GT, (notes)
SE_FUNC_GTE, (notes)
SE_FUNC_LT, (notes)
SE_FUNC_LTE, (notes)
SE_FUNC_NOT_EQUAL, (notes)
SE_FUNC_OR, (notes)
SE_FUNC_XOR, (notes)
/*
* N-ary, see individual comments for argument usage.
*/
SE_FUNC_IF, (notes)
/*
****************************************************
* Constants, these require no arguments
****************************************************
*/
SE_FUNC_PI, (notes)
SE_FUNC_TRUE, (notes)
SE_FUNC_FALSE, (notes)
/*
****************************************************
* "Special" functions.
****************************************************
*/
SE_FUNC_GMT, (notes)
SE_FUNC_LOCAL_TIME, (notes)
SE_FUNC_SIM_TIME, (notes)
SE_FUNC_SIM_UTIME, (notes)
SE_FUNC_REFERENCE_SURFACE_ELEVATION, (notes)
SE_FUNC_CYCLE_TIME, (notes)
SE_FUNC_TOD, (notes)
SE_FUNC_TOY, (notes)
SE_FUNC_WIND_DIR, (notes)
SE_FUNC_WIND_SPEED, (notes)
SE_FUNC_HUMIDITY, (notes)
SE_FUNC_RAIN_RATE, (notes)
SE_FUNC_TEMP, (notes)
SE_FUNC_SUN_DIR, (notes)
SE_FUNC_SUN_ELEV, (notes)
SE_FUNC_TABLE_VALUE, (notes)
/*
****************************************************
* Misc. functions
****************************************************
*/
SE_FUNC_NONE (notes)
} SE_PREDEFINED_FUNCTION_ENUM;


Enumerator Notes

SE_FUNC_ADD

 A + B

SE_FUNC_DIV

 A / B

SE_FUNC_MOD

 A % B

SE_FUNC_MULT

 A * B

SE_FUNC_SUB

 A - B

SE_FUNC_COS

 cos(A)

SE_FUNC_SIN

 sin(A)

SE_FUNC_TAN

 tan(A)

SE_FUNC_ACOS

 acos(A)

SE_FUNC_ASIN

 asin(A)

SE_FUNC_ATAN

 atan(A)

SE_FUNC_ATAN2

 atan2(A)

SE_FUNC_HYPOT

 hypot(A, B)

SE_FUNC_ABS

 abs(A) : absolute value of "A"

SE_FUNC_EXP

 e^A

SE_FUNC_LN

 ln(A) : natural log of "A"

SE_FUNC_LOG

 log(A, B) : log, base "B" of "A"

SE_FUNC_POW

 A^B

SE_FUNC_SQRT

 sqrt(A)

SE_FUNC_MAX

 if (A > B) return A; else return B;

SE_FUNC_MIN

 if (A < B) return A; else return B;

SE_FUNC_NOT

 !A

SE_FUNC_AND

 A && B

SE_FUNC_EQUAL

 A == B

SE_FUNC_GT

 A > B

SE_FUNC_GTE

 A >= B

SE_FUNC_LT

 A < B

SE_FUNC_LTE

 A <= B

SE_FUNC_NOT_EQUAL

 A != B

SE_FUNC_OR

 A || B

SE_FUNC_XOR

 A ?? B

SE_FUNC_IF

 if (A) return B; else return C

SE_FUNC_PI

 3.14..., well, you know the rest

SE_FUNC_TRUE

 1

SE_FUNC_FALSE

 0

SE_FUNC_GMT

 Returns time, in floating point seconds, since
 00:00:00 UTC, January 1, 1970.

SE_FUNC_LOCAL_TIME

 Returns time, in floating point seconds, since 00:00:00, January 1,
 1970 in the time zone containing latitude=A longitude=B (degrees).

SE_FUNC_SIM_TIME

 Returns time, in floating point seconds, since simulation start.

SE_FUNC_SIM_UTIME

 Returns time, in unsigned microseconds, since simulation start.
 The value is allowed to overflow and roll back to zero.

SE_FUNC_REFERENCE_SURFACE_ELEVATION

 Returns the height of the terrain at the point specified by the
 arguments.  Arguments are interpreted as coordinates within the currently
 scoped spatial reference frame defined by the current transmittal.
 Argument order should match the field order defined by <Location 3D>.

SE_FUNC_CYCLE_TIME

 Returns a cycling time value in seconds of the kind specified by the
 arguments. These arguments are:
 A - a trigger boolean to start the cycle(s)
 B - cycle length in seconds
 C - a function that returns time in seconds (e.g. SE_FUNC_SIM_GMT)
 D - number of cycles to do before stopping
 E - cycle time at which to start
 F - cycle time at which to end
 G - Boolean specifying whether the cycle runs one way
     (e.g. start > end, start > end) or whether it reverses at the end
     (e.g. start > end > start)

SE_FUNC_TOD

 Returns simulation Time of Day in hours and fractions of hours.

SE_FUNC_TOY

 Returns simulation Time of Year in days since January 1st.

SE_FUNC_WIND_DIR

 Returns simulation wind direction in degrees, measured anti-clockwise
 from geographic north.

SE_FUNC_WIND_SPEED

 Returns simulation wind speed in m/s.

SE_FUNC_HUMIDITY

 Returns simulation relative humidity in range 0-1.

SE_FUNC_RAIN_RATE

 Returns simulation precipitation in centimeters per hour.

SE_FUNC_TEMP

 Returns simulation temperature in degrees Celsius.

SE_FUNC_SUN_DIR

 Returns simulation sun direction in degrees, measured anti-clockwise from
 geographic north.

SE_FUNC_SUN_ELEV

 Returns simulation sun elevation, in degrees above horizon.

SE_FUNC_TABLE_VALUE

 Used to allow a <Data Table> to drive a <Control Link>.

 Contains a <Property Table Reference> as an argument, which references
 the <Data Table> (usually, this will be a <Property Table>). The values
 should be stored in cells with a <Property> that is defined by the
 EDCS Attribute Code (EAC) of the type appropriate for the target
 <Control Link> that is to be driven.

 This <Predefined Function> is contained by the target <Control Link>,
 and thereby returns the value referenced from the <Property Table> as
 the value that drives the target <Control Link>. The <Property Table
 Reference> can itself be controlled using a <Property Table Reference
 Control Link>, allowing different values to be referenced from the
 <Property Table>.

SE_FUNC_NONE

 Just a place holder for the end of the enumeration.
Prev: SE_POLYGON_FLAGS_ENUM. Next: SE_PREDEFINED_FUNCTION_ARGUMENT_TYPE. Up:Index