constraint
Defines the choice constraint for a parameter. For INT_CHOICE constraints, the integer value is defined with the key attribute and the text to display is the text content of the tag. For STRING_CHOICE constraints, each constraint tag contains a value to populate a combo-box drop-down.
The parameter must have a constrainttype of INT16_CHOICE, INT32_CHOICE or STRING_CHOICE.
Syntax
<constraint key="choice1-key">choice1-value</constraint>
Attributes
Attribute |
Values |
Restrictions |
Description |
key |
Integer |
Not required for STRING_CHOICE constraints |
Numeric assignment of current enumerated choice. |
value |
String |
|
Text name for the current enumerated choice |
Examples
The following constraint provides an enumerated choice:
<param constrainttype="INT_CHOICE" name="Channel" oid="0x503" type="INT16_PARAM">
<constraint key="0">Channel 01</constraint>
<constraint key="1">Channel 02</constraint>
<constraint key="2">Channel 03</constraint>
<constraint key="3">Channel 04</constraint>
</param>
The following constraint provides a list of selections for a STRING parameter:
<param constrainttype="STRING_CHOICE" name="Name" oid="0x504" type="STRING">
<constraint>Jeremy Clarkson</constraint>
<constraint>James May</constraint>
<constraint>Richard Hammond</constraint>
<constraint>The Stig</constraint>
</param>