Formel

Från version 24.4.0 går det att utvärdera matematiska formler av typen Boolean 

 

Från version 24.3.0 utökas denna sektion med ny funktionalitet. Det tillkommer då en knapp för att kunna testa formler. Först ska en formel anges, sedan används knappen "Testa" för att få fram ett resultat. Det kommer i sin tur att visas i ett nytt formulär där man får utvärdera resultatet. I detta formulär går det även att använda egna parametrar för att utvärdera en formel. Samt att ändra värden som urvalet ska baseras på.

Enligt nedan exempel är "Formel" vald som processvärdestyp i fliken för "Processvärde" och där med aktiveras rutan nedan. Här kan man sedan fylla i formler för att evaluera dessa antingen bara med siffror, eller med siffror och bokstäver, samt tecken inom hakparametrar [] som används som avskiljare.

Med knappen "Testa" öppnas sedan ett nytt formulär där man kan fylla i parametrar för värden inom [] och sedan få fram ett resultat. Tanken är att formuläret för evaluera ska underlätta om man har mer avancerade formler som har betydligt fler parametrar att ta hänsyn till.

Längst ned finns fler exempel på vilken typ av formler som kan användas här.

   

 

 

Rent tekniskt innebär det här att man kan ange andra processvärden som får formatet [record_no x] där x sedan blir det processvärde som ska användas.*

 

 

 

 

 

*Nedan information är tänkt som intern dokumentation för utvecklarna på Delacroy om problem skulle uppstå. Det är en lista på tillgängliga formler som går att använda när "Funktioner" används. Under den finns även en lista på tillgängliga operatorer som finns. Då det är en internationell standard som används för dessa sker ingen översättning.  

 

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

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.

  1. primary
  2. unary
  3. power
  4. multiplicative
  5. additive
  6. relational
  7. logical

Logical

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.

Relational

  1 < 2

Additive

  1 + 2 - 3

Multiplicative

 1 * 2 % 3

Bitwise

  2 >> 3

Unary

  not true

Primary

  2 * ( 3 + 2 )