Project Details
Changes Log
Who We Are

Data provider equations

    1  Overview
    2  Syntax
       2.1  Expressions types
       2.2  Affectations
       2.3  Code blocks
       2.4  Local variables
       2.5  If−then−else
       2.6  While loops
       2.7  Echo
    3  Functions list
    4  See also

The Embed Client Data provider inputs processing logic are specified using an equation syntax. This article explains this syntax..


All classic numeric and boolean functions are supported: Additionally:


Expressions types

Expresions use the following syntax:


It is possible to use affectations in expressions. For example, for the expression "b=2*a":

Code blocks

Code blocks are expressions separated by semi−colons (";") séparées. The result of the block of code if the result of the last expression in the list, but the mprevious expressions will also be evaluated. For example, for the expression "a=2;b=2*a": The "return" keyword can be used to clarify expressions. For example, the following expression will have the same effect as the previous one: "a=2;b=2*a; return b". It is also possible in this case to write "a=2; return 2*a" if we don't xant to change the value of b. Note that it is possible to omit the last ";".

Local variables

It is possible to use local variables in expressions. PFor example in the following example b is local to the l‘expression. Note that if a local variable has the same name of a global variable, the value of the global variale will not be modified.

      int b=2*a;
      return b

Type declarations for local variables are:


If−then−else expressions are supported. For example:

      if (c) {return 2} else {return 3};

      if (!c) {return 2} 
      else if (b == 2) {return b * 10}
      else {return 3}

If−then−else expressions can also be used inside other expresiosn or code blocks. For example:

      if (!c) {return 2}
      else if (b == 2) {
      if (d == 3) { return 25} 
      else {return 45}
      } else {return 3};

While loops

While loops are supported. For example:
      int c = 0;
      int d = 0;
      while (c < 10) {
      d = d + a; 
      c = c + 1};       


The "echo" function prints the argument in the console. For example: "echo("a = " + a) will show the value of a in the console.


It is possible to add comments on a line in expressions. For example:
      if (!c) {return 2}
      /* first if */
      else if (b == 2) {
      if (d == 3) { return 25} 
      else {return 45}
      } else {return 3};

Functions list

Function Syntax Definition
abs abs(a) Absolute value
sin sin(a) Sinus (input in radians)
cos cos(a) Cosinus (input in radians)
tan tan(a) Tangent (input in radians)
asin asin(a) Arc sinus
acos acos(a) Arc cosinus
atan atan(a) Arc tangent
atn2 atn2(a) Arc tangent 2
pow pow(a, b) a power b (for example pow(a, 2) is a * a)
sqrt sqrt(a) Square root
PI PI The PI constant
toDegrees toDegrees(a) Conversion from radians to degrees
toRadians toRadians(a) Conversion from degrees to radians

See Also

Category: client Category: user

Copyright 2016 Dassault Aviation. All Rights Reserved. Documentation and source under the GPL v2 licence

Project Web Hosted by SourceForge.net Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved About - Legal - Help