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>
<key>writeDB</key>
<value>False</value>
<value>True</value>
</param>
</block>
<block>
@ -3244,7 +3244,7 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
</param>
<param>
<key>_enabled</key>
<value>0</value>
<value>1</value>
</param>
<param>
<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=sqlite3.connect(db_name, check_same_thread=False)
self.db=db
self.dbLock=QtCore.QSemaphore(1)
#create tables
try:
db.execute('''CREATE TABLE stations
@ -186,7 +187,9 @@ class rds_parser_table_qt(gr.sync_block):#START
self.PI_dict[PI]-=1
#print(self.PI_dict)
if self.writeDB:
self.dbLock.acquire(1)
self.db.commit()
self.dbLock.release(1)
def update_freq(self):
# "&#9;" is a tab character
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})
if self.writeDB:
#db=sqlite3.connect(self.db_name)
#self.dbLock.acquire(1)
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))
pr.disable() #disabled-internal-profiling
#if self.writeDB:
# self.dbLock.release(1)
#end of handle_msg
def print_results(self):
s = StringIO.StringIO()

Loading…
Cancel
Save