Running curves settings

This commit is contained in:
l_samenv
2024-09-04 08:26:21 +02:00
parent 933088fd08
commit dc9a08dbee
2 changed files with 25 additions and 8 deletions

View File

@ -113,7 +113,7 @@ class InfluxGraph:
time = [float(t) for t in time.split(',')]
return dict(type='time', time= self.get_abs_time(time))
def w_getvars(self, time):
def w_getvars(self, time, userconfiguration = None):
"""
Gets the curve names available at a given point in time.
Called when the route /getvars is reached.
@ -130,8 +130,10 @@ class InfluxGraph:
time = [float(t) for t in time.split(',')]
start_time = int(self.get_abs_time(time)[0])
end_time = int(self.get_abs_time(time)[-1])
if not userconfiguration == None : userconfiguration = json.loads(userconfiguration)
blocks = self.influx_data_getter.get_available_variables_at_time([start_time, end_time], self.chart_configs)
blocks = self.influx_data_getter.get_available_variables_at_time([start_time, end_time], self.chart_configs, userconfiguration)
device_name = self.influx_data_getter.get_device_name(end_time)
# updates the self.variables attribute to keep track of the available variables
self.variables = {variable["name"]:variable["label"] for block in blocks for variable in block["curves"]}