From d4620e2bfe043e02841e124d781291fb4623dec0 Mon Sep 17 00:00:00 2001 From: csrichter Date: Fri, 19 May 2017 12:49:13 +0200 Subject: [PATCH] fixed error in handling of duplicate MGM heads --- python/tmc_classes.py | 2 +- python/tmc_parser.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/tmc_classes.py b/python/tmc_classes.py index 5db19c6..1b1ef11 100644 --- a/python/tmc_classes.py +++ b/python/tmc_classes.py @@ -917,7 +917,7 @@ class tmc_message: self.ci=int(tmc_x&0x7) #continuity index self.data_arr=BitArray() self.mgm_list=[] - self.length=0 + #self.length=0# attribute error is catched and signals incomplete mgm self.location=tmc_location(tmc_z,tableobj) #self.event=int(tmc_y&0x7ff) #Y10-Y0 self.event=tmc_event(int(tmc_y&0x7ff),self.tableobj) #Y10-Y0 diff --git a/python/tmc_parser.py b/python/tmc_parser.py index d000236..da90022 100644 --- a/python/tmc_parser.py +++ b/python/tmc_parser.py @@ -183,11 +183,12 @@ class tmc_parser(gr.sync_block): ci=int(tmc_x&0x7) tmc_msg=tmc_message(PI,psn,ltn,tmc_x,tmc_y,tmc_z,datetime_received,self) self.dataLock.acquire(1) - self.tmc_messages.add(tmc_msg) + message_is_repeat=self.tmc_messages.add(tmc_msg) self.dataLock.release(1) #if self.RDS_data[PI]["internals"]["unfinished_TMC"].has_key(ci): #print("overwriting parital message") - self.unfinished_messages[PI][ci]={"msg":tmc_msg,"time":time.time()} + if not message_is_repeat:#save unfinished message only once (dont overwrite collected additional groups) + self.unfinished_messages[PI][ci]={"msg":tmc_msg,"time":time.time()} else: ci=int(tmc_x&0x7) if self.unfinished_messages[PI].has_key(ci):