Write one valve fix

This commit is contained in:
Marianpol 2020-06-30 00:07:28 +02:00
parent a4c8379eb2
commit c440cf7202
2 changed files with 12 additions and 8 deletions

View File

@ -27,7 +27,7 @@ def playScenario(command, ecu, elm):
ecuNumberPattern = re.compile(r'\d{5}') ecuNumberPattern = re.compile(r'\d{5}')
ecuNumberIndex = ecuNumberPattern.search(scenarioData) ecuNumberIndex = ecuNumberPattern.search(scenarioData)
scenarioName = scenarioData[:scenarioData.find(ecuNumberIndex.group(0)) - 1].lower() scenarioName = scenarioData[:scenarioData.find(ecuNumberIndex.group(0)) - 1].lower()
if os.path.isfile('./'+scenarioName+'.py'): if os.path.isfile('./'+scenarioName+'.py'):
scen = __import__( scenarioName ) scen = __import__( scenarioName )
if mod_globals.clip_arc: if mod_globals.clip_arc:

View File

@ -261,7 +261,7 @@ def run( elm, ecu, command, data ):
clearScreen() clearScreen()
print screen print screen
print print
choice = Choice(valveLabelsDict.values(), get_message_by_id('14127', False).replace('.',':')) choice = Choice(valveLabelsDict.values(), get_message_by_id('14127').replace('.',':'))
clearScreen() clearScreen()
print screen print screen
@ -282,13 +282,17 @@ def run( elm, ecu, command, data ):
paramToSend = '' paramToSend = ''
if summerTyresSet: if summerTyresSet:
for code in summerTyreCodes: for code in range(len(summerTyreCodes)):
paramToSend += code if code == selectedValveKey:
paramToSend = paramToSend.replace(summerTyreCodes[selectedValveKey], userCode) paramToSend += userCode
else:
paramToSend += summerTyreCodes[code]
else: else:
for code in winterTyreCodes: for code in range(len(winterTyreCodes)):
paramToSend += code if code == selectedValveKey:
paramToSend = paramToSend.replace(winterTyreCodes[selectedValveKey], userCode) paramToSend += userCode
else:
paramToSend += winterTyreCodes[code]
clearScreen() clearScreen()
print screen print screen