Check for non param command
This commit is contained in:
parent
8d623a91ff
commit
7199698cf0
@ -235,14 +235,14 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
#Get identifications
|
#Get identifications
|
||||||
identsList = OrderedDict()
|
identsList = OrderedDict()
|
||||||
identsKeys = OrderedDict()
|
identsRangeKeys = OrderedDict()
|
||||||
|
|
||||||
for param in ScmParam.keys():
|
for param in ScmParam.keys():
|
||||||
if param.startswith('Idents') and param.endswith('Begin'):
|
if param.startswith('Idents') and param.endswith('Begin'):
|
||||||
key = param[6:-5]
|
key = param[6:-5]
|
||||||
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}
|
identsRangeKeys[key] = {"begin": begin, "end": end}
|
||||||
try: #10099 trap
|
try: #10099 trap
|
||||||
identsList['D'+str(begin)] = ScmParam['Ident'+str(begin)]
|
identsList['D'+str(begin)] = ScmParam['Ident'+str(begin)]
|
||||||
except:
|
except:
|
||||||
@ -339,7 +339,7 @@ def run( elm, ecu, command, data ):
|
|||||||
print
|
print
|
||||||
print inProgressMessage
|
print inProgressMessage
|
||||||
|
|
||||||
idRangeKey = identsKeys[identsKeys.keys()[rangeKey]]
|
idRangeKey = identsRangeKeys[identsRangeKeys.keys()[rangeKey]]
|
||||||
|
|
||||||
identsList[params["IdentToBeDisplayed"].replace("Ident", "D")] = typesButtons[choice[0]]
|
identsList[params["IdentToBeDisplayed"].replace("Ident", "D")] = typesButtons[choice[0]]
|
||||||
|
|
||||||
@ -365,10 +365,18 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
def resetValues(title, button, command, rangeKey):
|
def resetValues(title, button, command, rangeKey):
|
||||||
paramToSend = ""
|
paramToSend = ""
|
||||||
|
commandTakesParams = True
|
||||||
params = getValuesToChange(title)
|
params = getValuesToChange(title)
|
||||||
|
|
||||||
if params:
|
commandServices = ecu.Commands[command.replace("VP", "V")].serviceID
|
||||||
idRangeKey = identsKeys[identsKeys.keys()[rangeKey]]
|
for sid in commandServices:
|
||||||
|
if not ecu.Services[sid].params: #For INLET_FLAP VP042 in 10959 or VP018 EGR_VALVE in 10527
|
||||||
|
commandTakesParams = False
|
||||||
|
else:
|
||||||
|
commandTakesParams = True
|
||||||
|
|
||||||
|
if commandTakesParams:
|
||||||
|
idRangeKey = identsRangeKeys[identsRangeKeys.keys()[rangeKey]]
|
||||||
|
|
||||||
for k,v in params.iteritems():
|
for k,v in params.iteritems():
|
||||||
if v in identsList.keys():
|
if v in identsList.keys():
|
||||||
@ -382,7 +390,6 @@ def run( elm, ecu, command, data ):
|
|||||||
identsList["D" + str(idKey)] = ecu.get_id(identsList["D" + str(idKey)], 1)
|
identsList["D" + str(idKey)] = ecu.get_id(identsList["D" + str(idKey)], 1)
|
||||||
paramToSend += identsList["D" + str(idKey)]
|
paramToSend += identsList["D" + str(idKey)]
|
||||||
# print str(idKey), identsList["D" + str(idKey)]
|
# print str(idKey), identsList["D" + str(idKey)]
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print mainText
|
print mainText
|
||||||
@ -405,9 +412,9 @@ def run( elm, ecu, command, data ):
|
|||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print
|
print
|
||||||
if params:
|
if commandTakesParams:
|
||||||
response = ecu.run_cmd(command,paramToSend)
|
response = ecu.run_cmd(command,paramToSend)
|
||||||
else: #VP042 for INLET_FLAP
|
else:
|
||||||
response = ecu.run_cmd(command)
|
response = ecu.run_cmd(command)
|
||||||
print
|
print
|
||||||
|
|
||||||
@ -438,7 +445,7 @@ def run( elm, ecu, command, data ):
|
|||||||
functions[4] = ["PARTICLE_FILTER", 4, commands['Cmd7'], 2]
|
functions[4] = ["PARTICLE_FILTER", 4, commands['Cmd7'], 2]
|
||||||
functions[5] = ["Button5ChangeData", 5, commands['Cmd7'], 2]
|
functions[5] = ["Button5ChangeData", 5, commands['Cmd7'], 2]
|
||||||
if cmdKey == 'Cmd9':
|
if cmdKey == 'Cmd9':
|
||||||
functions[8] = ["Button8DisplayData", 8, commands["Cmd9"], len(identsKeys) - 1]
|
functions[8] = ["Button8DisplayData", 8, commands["Cmd9"], len(identsRangeKeys) - 1]
|
||||||
|
|
||||||
infoMessage = get_message('Message1')
|
infoMessage = get_message('Message1')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user