Influx graph part only + device name on jump and start + fixed dselect z-index

This commit is contained in:
l_samenv
2024-08-21 10:05:47 +02:00
parent 2ea1674991
commit 89dd427a22
8 changed files with 115 additions and 12 deletions

View File

@ -26,9 +26,8 @@ class InfluxGraph:
ACTUAL = 1
LIVE = 2
def __init__(self):
self.db = InfluxDB()
self.influx_data_getter = InfluxDataGetter(self.db, json.load(open("./graphs/lab4.json", "r"))["influx"])
def __init__(self, influx_data_getter):
self.influx_data_getter = influx_data_getter
self.livemode = self.HISTORICAL
self.end_query = 0
self.lastvalues = {}
@ -139,13 +138,14 @@ class InfluxGraph:
end_time = int(self.get_abs_time(time)[-1])
blocks = self.influx_data_getter.get_available_variables_at_time2([start_time, end_time], all)
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"] for block in blocks for variable in block["curves"]]
assign_colors_to_curves(blocks)
result = dict(type='var_list')
result['blocks'] = blocks
result['device'] = device_name
return result
def w_updategraph(self):