From 5cbfcdc60ab48133c2501854f6710f9b5bb4bfff Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Thu, 29 May 2025 18:52:47 -0600 Subject: [PATCH] fixed continuity sense to work with armed switch in either position --- ui/app.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/app.py b/ui/app.py index 447424d..1d7abc9 100755 --- a/ui/app.py +++ b/ui/app.py @@ -295,6 +295,8 @@ class App: t = time.localtime() current_time = time.strftime("%Y:%m:%d %H:%M:%S", t) + armed = sense_armed() + for id in VOLTAGES: chan = ctrl.find_channel(id) rawstring = chan.attrs['raw'].value @@ -305,15 +307,21 @@ class App: case 'voltage1': thrust = '%.3f'%(voltage) case 'voltage2': - if voltage > (15/16 * float(battery)): + raw_pyro = voltage + # when the box is safed, there's an extra 200k resistor in the stack + if armed == "safe": + pyrovolts = float(voltage) / (22/570) + else: + pyrovolts = float(voltage) / (22/221) + # divider ratios were somewhat empirical, use this logging call if need to review + # cherrypy.log(" battery " + str(battery) + " pyrovolts " + str(pyrovolts)) + if pyrovolts > (15/16 * float(battery)): pyro = "good" else: pyro = "open" case 'voltage3': battery = '%.1f'%(voltage / (22/222)) - armed = sense_armed() - return { 'time' : current_time, 'pressure' : pressure + " psi", -- 2.47.2