Field data types
- Last UpdatedApr 11, 2024
- 1 minute read
All node types have several properties, known as fields.
-
Each parameter has a type.
-
Consider node type when assigning a value to a field inside the scripts, or when connecting fields of different node instances.
Types
Defining value types
Some nodes, such as Struct and Var, have a parameter to specify their value type.
In this case, indicate the type in lower case.
Code example
This is a code example of defining value types.
<struct name="timeStruct">
<field type="sevent" name="start"/>
<field type="senum:one,two,three" name="version" value="two"/>
<field type="sfloat" name="duration"/>
<field type="sint" name="duration2" value="0"/>
<field type="sstring" name="stringa" value="pipponio"/>
</struct>
<var name="dosimetro_val" value="0.0" type="sfloat"/>
Some data types have a particular proprietary syntax.
|
Data type |
Syntax |
|---|---|
|
senum |
senum:item1,item2,item3 |
Subattributes
Field parameters have some subattributes that can be referenced inside a script.
The syntax for accessing field subattributes is:
fieldNam.subAttributeName
For example: buttonPressed.isModified
Applying subattributes
You can apply a subattribute to a particular parameter by appending the subattribute syntax to the parameter name, separated by a period.
For example: buttonXXX.buttonPressed.isModified
Some subattributes requires input values to be passed inside brackets. All assignments modes are supported, so these values can also be passed as reference.
For example: valveXXX.extraParams.setElementAt([@aVar.field],100)
Note: Due to their nature, subattributes do not support text escaping.