KML at least works some. Need to pass DB filename into KML constructor.
This commit is contained in:
parent
76f884e81f
commit
0edcc29380
Binary file not shown.
Binary file not shown.
@ -19,7 +19,6 @@
|
|||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
#!/usr/bin/env python
|
|
||||||
import time, os, sys
|
import time, os, sys
|
||||||
from string import split, join
|
from string import split, join
|
||||||
import modes_parse
|
import modes_parse
|
||||||
@ -28,7 +27,7 @@ import sqlite3
|
|||||||
class modes_output_sql(modes_parse.modes_parse):
|
class modes_output_sql(modes_parse.modes_parse):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
#create the database
|
#create the database
|
||||||
self.db = sqlite3.connect(':memory:') #RAM-based database, no persistence
|
self.db = sqlite3.connect('wat.db') #RAM-based database, no persistence
|
||||||
#now execute a schema to create the tables you need
|
#now execute a schema to create the tables you need
|
||||||
c = self.db.cursor()
|
c = self.db.cursor()
|
||||||
query = """CREATE TABLE "positions" (
|
query = """CREATE TABLE "positions" (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#
|
#!/usr/bin/env python
|
||||||
# Copyright 2010 Nick Foster
|
# Copyright 2010 Nick Foster
|
||||||
#
|
#
|
||||||
# This file is part of gr-air-modes
|
# This file is part of gr-air-modes
|
||||||
@ -19,8 +19,6 @@
|
|||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
#!/usr/bin/env python
|
|
||||||
from gnuradio import gr, gru, optfir, eng_notation, blks2, air
|
from gnuradio import gr, gru, optfir, eng_notation, blks2, air
|
||||||
from gnuradio import uhd
|
from gnuradio import uhd
|
||||||
from gnuradio.eng_option import eng_option
|
from gnuradio.eng_option import eng_option
|
||||||
@ -31,6 +29,7 @@ from usrpm import usrp_dbid
|
|||||||
from modes_print import modes_output_print
|
from modes_print import modes_output_print
|
||||||
from modes_sql import modes_output_sql
|
from modes_sql import modes_output_sql
|
||||||
from modes_sbs1 import modes_output_sbs1
|
from modes_sbs1 import modes_output_sbs1
|
||||||
|
from modes_kml import modes_kml
|
||||||
import gnuradio.gr.gr_threading as _threading
|
import gnuradio.gr.gr_threading as _threading
|
||||||
|
|
||||||
class top_block_runner(_threading.Thread):
|
class top_block_runner(_threading.Thread):
|
||||||
@ -136,10 +135,10 @@ if __name__ == '__main__':
|
|||||||
updates = [] #registry of plugin update functions
|
updates = [] #registry of plugin update functions
|
||||||
|
|
||||||
if options.kml is not None:
|
if options.kml is not None:
|
||||||
sqlport = modes_output_sql()
|
sqlport = modes_output_sql() #create a SQL parser to push stuff into SQLite
|
||||||
outputs.append(sqlport.insert)
|
outputs.append(sqlport.insert)
|
||||||
#also we spawn a thread to run every 30 seconds (or whatever) to generate KML
|
#also we spawn a thread to run every 30 seconds (or whatever) to generate KML
|
||||||
kmlgen = modes_kml(sqlport.db, options.kml) #this is a thread
|
kmlgen = modes_kml(sqlport.db, options.kml) #create a KML generating thread which reads the database
|
||||||
|
|
||||||
if options.sbs1 is True:
|
if options.sbs1 is True:
|
||||||
sbs1port = modes_output_sbs1()
|
sbs1port = modes_output_sbs1()
|
||||||
@ -176,6 +175,6 @@ if __name__ == '__main__':
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
fg.stop()
|
fg.stop()
|
||||||
runner = None
|
runner = None
|
||||||
if kmlgen is not None: #this breaks your nice output registry scheme
|
if options.kml is not None:
|
||||||
kmlgen = None
|
kmlgen.done = True
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user