EGR done
This commit is contained in:
parent
94414a6085
commit
b1d3601a19
@ -182,12 +182,12 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
if not correctEcu and mod_globals.opt_demo:
|
if not correctEcu and mod_globals.opt_demo:
|
||||||
correctEcu = ecusList[0]
|
correctEcu = ecusList[0]
|
||||||
# for i in ecusList:
|
for i in ecusList:
|
||||||
# print i.vdiag
|
print i.vdiag
|
||||||
# print i.ncalib
|
print i.ncalib
|
||||||
# for l in i.buttons.keys():
|
for l in i.buttons.keys():
|
||||||
# print l
|
print l
|
||||||
# print str(i.buttons[l])
|
print str(i.buttons[l])
|
||||||
|
|
||||||
#Prepare buttons
|
#Prepare buttons
|
||||||
buttons = OrderedDict()
|
buttons = OrderedDict()
|
||||||
@ -216,8 +216,13 @@ def run( elm, ecu, command, data ):
|
|||||||
begin = int(ScmParam['Idents'+key+'Begin'])
|
begin = int(ScmParam['Idents'+key+'Begin'])
|
||||||
end = int(ScmParam['Idents'+key+'End'])
|
end = int(ScmParam['Idents'+key+'End'])
|
||||||
identsKeys[key] = {"begin": begin, "end": end}
|
identsKeys[key] = {"begin": begin, "end": end}
|
||||||
for idnum in range(begin ,end + 1):
|
try:
|
||||||
identsList['D'+str(idnum)] = ScmParam['Ident'+str(idnum)]
|
identsList['D'+str(begin)] = ScmParam['Ident'+str(begin)]
|
||||||
|
except:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
for idnum in range(begin ,end + 1):
|
||||||
|
identsList['D'+str(idnum)] = ScmParam['Ident'+str(idnum)]
|
||||||
|
|
||||||
# def getIdents(start, end):
|
# def getIdents(start, end):
|
||||||
# identsDict = OrderedDict()
|
# identsDict = OrderedDict()
|
||||||
@ -257,17 +262,15 @@ def run( elm, ecu, command, data ):
|
|||||||
else:
|
else:
|
||||||
identsList[k] = v
|
identsList[k] = v
|
||||||
|
|
||||||
def resetEGRValve():
|
confirm = get_message_by_id('19800')
|
||||||
|
successMessage = get_message('Message32')
|
||||||
|
failMessage = get_message('MessageNACK')
|
||||||
|
|
||||||
|
def resetValues():
|
||||||
paramToSend = ""
|
paramToSend = ""
|
||||||
params = getValuesToChange("EGR_VALVE")
|
params = getValuesToChange("EGR_VALVE")
|
||||||
|
|
||||||
confirm = get_message_by_id('19800')
|
|
||||||
successMessage = get_message('Message32')
|
|
||||||
failMessage = get_message('MessageNACK')
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
for idKey in range(identsKeys[identsKeys.keys()[0]]['begin'], identsKeys[identsKeys.keys()[0]]['end'] + 1):
|
|
||||||
identsList["D" + str(idKey)] = ecu.get_id(identsList["D" + str(idKey)], 1)
|
|
||||||
|
|
||||||
print buttons[2]
|
print buttons[2]
|
||||||
print
|
print
|
||||||
@ -278,7 +281,22 @@ def run( elm, ecu, command, data ):
|
|||||||
return
|
return
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
|
if not params:
|
||||||
|
print
|
||||||
|
response = ecu.run_cmd(commands['Cmd5'])
|
||||||
|
print
|
||||||
|
if "NR" in response:
|
||||||
|
print failMessage
|
||||||
|
else:
|
||||||
|
print successMessage
|
||||||
|
print
|
||||||
|
ch = raw_input('Press ENTER to exit')
|
||||||
|
return
|
||||||
|
|
||||||
|
for idKey in range(identsKeys[identsKeys.keys()[0]]['begin'], identsKeys[identsKeys.keys()[0]]['end'] + 1):
|
||||||
|
identsList["D" + str(idKey)] = ecu.get_id(identsList["D" + str(idKey)], 1)
|
||||||
|
|
||||||
replaceValues(params)
|
replaceValues(params)
|
||||||
|
|
||||||
for idKey in range(identsKeys[identsKeys.keys()[0]]['begin'], identsKeys[identsKeys.keys()[0]]['end'] + 1):
|
for idKey in range(identsKeys[identsKeys.keys()[0]]['begin'], identsKeys[identsKeys.keys()[0]]['end'] + 1):
|
||||||
@ -286,6 +304,7 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
print
|
print
|
||||||
response = ecu.run_cmd(commands['Cmd5'],paramToSend)
|
response = ecu.run_cmd(commands['Cmd5'],paramToSend)
|
||||||
|
print
|
||||||
if "NR" in response:
|
if "NR" in response:
|
||||||
print failMessage
|
print failMessage
|
||||||
else:
|
else:
|
||||||
@ -294,6 +313,7 @@ def run( elm, ecu, command, data ):
|
|||||||
print
|
print
|
||||||
ch = raw_input('Press ENTER to exit')
|
ch = raw_input('Press ENTER to exit')
|
||||||
|
|
||||||
|
|
||||||
functions = OrderedDict()
|
functions = OrderedDict()
|
||||||
functions[2] = resetEGRValve
|
functions[2] = resetEGRValve
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user