diff --git a/python/rds_parser_table_qt.py b/python/rds_parser_table_qt.py index 8f80c2e..b8cc537 100644 --- a/python/rds_parser_table_qt.py +++ b/python/rds_parser_table_qt.py @@ -696,7 +696,7 @@ class rds_parser_table_qt(gr.sync_block):#START self.message_port_pub(pmt.intern('tmc_raw'), send_pmt) #~ tmc_hash=md5.new(str([PI,tmc_x,tmc_y,tmc_z])).hexdigest() - #~ tmc_T=tmc_x>>4 #0:TMC-message 1:tuning info/service provider name + tmc_T=tmc_x>>4 #0:TMC-message 1:tuning info/service provider name #~ tmc_F=int((tmc_x>>3)&0x1) #identifies the message as a Single Group (F = 1) or Multi Group (F = 0) #~ Y15=int(tmc_y>>15) #~ try: diff --git a/python/tmc_parser.py b/python/tmc_parser.py index 0683055..37c0c44 100644 --- a/python/tmc_parser.py +++ b/python/tmc_parser.py @@ -50,6 +50,7 @@ class tmc_parser(gr.sync_block): self.TMC_data={} self.tmc_messages=tmc_dict() atexit.register(self.goodbye) + self.save_data_timer=time.time() if self.writeDB: #create new DB file db_name=workdir+'RDS_data'+datetime.now().strftime("%Y%m%d_%H%M%S")+'_TMC.db' @@ -120,6 +121,9 @@ class tmc_parser(gr.sync_block): def initialize_data_for_PI(self,PI): self.unfinished_messages[PI]={} def handle_msg(self,msg): + if time.time()-self.save_data_timer > 10:#every 10 seconds + self.save_data_timer=time.time() + self.save_data() m=pmt.to_python(msg) PI=m["PI"] if not self.unfinished_messages.has_key(PI):