Prepared text and alarm feature

This commit is contained in:
Thomas Hooge 2025-07-22 15:33:40 +02:00
parent 97353c83a6
commit a9dcead85b
1 changed files with 16 additions and 0 deletions

View File

@ -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,