Lokaler Tracker funktionsfähig. Bugfixes.

This commit is contained in:
2025-09-22 14:27:05 +02:00
parent f0ebdd0201
commit e7a96390f2
6 changed files with 150 additions and 44 deletions

View File

@@ -45,7 +45,10 @@ class Barograph(Page):
# Meßwert alle 15 Minuten:
# 84 Stunden * 4 Werte je Stunde = 336 Meßwerte
self.bd = boatdata
self.source = 'I' # (I)ntern, e(X)tern
if not cfg['bme280']:
self.source = None # keine Datenquelle!
else:
self.source = 'I' # (I)ntern, e(X)tern, None=Disabled
self.zoom = (1, 2, 3, 6, 12)
self.zoomindex = 4
self.series = (75, 150, 300, 600, 900)
@@ -65,6 +68,7 @@ class Barograph(Page):
self.buttonlabel[2] = '-'
self.buttonlabel[5] = 'SRC'
self.data = None
self.refresh = time.time() - 30
def handle_key(self, buttonid):
@@ -113,6 +117,9 @@ class Barograph(Page):
Transfer data from history to page buffer
set y-axis according to data
"""
if self.source == None:
# TODO hier muß noch Arbeit reingesteckt werden!
return False
self.data = []
self.vmin = 9999
self.vmax = 0
@@ -363,8 +370,13 @@ class Barograph(Page):
ctx.stroke()
# Meßdaten
for v in self.data:
x0 -= 1
if v > 0:
ctx.rectangle(x0, y0 - (v - ysmin) * dy, 1.5, 1.5)
ctx.fill()
if self.data:
for v in self.data:
x0 -= 1
if v > 0:
ctx.rectangle(x0, y0 - (v - ysmin) * dy, 1.5, 1.5)
ctx.fill()
else:
# Keine Daten vorhanden!
# TODO iregndwas nettes anzeigen
pass