Added variables config maual + updated readme

This commit is contained in:
l_samenv
2024-08-21 14:40:56 +02:00
parent a288ff0e78
commit 3178359c1c
5 changed files with 114 additions and 76 deletions

30
doc/client.md Normal file
View File

@ -0,0 +1,30 @@
The way the main page is served (where you can select the instrument you want to interact with) has not been decided yet, even if its code is in this repository.
### Initialization
For a selected instrument, there is a single HTML file that holds the application : the `SEAWebClient.html` file, which is served as the main route. It includes all the JS files needed, meaning all the JS files located in the `client/jsFiles` folder excepted `SeaWebClientStart.js`, plus the external librairies (`client/externalFiles/`) and the components (`client/components/`).
The entry point is the `SEAWebClientMain.js`, which has a `window.onload` function and which initiates all the content of the page, plus the responsitivity.
### About updating graphics
- When the server is pushing data, the newly received data is appened to the current curves (on livemode).
- When zooming in the x direction, when the zoom is complete (for e.g. meaning that there are no longer enough mouse wheel step in a certain range of time), then the resolution is computed, the client asks for the data within the new viewing window with the given resolution, and then sets (overwrites) the data for the curves.
### About livemode
A user is in livemode when the "now" date is in the viewing window. When the last point gets more recent than the right most value, the viewing window is shrinked, keeping the left mose value.
Every plain minute, all the curves are synchronized. For the curve that have not receive any new data, their last known point is retreived at the "now" date.
### External libraries
| Name | Version | Website |
| -------------------------- | ------- | -------------------------------------- |
| AlertifyJS | v1.8.0 | http://alertifyjs.com |
| ChartJS | v2.9.4 | https://www.chartjs.org |
| \+ Zoom plugin for ChartJS | v0.7.3 | https://www.chartjs.org |
| EventSource | unknown | https://github.com/Yaffle/EventSource/ |
| Hammer.JS | v2.0.7 | http://hammerjs.github.io/ |
| Swipper | v4.5.0 | http://www.idangero.us/swiper/ |

View File

@ -1,16 +0,0 @@
# device.parameter=cat[,color[,unit]]
# device.parameter=cat:raw,color:yellow
[chart]
t_plato.raw=raw,#FFF,Ohm
T_plato.target=none # do not show
T_plato.raw=rawOhm # show in extra section "rawOhm"
T_plato=,,Ohm # custom unit
T_plato=unit:Ohm # custom unit
tag -> cat
lookup with the label (secop module)

0
doc/server.md Normal file
View File

82
doc/variables_config.md Normal file
View File

@ -0,0 +1,82 @@
# Configuring the variables and their parameters
A programmer can configure the curves that are displayed in the graphical part.
All this can be configured in the `variables_config.ini` file.
## Functionnalities summary
A programmer can :
For a variable :
- show a parameter which is not "value" or "target"
- hide "value" or "target" parameter
For a parameter :
- specify the category of the corresponding curve
- specify the color of the corresponding curve
- specify the unit of the corresponding curve
## File structure
```ini
[chart]
<variable.parameter>=<options>
```
## Indicating a parameter
To indicate a parameter, the programmer has first to indicate the SECOP name of the variable (case sensitive).
If the options are concerning the `value` field, then nothing more has to be specified.
- Example : `T_plato`
In the other case, the programmer has to use a dot, followed by the name of the parameter (as it is in NICOS).
- Example : `T_plato.raw`
Finally, the equal sign must be used to then indicate the options and their values.
- Example : `T_plato.target=<options>`
## Giving the options
### Using positionnal arguments
One can give the different options for a parameter by using a comma separated value (without spaces around commas) list.
The order is `cat`, `color`, `unit`.
- Example : `T_plato.raw=raw,#0000FF` This indicates that the `raw` parameter will be displayed in the raw category of its unit (found in NICOS if present), and will have a blue color.
Be aware that this example is not the same as : `T_plato.raw=raw,#0000FF,` that indicates a unit equal to nothing.
### Using keywords arguments
One can indicate to which option a value is given, independently of its position in the comma separated list, by using keywords. This can be useful if we want to indicate only the unit without indicating/overwritting the category and/or the color.
To use keywords : `<keyword>:<value>`
Possible keywords are :
- `cat` : specifies the category
- `color` : specifies the color (6 digits hexadecimal color)
- `unit` : specifies the unit
Example : `T_plato=color:#0000FF,cat:other` This indicates that the `value` parameter of T_plato will be displayed in blue, in the "other" category of its unit (found in NICOS if present).
### Using both
Once a keyword argument is used for a parameter, it is then not possible to use positionnal arguments for this parameter.
- Example : `T_plato=unit:K,#FF0000` is invalid, because no keyword is given after the use of `unit` for the other options.
Valid syntaxes for this example are `T_plato=unit:K,color:#FF0000` or `T_plato=color:#FF0000,unit:K`.
## Special values and omissions
If `cat` is `None`, then the associated parameter is not displayed. This value is case-sensitive. This can be used to explicitely hide `value` and/or `target` parameters of a variable.
Omitting the category means that the parameter will be displayed in the default unit block.
Omitting the color means that an automatic color will be given for this parameter.
Omitting the unit means that it will be the one found in NICOS if present.
## Diverse examples
- `T_plato=None` : the `value` parameter of T_plato is never displayed
- `T_plato.raw=` : the `raw` parameter of T_plato will be displayed with an automatic color, will have its unit found in NICOS, and will be displayed in the default block corresponding to its unit