From b2dba05257da11df24cdec537c5ace22b46e7a3c Mon Sep 17 00:00:00 2001 From: Marianpol Date: Thu, 6 Feb 2020 11:27:35 +0100 Subject: [PATCH] Get idents when screen is loading --- pyren/scen_ecri_paraminj1.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pyren/scen_ecri_paraminj1.py b/pyren/scen_ecri_paraminj1.py index 08f89db..b091aaa 100644 --- a/pyren/scen_ecri_paraminj1.py +++ b/pyren/scen_ecri_paraminj1.py @@ -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