Sidebar

software:gui-designer:system-manager:feedback-parsing:feedback-properties

Feedback Properties

The Feedback Properties dialog is opened when you are adding a new feedback item when you double click on an existing feedback item within the System Manager tree view to edit its properties.

System

Select the existing External System to assign the feedback item to. You must have at least one system defined in your project to add a feedback item.

Feedback Name

The feedback name must be a unique name in your project (no systems, commands, macros or feedback parsing can have the same name). When entering the name details, the OK button will be disabled if the name is already in use within the project.
The feedback name will be used to identify the feedback within the System Manager tree.

List Join

When you want to assign captured data to a list object, you must enter the join number of the list you want to assign data to. Assigning a list join other than zero means that any joins you target in feedback capture groups will only related to items within the specified list. Leave it set to zero if you are not wanting to assign captured data to a specific list.

Regex

This is where you enter the regular express that will be used to parse the feedback. See Feedback Parsing for more information on defining regular expressions for use with system feedback parsing.

Feedback Processing Order

Using the toolbar, you can add new capture groups and onmatch items, as well as adjust the order in which they are processed, and also delete items from the processing order.
The order of items is important as it defines the order that they are processed when the regex matches incoming data.

Capture Groups

For each capture group in the defined regex (basically the parts between the round brackets) you should define an associated Capture Group item.
Each capture group has a few options which can be defined:

Name

The name of the capture group is for identification purposes, as well as defining the token name if you are assigning a token. You can enter any name you like, but the idea is to use a descriptive name so when come back to edit the feedback properties again later, you can easily remember what data the capture group is meant to be capturing. If assigning a token, we recommend wrapping the name in square brackets so you can easily identify the token name when using it in dynamic commands, etc, later on.

This name can be referenced in other feedback properties by wrapping the name in dollar signs. So for example, if the capture group was given a name myData then we could reference it within other capture groups or onmatch items within the same feedback item by using $myData$.

Capture Index

This identifies which capture group in the regex that this group is referencing. The index is 1-based, so the first capture index is index 1.
You can create multiple capture groups that reference the same capture index if you need to do multiple things with the same captured data (for example, set both an analog and a serial join).

Data Type

The data type of the join number assigned to this capture group. The options are:

  1. Digital
  2. Analog
  3. Serial

See the Join Types page for more details on join data types. Note that this data type refers only to the data itself that is coming in. Different data types have different options (more info below).

Target Type

This is the type of object you are targeting with the capture group. The options are:

  1. Digital
  2. Analog
  3. Serial
  4. List
  5. Global

A Global target type can only be used for setting global tokens.

Join

The join number of the target type to assign the captured data to. This join number should match a GUI object within your project pages and subpages.

Token Type

This property allows you to set the value of a join, the value of a token on a specific object, or both at the same time.
For example, if you want to set a join value of an object, you would leave this set to 'value'. If you wanted to set a token on an object (or a global token), this should be set to 'token'.
Otherwise, if you wanted to both set the join value of an object, and set a token on the object, you would set this option to 'both'.
If you select to set a token (or both), then the token name is taken from the Name property of the Capture Group (described above).

Read more about tokens in our Tokens wiki page.

Min Val & Max Val

The minimum and maximum value options are only relevant if the Data Type is set to 'Analog'. They allow for the value to be scaled to the 0 to 65535 range that sliders and gauges use.
For example, if your TV set reports a volume range from 0 to 100, and you want to display this data in a gauge, you would want the gauge to be full at 100 and empty at 0. So set the min val to 0 and the max val to 100, then any values between that range that parse through the feedback system will be scaled to the 0 to 65535 range before being assigned to the analog join.

Off Value & On Value

The off and on value options are only relevant if the Data Type is set to 'Digital'. They allow for the value to be set to a boolean value (0 or 1) no matter what the captured value i For example, if your TV set reports the power status with the text 'POFF' and 'PON', and you want to display the power status on a button state, you would need the digital join value to be set to 0 or 1 depending on the captured value of 'POFF' or 'PON'. So set the 'Off Value' to the string 'POFF' and the 'On Value' to the string 'PON' and when the feedback system parses the capture group, it will set the digital join value to 0 if the string matches 'POFF' and set the digital join value to 1 if the string matches 'PON'.

If only the off value or only the on value is assigned a value (and one of them is left blank) then the join will change state to the defined value only on an exact match, and all other times would change to the undefined value. For example, if the 'on value' was assigned a value of “PON” then the digital join would only be set high/active when the exact text “PON” is received. Any other data captured would result in the join being set low/inactive.

Transform

This option is only relevant if the Data Type is set to 'Analog'. This allows you to perform math expressions on the captured value before assigning it to the chosen join or token.
See the Math Expressions entry for more details on how to use this field.
You can enter the value captured by the capture group simply as value.
You can use data captured by other capture groups into the transform field by referencing their name wrapped in dollar signs, eg. $captureGroupName$.

For example, you could dynamically set the join value using some math and using data from another capture group like so: (value/100)*$myData$ where myData is the name of another capture group in your feedback item.

Hex Data

This option is only relevant if the Data Type is set to 'Analog'. This allows you to convert a hex value to a decimal value using the following options:

  • Non-hex - In this mode, the Hex Data option has no effect on the captured data. Use this mode (default) if you are not capturing hex data.
  • Hex Byte mode - In this mode, the parser will convert the captured bytes into a decimal value. Up to 4 bytes (Long) can be converted to a decimal value.
  • Hex String mode - In this mode, the parser will convert captured string data in hex format into a decimal value. Up to 8 chars (4 bytes, Long) can be converted. The captured data must only contain valid hex characters (0-9, a-f, upper or lower case). This mode will also convert a single character to a decimal value (without a leading zero), ie. 'd' converts to 13.

List Index

This option is only relevant if the List Join is a number above zero. This allows you to calculate which item in a list that captured values in this feedback item will be assigned to. This is a Math Expressions, where the 'value' variable is set to the captured value of the capture index.
For example, if part of the incoming message specified a list index, you can capture it and use the value to tell the feedback item which index it is assigning other capture group join values to. Remember that the list index is zero-based, so a common use of this property is to set it to 'value-1' if the incoming data is 1-based.

OnMatch Items

Along with capture groups, the feedback processing order can include onmatch items. These are used to set the value of a join or token when a match is found. Unlike capture groups, these allow you to set a join or token to any value, rather than a captured value. Even a dynamically calculated join number can be used, by referencing capture group names within the join property of the onmatch item. See a demo of dynamic join value assignment on GitHub.

OnMatch Target Type

Refer to Target Type in Capture Group description above. This property works exactly the same for both Capture Groups and OnMatch Items.

OnMatch Join

Again, refer to Join properties in the Capture Group description above. The only difference here is that onmatch items can dynamically assign the join number using math expressions and referencing other capture group names (by wrapping them in dollar signs). See a demo of dynamic join value assignment on GitHub.

Assign Token

This option allows you to choose whether you want to assign a value to a token or join.

Token Name

This option is only relevant if the Assign Token option is set to True. When assigning a token, this is the name of the token to be assigned. This name is how you reference a token in other aspects of guiDesigner, such as in dynamic Commands.

Value

The value property is where you enter the value you want to assign to the join or token. This property allows you to embed math expressions by wrapping the math in double curly braces. You can also reference other capture indexes by name in the value field, by wrapping the capture group name in dollar signs.

See the Math Expressions entry for more details on how to use this field. As an example, you could set the value property to any of the following:

  • 10
  • this is a text value
  • {{10*[sometoken]}}
  • this is mixing text with [sometoken] and math {{10*[sometoken]}}
  • this is referencing another $captureGroupName$
software/gui-designer/system-manager/feedback-parsing/feedback-properties.txt · Last modified: 2014/06/30 03:42 by jarrod