From a9dcead85bbef061a4531af79c802d7f3fa3e6ab Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Tue, 22 Jul 2025 15:33:40 +0200 Subject: [PATCH] Prepared text and alarm feature --- boatdata.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/boatdata.py b/boatdata.py index 56aa6d2..aaf31d3 100644 --- a/boatdata.py +++ b/boatdata.py @@ -45,6 +45,7 @@ STW - Speed Through Water, Geschwindigkeit durch das Wasser SatInfo - Satellit Info, Anzahl der sichtbaren Satelliten TWD - True Wind Direction, wahre Windrichtung TWS - True Wind Speed, wahre Windgeschwindigkeit +TXT - Textnachricht / Alarm TZ - Time Zone, Zeitzone TripLog - Trip Log, Tages-Entfernungszähler VAR - Variation, Abweichung vom Sollkurs @@ -302,6 +303,16 @@ class BoatValuePressure(BoatValue): else: return self.placeholder +class BoatValueText(BoatValue): + # generic simple text + def __init__(self, shortname): + super().__init__(shortname, '') + self.instance = None + self.sensortype = None + def format(self): + if self.value and self.valid: + return self.value + class Tank(): """ Die Instanz beziegt sich auf den Typ. So kann die Instanz 0 @@ -388,6 +399,7 @@ class BoatData(): def __init__(self): self.simulation = False + self.alarm = False # nach Überschreiten dieser Schwelle in Sekunden wird # ein Meßwert als ungültig angesehen @@ -420,6 +432,9 @@ class BoatData(): self.rpos = BoatValueAngle("RPOS", "deg") self.prpos = BoatValueAngle("PRPOS", "deg") + # Text / Alarm + self.txt = BoatValueText("TXT") + # Nächster Wegepunkt self.wpno = BoatValue("WP") self.wpname = BoatValue("WPname") @@ -487,6 +502,7 @@ class BoatData(): 'STW': self.stw, 'TWD': self.twd, 'TWS': self.tws, + 'TXT': self.txt, 'WTemp': self.temp_water, 'WPLat': self.wplat, 'WPLon': self.wplon,