add callsign to modeslive

This commit is contained in:
Junzi Sun 2018-07-04 21:31:09 +02:00
parent 6f139d4ae9
commit 0085d03d4a
2 changed files with 9 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import time
from threading import Thread
COLUMNS = [
('call', 10),
('lat', 10),
('lon', 10),
('alt', 7),
@ -16,11 +17,12 @@ COLUMNS = [
('roc', 7),
('trk', 10),
('hdg', 10),
('ver', 4),
('live', 6),
]
UNCERTAINTY_COLUMNS = [
('|', 5),
('ver', 4),
('HPL', 5),
('RCu', 5),
('RCv', 5),
@ -113,8 +115,10 @@ class Screen(Thread):
line += icao
for c, cw in self.columns:
if c=='live':
val = int(time.time() - ac[c])
if c=='|':
val = '|'
elif c=='live':
val = str(int(time.time() - ac[c]))+'s'
elif ac[c] is None:
val = ''
else:

View File

@ -37,6 +37,7 @@ class Stream():
if icao not in self.acs:
self.acs[icao] = {
'live': None,
'call': None,
'lat': None,
'lon': None,
'alt': None,
@ -66,7 +67,7 @@ class Stream():
self.acs[icao]['live'] = int(t)
if 1 <= tc <= 4:
self.acs[icao]['callsign'] = pms.adsb.callsign(msg)
self.acs[icao]['call'] = pms.adsb.callsign(msg)
if (5 <= tc <= 8) or (tc == 19):
vdata = pms.adsb.velocity(msg)