Prepared text and alarm feature
This commit is contained in:
parent
97353c83a6
commit
a9dcead85b
16
boatdata.py
16
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,
|
||||
|
|
Loading…
Reference in New Issue