Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
eyes:flowcontrol:calculate [2018/01/22 14:52] sfiedle [Usage] |
eyes:flowcontrol:calculate [2018/01/23 16:23] (current) sfiedle [Example] |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ===== Usage ===== | ===== Usage ===== | ||
| + | {{ :eyes:flowcontrol:calcprop.png?nolink|}} | ||
| This Flow Control element can apply standard arithmetic (+,-,*,/) onto a Variable. Furthermore, the modulo (%) and exponentiation (^) methods are implemented in Lua 5.1. | This Flow Control element can apply standard arithmetic (+,-,*,/) onto a Variable. Furthermore, the modulo (%) and exponentiation (^) methods are implemented in Lua 5.1. | ||
| - | To edit the formula fill in the Formula field in the Properties. Please note that Variables are called with cow.VariableName. | + | To edit the formula fill in the Formula field in the Properties. Please note that Variables are called with cow.VariableName.\\ |
| + | ** Computation with a constant ** \\ | ||
| + | cow.VariableName = cow.VariableName + ( any standard arithmetic symbol ) constant \\ | ||
| + | ** Computation with a other Cow Variable ** \\ | ||
| + | cow.VariableName = cow.VariableName + ( any standard arithmetic symbol ) cow.VariableName \\ | ||
| - | ** cow.VariableName = cow.VariableName + ( any standard arithmetic symbol ) constant/cow.VariableName ** | + | Recall that a calculation of a Variable of type decimal and a Variable of type integer returns a Variable of type decimal. \\ |
| + | \\ | ||
| + | \\ | ||
| - | {{ :eyes:flowcontrol:calcprop.png?nolink |}} | ||
| - | |||
| - | Recall that a calculation of a Variable of type decimal and a Variable of type integer returns a Variable of type decimal. | ||
| ===== Example ==== | ===== Example ==== | ||
| - | {{ :eyes:flowcontrol:examplecalc.png?nolink&800 |}} | + | |
| + | {{:eyes:flowcontrol:examplecalc.png?nolink&650 |}} | ||
| **Properties Window** | **Properties Window** | ||
| - | |< 100% 5% 35% >| | + | |< 100% 2% 40% >| |
| ^ ^ ^ | ^ ^ ^ | ||
| - | |{{:eyes:flowcontrol:a.png?nolink&40 |}}|{{:eyes:flowcontrol:boxinteger.png?nolink&600 |}}|The [[eyes:flowcontrol:variable|]] factor is passed to the logic [[eyes:logics:boxmanipulation|]]. Factor is used as the coarse factor for the selected processor Coarse.| | + | |{{:eyes:flowcontrol:a.png?nolink&20|}}|{{:eyes:flowcontrol:boxinteger.png?nolink&600|}}|The [[eyes:flowcontrol:variable|]] factor is passed to the logic [[eyes:logics:boxmanipulation|]]. Factor is used as the coarse factor for the selected processor Coarse.| |
| - | |{{:eyes:flowcontrol:b.png?nolink&40 |}}|{{:eyes:flowcontrol:varinteger.png?nolink&600 |}}|Here the [[eyes:flowcontrol:variable|]] called factor is of type integer with default value two. To see how to set up and use a [[eyes:flowcontrol:variable|]] follow the link.| | + | |{{:eyes:flowcontrol:b.png?nolink&20|}}|{{:eyes:flowcontrol:varinteger.png?nolink&600|}}|Here the [[eyes:flowcontrol:variable|]] called factor is of type integer with default value two. To see how to set up and use a [[eyes:flowcontrol:variable|]] follow the link.| |
| - | |{{:eyes:flowcontrol:c.png?nolink&40 |}}|{{:eyes:flowcontrol:groupcalc.png?nolink&600 |}}|After clicking into the grey part of the element [[eyes:flowcontrol:group|]] the properties window displays the current value of the [[eyes:flowcontrol:variable|]] factor.| | + | |{{:eyes:flowcontrol:c.png?nolink&20|}}|{{:eyes:flowcontrol:groupcalc.png?nolink&600|}}|After clicking into the grey part of the element [[eyes:flowcontrol:group|]] the properties window displays the current value of the [[eyes:flowcontrol:variable|]] factor.| |
| - | |{{:eyes:flowcontrol:d.png?nolink&40 |}}|{{:eyes:flowcontrol:examplecalcprop.png?nolink&700 |}}|The Calculate element displays the computation. Here the sum of the [[eyes:flowcontrol:variable|]] factor and one is written back to the [[eyes:flowcontrol:variable|]] factor.| | + | |{{:eyes:flowcontrol:d.png?nolink&20|}}|{{:eyes:flowcontrol:examplecalcprop.png?nolink&600|}}|The Calculate element displays the computation. Here the sum of the [[eyes:flowcontrol:variable|]] factor and one is written back to the [[eyes:flowcontrol:variable|]] factor.| |
| ===== Parameters and I/O ===== | ===== Parameters and I/O ===== | ||