enums
The enums element contains enumerated values that are consolidated in one place to be referenced by multiple data groups. The enums element is a template-specific means of consolidating enumerations. Its element contents must include at least one child container element, which in turn contains one or more enumerated empty elements. The enums element is typically included toward the end of a device template file, like a book's index, but this is not required. Enumerations within an enums element are referenced by using a mapVal attribute in a referencing data group element, eFMS, or eGMR element. Alternatively, you can define enumeration tables on a per-data group basis by using enumeration reference methods.
This element is:
- Case sensitive
- Required in every CygNet device template file that uses a template-specific enumeration table
- Used 1 time per CygNet device template file
To learn about how this element relates to other elements in a CygNet device template file, see Device Template File Hierarchy.
Example
|
<!-- The following example shows a simplified data group element called EnumT. EnumT references another data group element called raw5, which in this example returns the numeric value 5. EnumT then uses a mapVal attribute to reference the enumRefOpt container element within the enums element. The enumeration value from enumRefOpt that corresponds to 5 contains the string value "Text 5". The enumerations (i.e., empty elements) within enumRefOpt can be referenced by multiple data groups and/or data group elements from within the same device template file. If raw5 returned a value greater than 6 (in this example), the defVal value "Default Text" would have been returned. --> <dataGroups> <DataGroup> <dgElements> <raw5 desc="Raw Value 5" type="ui2"/> <EnumT desc="Template Enumeration Lookup" readOnly="true" type="string" ref="raw5" mapVal="enumRefOpt"/> </dgElements> </DataGroup> </dataGroups> ... <enums> <enumRefOpt> <e0 value="Text 0"/> <e1 value="Text 1"/> <e2 value="Text 2"/> <e3 value="Text 3"/> <e4 value="Text 4"/> <e5 value="Text 5"/> <e6 value="Text 6"/> <defVal value="Default Text"/> </enumRefOpt> </enums> |
Supporting Elements
The following table lists and describes special child elements used within an enums element's container elements.
| Attribute | Description |
|---|---|
|
ex |
Empty elements are used within a container element to make up a list of possible values. Each enumeration must begin with a lowercase e. It is then to be followed by a non-negative integer. The integers used do not need to be sequential. For instance, you could use 0, 4, and 7. Each enumeration element must be unique, but its value does not need to be unique. For example, using e1 twice within a single enumeration list is illegal. But using the value "Some Meaningful Text" for e1 and e2 is legal. Each enumeration must use a value attribute to define a constant value that corresponds to the enumeration. |
|
defVal |
defVal defines a default value to be automatically returned in the event that certain conditions are not met in a container element. Currently, defVal is used in two situations. The first situation is when an enumeration requested by a referencing data group element, eFMS, or eGMR element does not match what is requested. The second situation is when no conditions defined in a selection element are met. |
Attributes
The following table lists and describes attributes generally applicable to this element. However, not all of the attributes listed here are applicable to all EIEs. Additionally, some attributes are required for use in every device template file of a certain EIE, but others may be used on a case-by-case or device-by-device basis, depending on your specific needs. All attributes in templates are case sensitive; but the case sensitivity of attribute values is based on context.
Note: Occasionally, device template files for different EIEs use attributes of the same name that do different things. Efforts are made in this document to highlight cases where an attribute by one name does different things in different EIEs.
| Attribute | Description |
|---|---|
|
value |
value specifies a constant value. The value used must be relevant to the context in which value is used. Value:
|


