Skip to content

Commit

Permalink
add callsign to modeslive
Browse files Browse the repository at this point in the history
  • Loading branch information
junzis committed Jul 4, 2018
1 parent 6f139d4 commit 0085d03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions pyModeS/streamer/screen.py
Expand Up @@ -6,6 +6,7 @@
from threading import Thread

COLUMNS = [
('call', 10),
('lat', 10),
('lon', 10),
('alt', 7),
Expand All @@ -16,11 +17,12 @@
('roc', 7),
('trk', 10),
('hdg', 10),
('ver', 4),
('live', 6),
]

UNCERTAINTY_COLUMNS = [
('|', 5),
('ver', 4),
('HPL', 5),
('RCu', 5),
('RCv', 5),
Expand Down Expand Up @@ -113,8 +115,10 @@ def update(self):
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:
Expand Down
3 changes: 2 additions & 1 deletion pyModeS/streamer/stream.py
Expand Up @@ -37,6 +37,7 @@ def process_raw(self, adsb_ts, adsb_msgs, commb_ts, commb_msgs, tnow=None):
if icao not in self.acs:
self.acs[icao] = {
'live': None,
'call': None,
'lat': None,
'lon': None,
'alt': None,
Expand Down Expand Up @@ -66,7 +67,7 @@ def process_raw(self, adsb_ts, adsb_msgs, commb_ts, commb_msgs, tnow=None):
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)
Expand Down

0 comments on commit 0085d03

Please sign in to comment.