Added HDT, HDM and fixed formatting bug
This commit is contained in:
parent
7af6cecfbc
commit
97353c83a6
|
@ -168,10 +168,10 @@ class BoatValueGeo(BoatValue):
|
||||||
minutes = (self.value - degrees) * 60
|
minutes = (self.value - degrees) * 60
|
||||||
if self.geofmt == 'lat':
|
if self.geofmt == 'lat':
|
||||||
direction = ('E' if self.value > 0 else 'W')
|
direction = ('E' if self.value > 0 else 'W')
|
||||||
formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, decpl)
|
formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, self.decpl)
|
||||||
elif self.geofmt == 'lon':
|
elif self.geofmt == 'lon':
|
||||||
direction = 'N' if self.value > 0 else 'S'
|
direction = 'N' if self.value > 0 else 'S'
|
||||||
formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, decpl)
|
formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, self.decpl)
|
||||||
else:
|
else:
|
||||||
formatted = str(self.placeholder)
|
formatted = str(self.placeholder)
|
||||||
return formatted
|
return formatted
|
||||||
|
@ -407,6 +407,8 @@ class BoatData():
|
||||||
self.gpst = BoatValueTime("GPST")
|
self.gpst = BoatValueTime("GPST")
|
||||||
self.sog = BoatValueSpeed("SOG", "kn")
|
self.sog = BoatValueSpeed("SOG", "kn")
|
||||||
self.cog = BoatValueAngle("COG", "deg")
|
self.cog = BoatValueAngle("COG", "deg")
|
||||||
|
self.hdm = BoatValueAngle("HDM", "deg")
|
||||||
|
self.hdt = BoatValueAngle("HDT", "deg")
|
||||||
self.xte = BoatValueDistance("XTE", "m")
|
self.xte = BoatValueDistance("XTE", "m")
|
||||||
self.stw = BoatValueSpeed("STW", "kn")
|
self.stw = BoatValueSpeed("STW", "kn")
|
||||||
self.dbt = BoatValueDepth("DBT", "m")
|
self.dbt = BoatValueDepth("DBT", "m")
|
||||||
|
@ -467,6 +469,8 @@ class BoatData():
|
||||||
'AWS': self.aws,
|
'AWS': self.aws,
|
||||||
'BTW': self.bearing,
|
'BTW': self.bearing,
|
||||||
'COG': self.cog,
|
'COG': self.cog,
|
||||||
|
'HDM': self.hdm,
|
||||||
|
'HDT': self.hdt,
|
||||||
'DBT': self.dbt,
|
'DBT': self.dbt,
|
||||||
'DBS': self.dbs,
|
'DBS': self.dbs,
|
||||||
'DTW': self.wpdist,
|
'DTW': self.wpdist,
|
||||||
|
|
Loading…
Reference in New Issue