From 49f4a74f0d80ec442150c09e55d3acb6759054dd Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Tue, 14 Jun 2016 13:00:07 +0200 Subject: [PATCH] CIM/CIU log support in gf.py --- .local/bin/gf.py | 29 ++++++++++++++++++++++++----- .local/bin/gf_config.py | 3 ++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.local/bin/gf.py b/.local/bin/gf.py index 8cca2f9..2fd711c 100755 --- a/.local/bin/gf.py +++ b/.local/bin/gf.py @@ -61,11 +61,24 @@ def readtimestamp(line): h=int(info[0].split(' ')[1]) m=int(info[1]) s=info[2].split('.') - u=s[1].split(' ') - ts=datetime.combine(date.today(),time(h,m,int(s[0]),int(u[0])*1000)) - line=s[1][4:] + ts=datetime.combine(date.today(),time(h,m,int(s[0]),int(s[1])*1000)) + line=info[3][1:] except: pass + +# if timestamp>1e9: # 2001-09-09 +# pass +# else: +# try: +# h=int(info[0].split(' ')[1]) +# m=int(info[1]) +# s=info[2].split('.') +# u=s[1].split(' ') +# ts=datetime.combine(date.today(),time(h,m,int(s[0]),int(u[0])*1000)) +# line=s[1][4:] +# except: +# pass +# print(ts) return ts,line @@ -134,9 +147,15 @@ def process_data(line,le,size1,size2): tmp,line=readbyte(line) val[i]=(val[i]<<8)+tmp if size1>0 and size2>0: - print(gf.params[cl][ids[i]],"=",val[i]) + if gf.params[cl][ids[i]] != "": + print(gf.params[cl][ids[i]],"=",val[i]) + else: + print("Id:",ids[i],"=",val[i]) elif size1>0: - print(gf.params[cl][ids[i]]) + if gf.params[cl][ids[i]] != "": + print(gf.params[cl][ids[i]]) + else: + print("Id:",ids[i]) elif size2>0: print("=",val[i]) return ids,val,line diff --git a/.local/bin/gf_config.py b/.local/bin/gf_config.py index 4729a5a..225aedb 100644 --- a/.local/bin/gf_config.py +++ b/.local/bin/gf_config.py @@ -610,7 +610,8 @@ class10[55]="event_back_log" class10[56]="mge_event_log_obj" class10[57]="event_connect_obj" class10[71]="geniair_appl_bind_tab" -class10[72]="geniair_nwk_status_obj" class10[73]="twin_pump_data_exch_obj" +class10[72]="geniair_nwk_status_obj" +class10[73]="twin_pump_data_exch_obj" class10[74]="max_power_log_records_obj" class10[76]="pump_setup_options_obj" class10[77]="multi_pump_sync_obj" -- 2.43.0