Make voltage & temperature test repeatable
This commit is contained in:
@ -31,10 +31,10 @@ def recive(bustype="socketcan", channel="can0"):
|
|||||||
return message
|
return message
|
||||||
|
|
||||||
|
|
||||||
def waitForUserInput(waitForUserInput):
|
def waitForUserInput(waitForUserInput, prompt="Ready to start?"):
|
||||||
if waitForUserInput:
|
if waitForUserInput:
|
||||||
readInput = "n"
|
readInput = "n"
|
||||||
print("Ready to start ? ")
|
print(prompt)
|
||||||
while "y" not in readInput:
|
while "y" not in readInput:
|
||||||
print("Enter y to start or c to cancel ")
|
print("Enter y to start or c to cancel ")
|
||||||
readInput = input(" ")
|
readInput = input(" ")
|
||||||
|
|||||||
@ -44,6 +44,7 @@ def verifyNumbers(numberListList):
|
|||||||
|
|
||||||
|
|
||||||
def tempTest():
|
def tempTest():
|
||||||
|
while True:
|
||||||
print("====================")
|
print("====================")
|
||||||
print("starting temperature test ")
|
print("starting temperature test ")
|
||||||
canTest.waitForUserInput(True)
|
canTest.waitForUserInput(True)
|
||||||
@ -61,4 +62,6 @@ def tempTest():
|
|||||||
changed.append(((te >> 4) * 0.0625))
|
changed.append(((te >> 4) * 0.0625))
|
||||||
print("Interpreted temperatures:")
|
print("Interpreted temperatures:")
|
||||||
print(changed)
|
print(changed)
|
||||||
|
if canTest.waitForUserInput(True, "Repeat temperature test?") != 0:
|
||||||
|
break
|
||||||
print("I am done with this shit")
|
print("I am done with this shit")
|
||||||
|
|||||||
@ -52,6 +52,7 @@ def verifyNumbers(numberListList):
|
|||||||
def voltagesTest():
|
def voltagesTest():
|
||||||
print("====================")
|
print("====================")
|
||||||
print("starting voltage test pls but 3.500 as reference value")
|
print("starting voltage test pls but 3.500 as reference value")
|
||||||
|
while True:
|
||||||
canTest.waitForUserInput(True)
|
canTest.waitForUserInput(True)
|
||||||
voltages = getBatteryVoltageOverCan() # rausfinden welche id der Slave hat
|
voltages = getBatteryVoltageOverCan() # rausfinden welche id der Slave hat
|
||||||
allVoltages = []
|
allVoltages = []
|
||||||
@ -60,3 +61,5 @@ def voltagesTest():
|
|||||||
|
|
||||||
verifyNumbers(allVoltages)
|
verifyNumbers(allVoltages)
|
||||||
print("I am done with this shit")
|
print("I am done with this shit")
|
||||||
|
if canTest.waitForUserInput(True, "Repeat voltage test?") != 0:
|
||||||
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user