From 24a2d39562e69204a280eca6a0444a6540e23836 Mon Sep 17 00:00:00 2001 From: "Ryan@interlock" Date: Fri, 24 May 2024 15:14:15 -0400 Subject: [PATCH] various bugs fix --- Listen2Arduino.py | 6 +++++- serial_relay.py | 2 +- statusDisplay/display.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Listen2Arduino.py b/Listen2Arduino.py index 60a9f89..b9fddb3 100755 --- a/Listen2Arduino.py +++ b/Listen2Arduino.py @@ -123,7 +123,11 @@ while True: else: with open(tri_file, 'r') as file: tri_reading = file.read() - point.field("Tritium", float(tri_reading)) + try: + point.field("Tritium", float(tri_reading)) + except: + tri_reading = nan + print("cannot read TRI_reading.txt") with open(outFile, "w") as file: for key, value in format_value.items(): diff --git a/serial_relay.py b/serial_relay.py index 0048c84..330a055 100755 --- a/serial_relay.py +++ b/serial_relay.py @@ -28,7 +28,7 @@ try: print("Received:", data, ":", data[3:8], "=", int(data[3:8],16),":",round(reading)) #write to file with open(file_path, 'w') as file: - file.write(str(round(reading))) + file.write(str(float(reading))) if reading >50: GPIO.output(17, GPIO.LOW) #print ("ON") diff --git a/statusDisplay/display.cpp b/statusDisplay/display.cpp index 6a61989..420d6b7 100644 --- a/statusDisplay/display.cpp +++ b/statusDisplay/display.cpp @@ -266,7 +266,7 @@ int main() { } } - textDisplay( "Tritium Sensor : " + FormatDouble(tritiumReading) + " mCr", 720, 200, isTritiumError ? redColor : blueColor); + textDisplay( "Tritium Sensor : " + FormatDouble(tritiumReading) + " uCr/m3", 720, 200, isTritiumError ? redColor : blueColor); textDisplay( "Vaccum : " + FormatDouble(vaccumReading) + "x1e-6 Torr", 630, 20, isVaccumError ? redColor: blueColor); textDisplay( "SubPump : " + FormatDouble(subPumpReading*1000) + " mA", 300, 40, blueColor);