outputs = [] #registry of plugin output functions updates = [] #registry of plugin update functions if options.kml is not None: sqlport = modes_output_sql(my_position, 'adsb.db') #create a SQL parser to push stuff into SQLite outputs.append(sqlport.insert) #also we spawn a thread to run every 30 seconds (or whatever) to generate KML kmlgen = modes_kml('adsb.db', options.kml, my_position) #create a KML generating thread which reads the database if options.sbs1 is True: sbs1port = modes_output_sbs1(my_position) outputs.append(sbs1port.output) updates.append(sbs1port.add_pending_conns) if options.no_print is not True: outputs.append(modes_output_print(my_position).parse) if options.raw is True: rawport = modes_raw_server() outputs.append(rawport.output) outputs.append(printraw) updates.append(rawport.add_pending_conns) fg = adsb_rx_block(options, args, queue) runner = top_block_runner(fg) while 1: try: #the update registry is really for the SBS1 and raw server plugins -- we're looking for new TCP connections. #i think we have to do this here rather than in the output handler because otherwise connections will stack up #until the next output arrives
#!/usr/bin/env python import modes_print infile = open("27augrudi3.txt") printer = modes_print.modes_output_print([37.409348,-122.07732]) for line in infile: printer.parse(line)
sqlport = modes_output_sql( my_position, 'adsb.db') #create a SQL parser to push stuff into SQLite outputs.append(sqlport.insert) #also we spawn a thread to run every 30 seconds (or whatever) to generate KML kmlgen = modes_kml( 'adsb.db', options.kml, my_position ) #create a KML generating thread which reads the database if options.sbs1 is True: sbs1port = modes_output_sbs1(my_position) outputs.append(sbs1port.output) updates.append(sbs1port.add_pending_conns) if options.no_print is not True: outputs.append(modes_output_print(my_position).parse) if options.raw is True: rawport = modes_raw_server() outputs.append(rawport.output) outputs.append(printraw) updates.append(rawport.add_pending_conns) fg = adsb_rx_block(options, args, queue) runner = top_block_runner(fg) while 1: try: #the update registry is really for the SBS1 and raw server plugins -- we're looking for new TCP connections. #i think we have to do this here rather than in the output handler because otherwise connections will stack up #until the next output arrives