Get idents when screen is loading

This commit is contained in:
Marianpol 2020-02-06 11:27:35 +01:00
parent 957c44e9a2
commit b2dba05257

View File

@ -272,6 +272,22 @@ def run( elm, ecu, command, data ):
def resetValues(title, button, command, rangeKey):
paramToSend = ""
params = getValuesToChange(title)
if params:
idRangeKey = identsKeys[identsKeys.keys()[rangeKey]]
for k,v in params.iteritems():
if v in identsList.keys():
identsList[k] = ecu.get_id(identsList[v], 1)
else:
identsList[k] = v
for idKey in range(idRangeKey['begin'], idRangeKey['end'] + 1):
# print str(idKey), identsList["D" + str(idKey)]
if identsList["D" + str(idKey)].startswith("ID"):
identsList["D" + str(idKey)] = ecu.get_id(identsList["D" + str(idKey)], 1)
paramToSend += identsList["D" + str(idKey)]
# print str(idKey), identsList["D" + str(idKey)]
clearScreen()
@ -305,21 +321,6 @@ def run( elm, ecu, command, data ):
ch = raw_input('Press ENTER to exit')
return
idRangeKey = identsKeys[identsKeys.keys()[rangeKey]]
for k,v in params.iteritems():
if v in identsList.keys():
identsList[k] = ecu.get_id(identsList[v], 1)
else:
identsList[k] = v
for idKey in range(idRangeKey['begin'], idRangeKey['end'] + 1):
# print str(idKey), identsList["D" + str(idKey)]
if identsList["D" + str(idKey)].startswith("ID"):
identsList["D" + str(idKey)] = ecu.get_id(identsList["D" + str(idKey)], 1)
paramToSend += identsList["D" + str(idKey)]
# print str(idKey), identsList["D" + str(idKey)]
print
response = ecu.run_cmd(command,paramToSend)
print