Label = secop_module.target + simplified influx_name
This commit is contained in:
11
influxdb.py
11
influxdb.py
@@ -194,7 +194,7 @@ class InfluxDataGetter:
|
|||||||
for setup_info_dict in all_setup_info_dict:
|
for setup_info_dict in all_setup_info_dict:
|
||||||
for (setup_info_variable_name, content) in setup_info_dict.items():
|
for (setup_info_variable_name, content) in setup_info_dict.items():
|
||||||
if content[0] != "nicos.devices.secop.devices.SecopDevice":
|
if content[0] != "nicos.devices.secop.devices.SecopDevice":
|
||||||
name = self._transform_setup_info_variable_name_to_influx(setup_info_variable_name)
|
name = self._transform_setup_info_variable_name_to_influx(content[1]["secop_module"])
|
||||||
if name not in added_names:
|
if name not in added_names:
|
||||||
available_varirables.append(
|
available_varirables.append(
|
||||||
{
|
{
|
||||||
@@ -207,17 +207,18 @@ class InfluxDataGetter:
|
|||||||
added_names.append(name)
|
added_names.append(name)
|
||||||
return available_varirables
|
return available_varirables
|
||||||
|
|
||||||
def _transform_setup_info_variable_name_to_influx(self, setup_info_name):
|
def _transform_setup_info_variable_name_to_influx(self, secop_module_name):
|
||||||
"""
|
"""
|
||||||
Transforms the name of the variable available in the setup_info dict into the Influx name.
|
Transforms the name of the variable available in the setup_info dict into the Influx name.
|
||||||
|
Lowers the secop_module_name and adds "nicos/se_" as prefix
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
setup_info_name (str) : the name of the variable in the setup_info dict.
|
secop_module_name (str) : the secop module name of the variable in the setup_info dict.
|
||||||
|
|
||||||
Returns :
|
Returns :
|
||||||
str : the transformed variable name that matches the Influx names reqauirements
|
str : the transformed variable name that matches the Influx names reqauirements
|
||||||
"""
|
"""
|
||||||
return self._influx_instrument_config["measurement_prefix"] + setup_info_name.lower()[len(self._influx_instrument_config["setup_info_prefix"]):]
|
return self._influx_instrument_config["measurement_prefix"] + secop_module_name.lower()
|
||||||
|
|
||||||
def _remove_variables_without_value_float(self, available_variables, times):
|
def _remove_variables_without_value_float(self, available_variables, times):
|
||||||
"""
|
"""
|
||||||
@@ -309,7 +310,7 @@ class InfluxDataGetter:
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"name":variable["name"]+".target",
|
"name":variable["name"]+".target",
|
||||||
"label":variable["name"][len(self._influx_instrument_config["measurement_prefix"]):]+".target",
|
"label":variable["label"]+".target",
|
||||||
"unit":variable["unit"]
|
"unit":variable["unit"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
variables_config.ini
Normal file
3
variables_config.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[chart]
|
||||||
|
T_stat.raw=cat:rawOhm
|
||||||
|
T_stat=color:#FF0000
|
||||||
Reference in New Issue
Block a user