This commit is contained in:
Junzi Sun 2018-05-24 12:49:46 +02:00
parent 4f0946c4da
commit c91bd4bb03
2 changed files with 4 additions and 1 deletions

View File

@ -74,8 +74,9 @@ def airborne_velocity(msg):
hdg = None hdg = None
else: else:
hdg = common.bin2int(mb[14:24]) / 1024.0 * 360.0 hdg = common.bin2int(mb[14:24]) / 1024.0 * 360.0
hdg = round(hdg, 2)
trk_or_hdg = round(hdg, 2) trk_or_hdg = hdg
spd = common.bin2int(mb[25:35]) spd = common.bin2int(mb[25:35])
spd = None if spd==0 else spd-1 spd = None if spd==0 else spd-1

View File

@ -61,6 +61,8 @@ class Stream():
spd, trk, roc, tag = vdata spd, trk, roc, tag = vdata
if tag != 'GS': if tag != 'GS':
continue continue
if (spd is None) or (trk is None):
continue
self.acs[icao]['gs'] = spd self.acs[icao]['gs'] = spd
self.acs[icao]['trk'] = trk self.acs[icao]['trk'] = trk