The tab called "Formula" will be available once the process value type with the same name is selected in the first tab.
From versoin 24.4.0 it will be possible to evaluate mathematical formulas of the type Boolean.
From version 24.3.0 this section has new functionality. A new button will appear that is called "Test". As the name implies this is used to test formulas and then evaluate the result. Once pressed, a new form will appear in which it is possible to evaluate the formula. In this new form it is also possible to add new parameters, as well as change what the value is based on.
In the example below a formula is entered with different parameters separated with [] signs. Use the new "Test" button to edit the parameters value, and then evaluate the result. When the parameters for width, height, and C have values, it is possible to use the "Evaluate" button to see the result of the formula.
The idea behind the form for evaluation is to make it easier to test formulas when more complex formulas with multiple parameters are used.
At the bottom of the page there is information/examples of more formulas that can be used in this form.
What happens here is that other process values can be entered as a basis for a mathematical formula. Internally they will be referred to as [record_no x] where x is the process value. *
* The information below is intended as internal documentation for the developers at Delacroy.
The first list will go through the functions available, and the list below that will go through available operators.
The framework includes a set of already implemented functions.
Name | Description | Usage | Result |
---|---|---|---|
Abs | Returns the absolute value of a specified number. | Abs(-1) | 1M |
Acos | Returns the angle whose cosine is the specified number. | Acos(1) | 0d |
Asin | Returns the angle whose sine is the specified number. | Asin(0) | 0d |
Atan | Returns the angle whose tangent is the specified number. | Atan(0) | 0d |
Ceiling | Returns the smallest integer greater than or equal to the specified number. | Ceiling(1.5) | 2d |
Cos | Returns the cosine of the specified angle. | Cos(0) | 1d |
Exp | Returns e raised to the specified power. | Exp(0) | 1d |
Floor | Returns the largest integer less than or equal to the specified number. | Floor(1.5) | 1d |
IEEERemainder | Returns the remainder resulting from the division of a specified number by another specified number. | IEEERemainder(3, 2) | -1d |
Log | Returns the logarithm of a specified number. | Log(1, 10) | 0d |
Log10 | Returns the base 10 logarithm of a specified number. | Log10(1) | 0d |
Max | Returns the larger of two specified numbers. | Max(1, 2) | 2 |
Min | Returns the smaller of two numbers. | Min(1, 2) | 1 |
Pow | Returns a specified number raised to the specified power. | Pow(3, 2) | 9d |
Round | Rounds a value to the nearest integer or specified number of decimal places. The mid number behaviour can be changed by using EvaluateOption.RoundAwayFromZero during construction of the Expression object. | Round(3.222, 2) | 3.22d |
Sign | Returns a value indicating the sign of a number. | Sign(-10) | -1 |
Sin | Returns the sine of the specified angle. | Sin(0) | 0d |
Sqrt | Returns the square root of a specified number. | Sqrt(4) | 2d |
Tan | Returns the tangent of the specified angle. | Tan(0) | 0d |
Truncate | Calculates the integral part of a number. | Truncate(1.7) | 1 |
It also includes other general purpose ones.
Name | Description | Usage | Result |
---|---|---|---|
in | Returns whether an element is in a set of values. | in(1 + 1, 1, 2, 3) | true |
if | Returns a value based on a condition. | if(3 % 2 = 1, 'value is true', 'value is false') | 'value is true' |
Expressions can be combined using operators. Each operator as a precedence priority. Here is the list of those expression's priority.
These operators can do some logical comparison between other expressions:
true or false and true
The and operator has more priority than the or, thus in the example above, false and true is evaluated first.
1 < 2
1 + 2 - 3
1 * 2 % 3
2 >> 3
not true
2 * ( 3 + 2 )