From 7238ea11d6d3a2f13b54001a54a3cd87446443b7 Mon Sep 17 00:00:00 2001 From: shrlnm Date: Wed, 8 Mar 2023 16:11:17 +0300 Subject: [PATCH] fix SAUF operand processing and allvins --- pyren3/mod_acf_proc.py | 5 +++-- pyren3/mod_ecu.py | 10 ++++++++-- pyren3/mod_mtc.py | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pyren3/mod_acf_proc.py b/pyren3/mod_acf_proc.py index 9341dfe..ab6fbcf 100644 --- a/pyren3/mod_acf_proc.py +++ b/pyren3/mod_acf_proc.py @@ -169,7 +169,7 @@ def acf_MTC_generateDefaults( m, mtc ): # write trailer sf.write('\n# VIN programming !!!check the command!!!\n') sf.write('#2EF190' + hex_VIN_plus_CRC(mod_globals.vin, False) +'\n') - sf.write('#3B81' + hex_VIN_plus_CRC(mod_globals.vin, False) +'\n') + sf.write('#3B81' + hex_VIN_plus_CRC(mod_globals.vin, True) +'\n') sf.write('\n# reset ecu or disconnect the battary!!!check the command!!!\n') sf.write('#1101\n\n') sf.write('exit\n') @@ -255,7 +255,8 @@ def acf_MTC_optinInfluence( m, option ): res = acf_MTC_compare(op.MTC, option) if res: tmpMTC = op.MTC.split() - if len(tmpMTC)==2 and tmpMTC[0]=='SAUF' and tmpMTC[1]!=option: continue + if op.MTC.startswith('SAUF'): continue + #if len(tmpMTC)==2 and tmpMTC[0]=='SAUF' and tmpMTC[1]!=option: continue out = out + '%-100s;%-30s;%-10s;%s\n'%(cu.DI, op.MTC, op.VW, op.TEX) #out = out + '%-100s;%-30s;%-10s;%s\n'%(cu.TE, op.MTC, op.VW, op.TEX) #break diff --git a/pyren3/mod_ecu.py b/pyren3/mod_ecu.py index f4d8b51..3aecb6c 100755 --- a/pyren3/mod_ecu.py +++ b/pyren3/mod_ecu.py @@ -397,10 +397,16 @@ class ECU: nparams = 0 for dr in datarefs: if dr.type=='State': - csvline += ";" + self.States[dr.name].codeMR + ":" + self.States[dr.name].label + if mod_globals.opt_csv_only: + csvline += ";" + self.States[dr.name].codeMR + else: + csvline += ";" + self.States[dr.name].codeMR + ":" + self.States[dr.name].label nparams += 1 if dr.type=='Parameter': - csvline += (";" + self.Parameters[dr.name].codeMR + ":" +self.Parameters[dr.name].label + " [" + self.Parameters[dr.name].unit + "]") + if mod_globals.opt_csv_only: + csvline += ";" + self.Parameters[dr.name].codeMR + else: + csvline += (";" + self.Parameters[dr.name].codeMR + ":" +self.Parameters[dr.name].label + " [" + self.Parameters[dr.name].unit + "]") nparams += 1 if mod_globals.opt_usrkey: csvline += ";User events" csvline = pyren_encode(csvline) diff --git a/pyren3/mod_mtc.py b/pyren3/mod_mtc.py index 1f7e151..868cbda 100644 --- a/pyren3/mod_mtc.py +++ b/pyren3/mod_mtc.py @@ -104,7 +104,7 @@ def acf_buildFull( platf ): VIN2 = i.split('.')[0] print(' '+VIN2) zf=zip.open(i) - vin3list=str(zf.read()) + vin3list=zf.read().decode("utf-8") zf.close() for l in vin3list.split('\n'): l = l.strip() @@ -241,9 +241,9 @@ def acf_MTC_finde( mtc_tag, mtc ): mtc_tag = mtc_tag.strip() - if mtc_tag.startswith('SAUF '): + if mtc_tag.startswith('SAUF'): sauf = True - mtc_tag = mtc_tag[5:] + mtc_tag = mtc_tag[4:].strip() if mtc_tag in mtc: #if mtc_tag==mtc: