diff --git a/README.rst b/README.rst index 211591f..9c7fccd 100644 --- a/README.rst +++ b/README.rst @@ -80,6 +80,7 @@ Supports **Mode-S Beast** and **AVR** raw stream --port PORT raw data port --rawtype RAWTYPE beast or avr --latlon LAT LON receiver position + --show-uncertainty display uncertaint values, default off If you have a RTL-SDR receiver or Mode-S Beast, use modesmixer2 (http://xdeco.org/?page_id=48) to create raw beast TCP stream: diff --git a/pyModeS/streamer/modeslive b/pyModeS/streamer/modeslive index 9db9980..1447e05 100644 --- a/pyModeS/streamer/modeslive +++ b/pyModeS/streamer/modeslive @@ -22,7 +22,7 @@ parser.add_argument('--server', help='server address or IP', required=True) parser.add_argument('--port', help='raw data port', required=True) parser.add_argument('--rawtype', help='beast or avr', required=True) parser.add_argument('--latlon', help='receiver position', nargs=2, metavar=('LAT', 'LON'), required=True) -parser.add_argument('--show-uncertainty', help='display uncertainty indicators', required=False) +parser.add_argument('--show-uncertainty', dest='uncertainty', help='display uncertaint values, default off', action='store_true', required=False, default=False) args = parser.parse_args() SERVER = args.server @@ -30,6 +30,7 @@ PORT = int(args.port) RAWTYPE = args.rawtype LAT0 = float(args.latlon[0]) LON0 = float(args.latlon[1]) +UNCERTAINTY = args.uncertainty class ModesClient(BaseClient): @@ -76,7 +77,7 @@ client.start() stream = Stream(lat0=LAT0, lon0=LON0) try: - screen = Screen() + screen = Screen(uncertainty=UNCERTAINTY) screen.daemon = True screen.start() diff --git a/pyModeS/streamer/screen.py b/pyModeS/streamer/screen.py index b2951c9..093d032 100644 --- a/pyModeS/streamer/screen.py +++ b/pyModeS/streamer/screen.py @@ -17,6 +17,10 @@ COLUMNS = [ ('trk', 10), ('hdg', 10), ('ver', 4), + ('live', 6), +] + +UNCERTAINTY_COLUMNS = [ ('HPL', 5), ('RCu', 5), ('RCv', 5), @@ -30,11 +34,10 @@ COLUMNS = [ ('VFOMr', 7), ('PE_RCu', 8), ('PE_VPL', 8), - ('live', 6), ] class Screen(Thread): - def __init__(self): + def __init__(self, uncertainty=False): Thread.__init__(self) self.screen = curses.initscr() curses.noecho() @@ -46,6 +49,10 @@ class Screen(Thread): self.acs = {} self.lock_icao = None + self.columns = COLUMNS + if uncertainty: + self.columns.extend(UNCERTAINTY_COLUMNS) + def reset_cursor_pos(self): self.screen.move(self.y, self.x) @@ -73,7 +80,7 @@ class Screen(Thread): row = 1 header = ' icao' - for c, cw in COLUMNS: + for c, cw in self.columns: header += (cw-len(c))*' ' + c # fill end with spaces @@ -105,7 +112,7 @@ class Screen(Thread): line += icao - for c, cw in COLUMNS: + for c, cw in self.columns: if c=='live': val = int(time.time() - ac[c]) elif ac[c] is None: