improve graphics layout

- 'bevel' line style prohibits 'peaks' on locally noisy values
- fix option 'stepped' instead of 'steppedLine'
- set period to 0 for target parameters
- thinker lines, adjustable by a constant
This commit is contained in:
l_samenv
2024-09-27 10:54:27 +02:00
parent 7184d28047
commit e71cb74391
2 changed files with 22 additions and 22 deletions

View File

@@ -496,13 +496,16 @@ class InfluxDataGetter:
fields = [record.get_value() for record in records]
for param in variable["params"].keys():
if param+"_float" in fields:
res.append({
curve = {
"name": variable["name"] if param == "value" else variable["name"]+"."+param,
"label": variable["label"] if param == "value" else variable["label"]+"."+param,
"cat": variable["params"][param]["cat"],
"color": variable["params"][param]["color"],
"unit": variable["params"][param]["unit"]
})
"unit": variable["params"][param]["unit"],
}
if param == 'target':
curve['period'] = 0
res.append(curve)
return res
@@ -521,16 +524,11 @@ class InfluxDataGetter:
groups = {}
for available_variable in available_variables:
key = available_variable["unit"]
if available_variable["cat"] != "*":
key = available_variable["cat"]
unit = available_variable.pop("unit")
key = available_variable.pop("cat").replace("*", unit)
if key not in groups.keys():
groups[key] = {"tag":key, "unit":available_variable["unit"], "curves":[]}
groups[key]["curves"].append({
"name":available_variable["name"],
"label":available_variable["label"],
"color":available_variable["color"],
})
groups[key] = {"tag":key, "unit": unit, "curves":[]}
groups[key]["curves"].append(available_variable)
return list(groups.values())
@@ -721,4 +719,4 @@ class InfluxDataGetter:
return seconds * 1000000000
def _milliseconds_to_nanoseconds(self, milliseconds):
return milliseconds * 1000000
return milliseconds * 1000000