From 2ea2219b6760cbef96c7ee2583a50eac2d933721 Mon Sep 17 00:00:00 2001 From: l_samenv Date: Wed, 4 Sep 2024 08:31:25 +0200 Subject: [PATCH] Changed plus to asterisk for showing curve --- config/lab4.ini | 4 ++-- doc/variables_config.md | 6 +++--- influxdb.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/lab4.ini b/config/lab4.ini index 4791db9..61f7a65 100644 --- a/config/lab4.ini +++ b/config/lab4.ini @@ -1,4 +1,4 @@ [chart] T_stat=K_3 -T_stat.raw=+ -T_nvd.raw=+ \ No newline at end of file +T_stat.raw=* +T_nvd.raw=* \ No newline at end of file diff --git a/doc/variables_config.md b/doc/variables_config.md index 6768708..6abf92c 100644 --- a/doc/variables_config.md +++ b/doc/variables_config.md @@ -8,7 +8,7 @@ Such a file has to be located under the `config/` folder. The current process for getting the different information is the following : 1. Available variables and parameters are got from InfluxDB, more specifically in the `setup_info` field of the measurements `nicos/se_main`, `nicos/se_stick`, `nicos/se_addons`. Here : - - The category `+` is given to parameters `value` and `target`, the category `-` is given to any other parameters. + - The category `*` is given to parameters `value` and `target`, the category `-` is given to any other parameters. - The unit is `1` is it is not present or if it is an empty string, or the unit if correct. - The color is not given yet. 2. The configuration file `generic.ini` is first used to modify the different values for each couple variable/parameter. @@ -81,7 +81,7 @@ Valid syntaxes for this example are `T_plato=unit:K,color:#FF0000` or `T_plato=c ## Special values and omissions -If `cat` is `+`, then the associated parameter is displayed, in the block of its unit. +If `cat` is `*`, then the associated parameter is displayed, in the block of its unit. If `cat` is `-`, then the associated parameter is not displayed. This can be used to explicitely hide `value` and/or `target` parameters of a variable. Omitting a value means that it will be inherited from the previous configuration files. @@ -89,4 +89,4 @@ Omitting a value means that it will be inherited from the previous configuration ## Diverse examples - `T_plato=-` : the `value` parameter of T_plato is never displayed -- `T_plato.raw=+` : the `raw` parameter of T_plato will be displayed in the default block corresponding to its unit \ No newline at end of file +- `T_plato.raw=*` : the `raw` parameter of T_plato will be displayed in the default block corresponding to its unit \ No newline at end of file diff --git a/influxdb.py b/influxdb.py index cb85aa8..ad5a933 100644 --- a/influxdb.py +++ b/influxdb.py @@ -353,13 +353,13 @@ class InfluxDataGetter: variable = { "name":name, "label":content[1]["secop_module"], - "params":{"value":{"cat":"+", "color":"", "unit":value_unit}} # main value, shown by default + "params":{"value":{"cat":"*", "color":"", "unit":value_unit}} # main value, shown by default } for param_name, param_content in content[1]["params_cfg"].items(): param_unit = "1" if (not "unit" in param_content.keys() or param_content["unit"] == "") else param_content["unit"] variable["params"][param_name] = { - "cat":"+" if param_name == "target" else "-", # target is also shown by default, not the other parameters + "cat":"*" if param_name == "target" else "-", # target is also shown by default, not the other parameters "color":"", "unit":param_unit } @@ -498,7 +498,7 @@ class InfluxDataGetter: for available_variable in available_variables: key = available_variable["unit"] - if available_variable["cat"] != "+": + if available_variable["cat"] != "*": key = available_variable["cat"] if key not in groups.keys(): groups[key] = {"tag":key, "unit":available_variable["unit"], "curves":[]}