Compare commits

..

No commits in common. "fbf41203de4695ea9446b558b8c631343ed04d05" and "960be9cd236d42f553b02b10f551a56c9e559ed7" have entirely different histories.

2 changed files with 5 additions and 14 deletions

View file

@ -106,23 +106,24 @@ func (d *daemon) processOnce(_ context.Context) error {
// Unrealistic result, Pirani probe probably disconnected. Failsafe mode. // Unrealistic result, Pirani probe probably disconnected. Failsafe mode.
if !d.safety.failsafe { if !d.safety.failsafe {
d.safety.failsafe = true d.safety.failsafe = true
klog.Errorf("SAFETY: Pirani probe seems disconnected; enabling failsafe mode") klog.Errorf("Pirani probe seems disconnected; enabling failsafe mode")
} }
} }
if d.safety.failsafe && mbar > 1e2 { if d.safety.failsafe && mbar > 1e2 {
d.safety.failsafe = false d.safety.failsafe = false
klog.Infof("SAFETY: Pirani probe value (%s) is plausible again; quitting failsafe mode", formatMbar(mbar)) klog.Infof("Pirani probe value (%s) is plausible again; quitting failsafe mode", formatMbar(mbar))
} }
if !d.safety.highPressure && mbar >= 1e-1 { if !d.safety.highPressure && mbar >= 1e-1 {
d.safety.highPressure = true d.safety.highPressure = true
klog.Warningf("SAFETY: Pressure is too high (%s mbar); enabling diffusion pump lockout", formatMbar(mbar)) klog.Warningf("Pressure is too high (%s mbar); enabling diffusion pump lockout", formatMbar(mbar))
} }
if d.safety.highPressure && mbar < (1e-1)-(1e-2) { if d.safety.highPressure && mbar < (1e-1)-(1e-2) {
d.safety.highPressure = false d.safety.highPressure = false
klog.Infof("SAFETY: Pressure is low enough (%s mbar) for diffusion pump operation; quitting diffusion pump lockout", formatMbar(mbar)) klog.Infof("Pressure is low enough (%s mbar) for diffusion pump operation; quitting diffusion pump lockout", formatMbar(mbar))
} }
} else { } else {
d.safety.failsafe = true
d.safety.highPressure = true d.safety.highPressure = true
} }

View file

@ -1,7 +1,5 @@
package main package main
import "k8s.io/klog"
// daemonController is the control/data interface passed on to external system // daemonController is the control/data interface passed on to external system
// controllers, eg. the web interface. // controllers, eg. the web interface.
// //
@ -29,20 +27,12 @@ func (d *daemon) snapshot() *daemonState {
func (d *daemon) rpSet(state bool) { func (d *daemon) rpSet(state bool) {
d.mu.Lock() d.mu.Lock()
defer d.mu.Unlock() defer d.mu.Unlock()
if !state && d.dpOn {
klog.Errorf("SAFETY: Refusing to disable roughing pump while diffusion pump is active")
return
}
d.rpOn = state d.rpOn = state
} }
func (d *daemon) dpSet(state bool) { func (d *daemon) dpSet(state bool) {
d.mu.Lock() d.mu.Lock()
defer d.mu.Unlock() defer d.mu.Unlock()
if state && (d.safety.failsafe || d.safety.highPressure) {
klog.Errorf("SAFETY: Refusing to enable diffusion pump with safety alerts present")
return
}
d.dpOn = state d.dpOn = state
} }