Difference between revisions of "T-VEC Tablular Modeler Examples"

From T-VEC Wiki
Jump to: navigation, search
Line 39: Line 39:
 
====Structure Type Definition====
 
====Structure Type Definition====
  
Structure types are represented hierarchically. Structure field names must be associated with a scalar or predefined structure type as shown below
+
Structure types are represented hierarchically. Structure field names must be associated with a scalar or predefined structure type as shown below.
  
 
[[Image:Structure type.png|center|Structure Type]]
 
[[Image:Structure type.png|center|Structure Type]]
Line 51: Line 51:
 
  structure1 = structure2
 
  structure1 = structure2
 
  structure_name.field1 = function(param,…);
 
  structure_name.field1 = function(param,…);
 +
structure1.field_integer < structure2.field_integer
  
 
====Structure Assignment Usage====
 
====Structure Assignment Usage====
  
For outputs, terms or functions, a structure field elements can assign a value to one or more field elements terminated by a semicolon. For example, the vertical tracker3 example that is provided as part of the installation illustrates the use of an assignment to a structure type with two fields (tState and tStatus):
+
For outputs, terms or functions that are structures, a field element can be assigned a value to one or more field elements where each assignment is terminated by a semicolon. For example, the vertical tracker3 example that is provided as part of the TTM installation illustrates the use of an assignment to a structure type with two fields (tState and tStatus):
  
 
  tState = FAIL;
 
  tState = FAIL;
 
  tStatus = currentStatus;
 
  tStatus = currentStatus;
  
Only the field elements need to be used on the left side of the assignment. Individual field elements of an inputs such as sensorData.trk1 shown in the example with functions below must be fully qualified.  
+
Only the field elements need to be used on the left side of the assignment. For inputs each field elements must be fully qualified such as sensorData.trk1 shown in the example below.  
  
 
===Functions===
 
===Functions===
Functions are parameterized condition tables. For example the tracking avoidance example provides several uses of functions such as:
+
Functions are parameterized condition tables. For example the tracking avoidance example provides several uses of function usage such as:
 
*trackAttributes(sensorData.trk1)
 
*trackAttributes(sensorData.trk1)
 
*advisoryStatus(sensorData)
 
*advisoryStatus(sensorData)
Line 73: Line 74:
 
  INTERM_x := function(a, b, c)
 
  INTERM_x := function(a, b, c)
  
Note INTERM assignment operator is := as opposed to equality relational operator =
+
Note the INTERM assignment operator is ":=" as opposed to equality relational operator "=:". INTERM variables can be constrained in condition, but must be assigned from the function before additional constraints are applied as shown in the example above. INTERM variables can be assigned to output variable associated with table.
 
+
*INTERM variables can be constrained in condition, but must be assigned from function before additional constraints are applied as shown in the example.  
+
*INTERM variables can be assigned to output variable associated with table
+
  
 
===Arrays===
 
===Arrays===
Single dimensional arrays are supported for structures and scalars.
+
Single dimensional arrays are supported for structures and scalars. The following provides an example for defining an array. Provide a name and selected a data types and check the box indicating that the type is an array. Finally, supply an positive integer indicating the size of the array.
 +
 
 +
[[Image:Array_type_declaration.png|center|Array Types]]
 +
 
 +
Arrays are referenced similar to structures or scalars, but using square brackets. An array of size 4 has three elements:
 +
 
 +
  a[0], a[1], a[2] and a[3]
 +
 
 +
Arrays elements or an entire array can be referenced in a condition or an assignment. If a variable is used to index an array, then the range of the variable must be constrained to the size of the array. The following examples shows three different ways to assign array information to an array of structures.
 +
* Row 1 shows that the output array is assigned the input array inArray
 +
* Row 2 shows that the zeroth element of the array is assigned two different field values, one for status and another for value
 +
* Row 3 shows that the output array associated with index is assigned to the index of inArray
 +
 
 +
[[Image:Array_reference.png|center|Array Reference]]
  
 
==Modular Organization==
 
==Modular Organization==

Revision as of 10:20, 16 October 2008