CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


software:gui-designer:math-expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

software:gui-designer:math-expressions [2012/12/21 04:51]
jarrod
software:gui-designer:math-expressions [2015/04/09 00:58] (current)
jarrod [Numbers and text output formatting]
Line 15: Line 15:
 \\ \\
 Within commands, math expressions must be enclosed in double curly braces, the result of the math evaluation is converted to a string (and can be optionally formatted the way you need it). Math expression can also be used in the transform field of '​capture group' feedback items (where the incoming data type is set to Analog), in which case you won't use the double curly braces to enclose the expression. Within commands, math expressions must be enclosed in double curly braces, the result of the math evaluation is converted to a string (and can be optionally formatted the way you need it). Math expression can also be used in the transform field of '​capture group' feedback items (where the incoming data type is set to Analog), in which case you won't use the double curly braces to enclose the expression.
 +
 +<WRAP center round important 90%>
 +Do NOT use the double curly braces in the ''​capture group > transform''​ property in your feedback parsing. They are not needed in the transform property because this field can **only** contain math expressions. Read the above paragraph for more details.
 +</​WRAP>​
 +
  
 <​code>​ <​code>​
Line 34: Line 39:
 When using a math expression, you can specify an output format prefixed by a colon before the closing accolades. If you omit the format, the result will be formatted as an integer. When using a math expression, you can specify an output format prefixed by a colon before the closing accolades. If you omit the format, the result will be formatted as an integer.
 <​code>​ <​code>​
- {{software:​gui-designer:​system-manager:​feedback-parsing:​math expression}} -> will output an integer without any decimal points+ ​{{math expression}} -> will output an integer without any decimal points
  
  ​{{math expression:​}} -> will output a double with full decimal points  ​{{math expression:​}} -> will output a double with full decimal points
Line 47: Line 52:
 Math expressions can also be used in feedback '​capture group' items, within the transform field. This works same as above, but you don't have to wrap the expression in curly braces.\\ Math expressions can also be used in feedback '​capture group' items, within the transform field. This works same as above, but you don't have to wrap the expression in curly braces.\\
 \\ \\
-With transforms, one predefined constant is set ("​value"​) which is the value extracted from the capture group, and can be used in the math computation.+With transforms, one predefined constant is set ("​value"​) which is the value extracted from the capture group, and can be used in the math computation.\\ 
 +<WRAP center round tip 80%> 
 +Note that the '​value'​ constant does not support decimal values when using an Analog data type. The constant will always be rounded to a whole number before any transform can take place.\\ 
 +So you need to capture it into a serial join first, then use [[#​referencing-other-groups|capture group name referencing]] to perform any math on this value if you need the initial captured value to support decimals. 
 +</​WRAP>​
  
  
software/gui-designer/math-expressions.1356065518.txt.gz · Last modified: 2012/12/21 04:51 by jarrod