Type description
Type descriptions, as class descriptions, reside in a class volume. They are placed in a
separate hierarchy under a $TypeHier object. Types are divided into two categories, base types
and derived types.
Base types
Base types are defined in the system volume pwrs. Example of base types are Boolean, Float32,
Int32, String, Enum and Mask.
Derived types
Derived types can be defined in any classvolume. They consist of
- arrays of base types, e.g. String80.
- enumeration types, Enum, with defined characterstrings for various values.
- bitmasks, Mask, with defined strings for various bits.
$TypeHier
Type descriptions are placed under the root object 'Type' of class $TypeHier. The $TypeHier
object has $Type and $TypeDef objects as children.
$Type
Description of a base type. This object is reserved for the system volume pwrs.
$TypeDef
Description of a derived type. The attribute 'TypeRef' contains the base type. The most
common usages are strings and texts with specific size, and enumeration types and bitmasks.
To define an enumeration type, the basetype should be $Enum. Below the $TypeDef object, texts
for different values are defined with $Value objects. When the value of an attribute of the
type is to be displayed, the text that corresponds to the value is displayed. When the
attribute is given a value, the different texts are viewed with check boxes and you select
one alternative.
To define bitmasks the basetype $Mask is used. Below the $TypeDef object, texts are defined
for different bits by $Bit objects. When the attribute is given a value, the texts are
displayed with check boxes, as for enumeration types. For bitmasks, several alternatives can
be chosen.
$Value
Defines a value in an enumeration type. The value corresponds to a text, that is viewed in
the configuration and in xtt when the attribute is opened. In the includefile for the volume,
an enum declaration is created that can be used in c-code.
$Bit
Defines a bit in a bitmask. The bit corresponds to a text that is viewed in the configurator
and in xtt when an attribute of the type is opened. In the includefile for the volume, an
enum declaration is created that can be used in c-code.