diff --git a/pyren/mod_ecu_default.py b/pyren/mod_ecu_default.py index 8c02eb3..fb9ad13 100644 --- a/pyren/mod_ecu_default.py +++ b/pyren/mod_ecu_default.py @@ -56,10 +56,12 @@ def get_default_std_a( df, mn, se, elm, calc, getDTCmnemo ): hex_val = get_mnemonicDTC( mn[m], '57 01 '+ DTCs ) comp = comp.replace(m, "0x"+hex_val) isExists = calc.calculate(comp) - # if isExists==0: #ignore error if it's definition does not exist - # DTCs = DTCs[9:] - # continue - + + if not mod_globals.opt_minordtc: + if isExists==0: #ignore error if it's definition does not exist + DTCs = DTCs[9:] + continue + # Check if the default is alive infoPeriod = df[dtc].interpInfoPeri @@ -76,16 +78,18 @@ def get_default_std_a( df, mn, se, elm, calc, getDTCmnemo ): # if the self.status eq 1 then default is alive # if the self.status eq 2 then default is memorised - # if df[dtc].status==0: #ignore error if it's definition does not exist - # DTCs = DTCs[9:] - # continue + if not mod_globals.opt_minordtc: + if df[dtc].status==0: #ignore error if it's definition does not exist + DTCs = DTCs[9:] + continue isAlive = "" if df[dtc].status==1: isAlive = mod_globals.language_dict['16882'] #ALIVE else: isAlive = mod_globals.language_dict['646'] #MEMORISED - # if df[dtc].status==0: #ignore error if it's definition does not exist - # DTCs = DTCs[9:] - # continue + if not mod_globals.opt_minordtc: + if df[dtc].status==0: #ignore error if it's definition does not exist + DTCs = DTCs[9:] + continue # Now get the interpretation @@ -167,9 +171,10 @@ def get_default_std_b( df, mn, se, elm, calc, getDTCmnemo ): comp = comp.replace(m, "0x"+hex_val) isExists = calc.calculate(comp) - # if isExists==0: #ignore error if it's definition does not exist - # DTCs = DTCs[12:] - # continue + if not mod_globals.opt_minordtc: + if isExists==0: #ignore error if it's definition does not exist + DTCs = DTCs[12:] + continue # Check if the default is alive @@ -186,9 +191,10 @@ def get_default_std_b( df, mn, se, elm, calc, getDTCmnemo ): # if the self.status eq 1 then default is alive # if the self.status eq 2 then default is memorised - # if df[dtc].status==0: #ignore error if it's definition does not exist - # DTCs = DTCs[12:] - # continue + if not mod_globals.opt_minordtc: + if df[dtc].status==0: #ignore error if it's definition does not exist + DTCs = DTCs[12:] + continue isAlive = "" if df[dtc].status==1: isAlive = mod_globals.language_dict['16882'] #ALIVE diff --git a/pyren/mod_globals.py b/pyren/mod_globals.py index da6c8af..0456b28 100755 --- a/pyren/mod_globals.py +++ b/pyren/mod_globals.py @@ -35,7 +35,7 @@ opt_obdlink = False #basically, STN(PIC24) based ELM327 opt_stn = False #STN(PIC24) ELM327 which has ability to automatically switch beetween two CAN lines opt_sd = False #separate doc files opt_perform = False - +opt_minordtc = False dumpName = "" state_scan = False diff --git a/pyren/mod_term.py b/pyren/mod_term.py index 203c997..bf8c098 100755 --- a/pyren/mod_term.py +++ b/pyren/mod_term.py @@ -248,6 +248,11 @@ def optParser(): default=False, action="store_true") + parser.add_argument("--minordtc", + help="use to show all DTCs without checking computation formula", + dest="minordtc", + default=False, + action="store_true") options = parser.parse_args() @@ -270,6 +275,7 @@ def optParser(): mod_globals.opt_si = options.si mod_globals.opt_cfc0 = options.cfc mod_globals.opt_n1c = options.n1c + mod_globals.opt_minordtc = options.minordtc auto_dia = options.dia debug_mode = options.dbg diff --git a/pyren/pyren.py b/pyren/pyren.py index 63592a2..159406e 100755 --- a/pyren/pyren.py +++ b/pyren/pyren.py @@ -202,6 +202,12 @@ def optParser(): default=False, action="store_true") + parser.add_argument("--minordtc", + help="use to show all DTCs without checking computation formula", + dest="minordtc", + default=False, + action="store_true") + options = parser.parse_args() if not options.port and mod_globals.os != 'android': @@ -239,6 +245,7 @@ def optParser(): mod_globals.opt_can2 = options.can2 mod_globals.opt_perform = options.perform mod_globals.opt_sd = options.sd + mod_globals.opt_minordtc = options.minordtc if options.dev=='' or len(options.dev)!=4 or options.dev[0:2]!='10': mod_globals.opt_dev = False mod_globals.opt_devses = '1086'