]> git.gag.com Git - fw/quantimotor/commitdiff
fixed continuity sense to work with armed switch in either position
authorBdale Garbee <bdale@gag.com>
Fri, 30 May 2025 00:52:47 +0000 (18:52 -0600)
committerBdale Garbee <bdale@gag.com>
Fri, 30 May 2025 00:52:47 +0000 (18:52 -0600)
ui/app.py

index 447424dd3dab53319d5e52bea93b3dbbd9fb231b..1d7abc9d239a69db1ab36166f2a0b7a1c0a3c945 100755 (executable)
--- 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",