Clemens Richter 9 years ago
parent
commit
1948a0b66e
  1. 4
      apps/fft-multi-decoder_fixed_hackrf.grc
  2. 6
      python/rds_parser_table_qt.py

4
apps/fft-multi-decoder_fixed_hackrf.grc

@ -3170,7 +3170,7 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
</param> </param>
<param> <param>
<key>writeDB</key> <key>writeDB</key>
<value>False</value> <value>True</value>
</param> </param>
</block> </block>
<block> <block>
@ -3244,7 +3244,7 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
</param> </param>
<param> <param>
<key>_enabled</key> <key>_enabled</key>
<value>0</value> <value>1</value>
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>

6
python/rds_parser_table_qt.py

@ -105,6 +105,7 @@ class rds_parser_table_qt(gr.sync_block):#START
db_name=workdir+'RDS_data'+datetime.now().strftime("%Y%m%d_%H%M%S")+'.db' db_name=workdir+'RDS_data'+datetime.now().strftime("%Y%m%d_%H%M%S")+'.db'
db=sqlite3.connect(db_name, check_same_thread=False) db=sqlite3.connect(db_name, check_same_thread=False)
self.db=db self.db=db
self.dbLock=QtCore.QSemaphore(1)
#create tables #create tables
try: try:
db.execute('''CREATE TABLE stations db.execute('''CREATE TABLE stations
@ -186,7 +187,9 @@ class rds_parser_table_qt(gr.sync_block):#START
self.PI_dict[PI]-=1 self.PI_dict[PI]-=1
#print(self.PI_dict) #print(self.PI_dict)
if self.writeDB: if self.writeDB:
self.dbLock.acquire(1)
self.db.commit() self.db.commit()
self.dbLock.release(1)
def update_freq(self): def update_freq(self):
# "&#9;" is a tab character # "&#9;" is a tab character
message_string="decoder frequencies:" message_string="decoder frequencies:"
@ -299,6 +302,7 @@ class rds_parser_table_qt(gr.sync_block):#START
#self.signals.DataUpdateEvent.emit({'group_count':self.minute_count,'group_count_max':self.minute_count_max}) #self.signals.DataUpdateEvent.emit({'group_count':self.minute_count,'group_count_max':self.minute_count_max})
if self.writeDB: if self.writeDB:
#db=sqlite3.connect(self.db_name) #db=sqlite3.connect(self.db_name)
#self.dbLock.acquire(1)
db=self.db db=self.db
@ -974,6 +978,8 @@ class rds_parser_table_qt(gr.sync_block):#START
#print("group of type %s not decoded on station %s"% (groupType,PI)) #print("group of type %s not decoded on station %s"% (groupType,PI))
pr.disable() #disabled-internal-profiling pr.disable() #disabled-internal-profiling
#if self.writeDB:
# self.dbLock.release(1)
#end of handle_msg #end of handle_msg
def print_results(self): def print_results(self):
s = StringIO.StringIO() s = StringIO.StringIO()

Loading…
Cancel
Save