Skip to content
Snippets Groups Projects
Commit 578d19cd authored by PICHON's avatar PICHON
Browse files

Documentation update

parent 3087dc73
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,20 @@ La valeur présente dans la partie « output » de valIO, sera vérifiée tout ...@@ -128,6 +128,20 @@ La valeur présente dans la partie « output » de valIO, sera vérifiée tout
:warning:Attention, ce mécanisme est dangereux.:warning: :warning:Attention, ce mécanisme est dangereux.:warning:
Pour valIO2, la recopie devra être activée via l’attribut booléen « valIO2AutoInputActivation ». Il sera vérifié toutes les secondes et recopié en cas de changement strict. Pour valIO2, la recopie devra être activée via l’attribut booléen « valIO2AutoInputActivation ». Il sera vérifié toutes les secondes et recopié en cas de changement strict.
### Exemple d'usage
Dans l'exemple ci-dessous, une device Publisher accessible par test/tools/test.pub contient 3 attributs booléen : valX, valZ, valGo et fofbPrev.
La configuration va faire en sorte que :
* valGo deviendra faux si valX ou valY deviennent faux mais ne redeviendra pas vrai si valX et valY repasse à vrai.
* fofbLock ne sera vrai que si valX, valZ et valGo sont vrai.
* Si valX ou valY passe de vrai à faux, alors il faudra passer valGo manuellement à vrai pour que fofbLock redevienne vrai lorsque valX et valY repasseront à vrai.
| Property name | Value |
| :------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------- |
| AttributeNames | valX,test/tools/test.pub/valX<br/>valZ,test/tools/test.pub/valZ<br/>valGo,test/tools/test.pub/valGo<br/>fofbPrev,test/tools/test.pub/fofbPrev |
| IONames | DevBoolean fofbWatcher ; valX && valZ ;valGo = if(fofbPrev && !fofbWatcher, 0, valGo); fofbPrev=fofbWatcher |
| AutoInputProperties | fofbWatcher;false;0.5 |
| OutputNames | DevBoolean fofbLock, fofbWatcher&&valGo |
# Format d'attributs # Format d'attributs
* SPECTRUM * SPECTRUM
Tous les attributs créés peuvent être de type SPECTRUM. Il suffit de spécifier "SPECTRUM" devant leur définition. Si c'est le cas, le type d'attribut devient obligatoire. Tous les attributs créés peuvent être de type SPECTRUM. Il suffit de spécifier "SPECTRUM" devant leur définition. Si c'est le cas, le type d'attribut devient obligatoire.
...@@ -172,6 +186,12 @@ Le type par défaut est DevDouble. ...@@ -172,6 +186,12 @@ Le type par défaut est DevDouble.
| Assignment | = | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Assignment | = | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
# Fonctions et constantes disponibles # Fonctions et constantes disponibles
## Constantes
Les constantes suivantes sont disponibles :
* i: (0.0, 1.0)
* e: 2.718281828459045
* pi: 3.141592653589793
## Trigonometric Functions ## Trigonometric Functions
All functions accept arguments of the Double and Complex type, except atan2 which only accepts Double arguments. All functions accept arguments of the Double and Complex type, except atan2 which only accepts Double arguments.
...@@ -223,7 +243,7 @@ All functions accept either a vector (e.g. min([1,2,3])) or a set of numbers (e. ...@@ -223,7 +243,7 @@ All functions accept either a vector (e.g. min([1,2,3])) or a set of numbers (e.
## Miscellaneous Functions ## Miscellaneous Functions
| Description | Function Name | | Description | Function Name |
| :-------------------------------------------- | :-------------------------- | | :----------------------------------------------------------------- | :----------------------------------- |
| If | if(cond, trueval, falseval) | | If | if(cond, trueval, falseval) |
| Str (convert number to string) | str(x) | | Str (convert number to string) | str(x) |
| Absolute Value / Magnitude | abs(x) | | Absolute Value / Magnitude | abs(x) |
...@@ -233,6 +253,29 @@ All functions accept either a vector (e.g. min([1,2,3])) or a set of numbers (e. ...@@ -233,6 +253,29 @@ All functions accept either a vector (e.g. min([1,2,3])) or a set of numbers (e.
| Sum | sum(x,y,...) | | Sum | sum(x,y,...) |
| Binomial coefficients | binom(n, i) | | Binomial coefficients | binom(n, i) |
| Signum (-1,0,1 depending on sign of argument) | signum(x) | | Signum (-1,0,1 depending on sign of argument) | signum(x) |
| Apply a fast fourier transform on a vector | fft(x) |
| Sinus on vectors. Apply sinus on all vector elements | vsin(x) |
| Cosinus on vectors. Apply cosinus on all vector elements | vcos(x) |
| Logarithm on vectors. Apply logarithm on all vector elements | vlog(x) |
| Adds a scalar value to each vector elements | add(vector, scalar) |
| Substract a scalar value to each vector elements | sub(vector, scalar) |
| Multiply on vectors. Multiply elements of two vectors one by one | mul(x, y) |
| Division on vectors. Divide elements of two vectors one by one | div(x, y) |
| Mean computation on a vector | mean(x) |
| Standard deviation computation on a vector | std(x) |
| Extract the maximum value on a vector | max(x) |
| Extract the minimum value on a vector | min(x) |
| Extract a bit of an integer value. Takes 2 parameters. | boolextract(integerValue, bit index) |
| Convert a number to a string in a given base. | toBase(x) |
| Shortcut to toBase(x, 10) | toDec(x) |
| Shortcut to toBase(x, 16) | toHex(x) |
| Convert a string representing a number in a given base to a number | fromBase(str, x) |
| Shortcut to fromBase(str, 10) | fromDec(str) |
| Shortcut to fromBase(str, 16) | fromHex(str) |
| Extract a substring from a string. | substring(str, beginIndex, endIndex) |
| Returns the length of a given string | stringlen(str) |
| Shortcut to substring(str, 0, index) | left(str, index) |
| Shortcut to substring(str, stringlen(str) - index, stringlen(str)) | right(str, index) |
## Complex Functions ## Complex Functions
| Description | Function Name | | Description | Function Name |
...@@ -245,13 +288,12 @@ All functions accept either a vector (e.g. min([1,2,3])) or a set of numbers (e. ...@@ -245,13 +288,12 @@ All functions accept either a vector (e.g. min([1,2,3])) or a set of numbers (e.
| Complex, constructs a complex number from real and imaginary parts | complex(x, y) | | Complex, constructs a complex number from real and imaginary parts | complex(x, y) |
| Polar, constructs a complex number from modulus and argument | polar(r, theta) | | Polar, constructs a complex number from modulus and argument | polar(r, theta) |
Notes ## Notes
* Functions like sqrt(-1) will return a complex result.
1 By default functions like sqrt(-1) will return a complex result. These functions have constructors with a flag to control their behaviour for out of range values, if the flag is true, then the function will return Double.NaN for out of range real values. If the flag is false they will return the appropriate complex result. * Functions like acos(2) will return Double.NaN.
2 By default functions like acos(2) will return Double.NaN. A constructor is available which sets a flag to make the function return the appropriate complex result for such cases.
# Exemple d'atttribut SECTRUM avec transformée de fourier # Exemples
## Exemple d'atttribut SPECTRUM avec transformée de fourier
Un nouvel attribut A5 est crée et est le résultat de la multiplication de B2 par un scalaire Un nouvel attribut A5 est crée et est le résultat de la multiplication de B2 par un scalaire
B2 est un attribut spectrum READ-ONLY relu sur un Device Tango B2 est un attribut spectrum READ-ONLY relu sur un Device Tango
Un nouvel attribut A6 est la somme de 2 attributs spectrum Un nouvel attribut A6 est la somme de 2 attributs spectrum
...@@ -260,9 +302,25 @@ Un nouvel attribut A6 est la somme de 2 attributs spectrum ...@@ -260,9 +302,25 @@ Un nouvel attribut A6 est la somme de 2 attributs spectrum
![Exemple de spectrum dans l'ATKPanel](doc/img/spectrum_atk.png) ![Exemple de spectrum dans l'ATKPanel](doc/img/spectrum_atk.png)
# Exemple d'utilisation des fonction sur les attributs SPECTRUM
* AttributeNames:
* B2,tango/tangotest/sa_2/double_spectrum_ro
* OutputNames:
* SPECTRUM DevDouble A1,vlog(B2)
* Chaque point du spectrum A1 contient le log du point de même indice du spectrum B2
* SPECTRUM DevDouble A2,vcos(B2)
* Chaque point du spectrum A2 contient le cos du point de même indice du spectrum B2
* SPECTRUM DevDouble A3,vsin(B2)
* Chaque point du spectrum A3 contient le sin du point de même indice du spectrum B2
* SPECTRUM DevDouble A4,add(B2,5)
* Chaque point du spectrum A4 contient la somme du scalaire de valeur 5 et du point de même indice du spectrum B2
* SPECTRUM DevDouble A5,sub(B2,3)
* Chaque point du spectrum A5 contient la différence du point de même indice du spectrum B2 et du scalaire de valeur 3
# Aide au diagnostic # Aide au diagnostic
## Les logs ## Les logs
Si les équations contiennent des erreurs, celles-ci seront listées dans l'attribut "log".
![Exemple de log d'erreur](doc/img/log_error.png) ![Exemple de log d'erreur](doc/img/log_error.png)
## Tester les fonctions ## Tester les fonctions
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment