succd: rewrite processing loop
This commit is contained in:
parent
3d81a1f56c
commit
960be9cd23
3 changed files with 50 additions and 66 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package main
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
|
||||
// momentaryOutput is an output that can be triggered for 500ms.
|
||||
type momentaryOutput struct {
|
||||
|
|
@ -73,3 +76,13 @@ func (r *ringbufferInput) process(input float32) {
|
|||
func (r *ringbufferInput) saturated() bool {
|
||||
return len(r.data) >= int(r.limit)
|
||||
}
|
||||
|
||||
type pfeifferVoltsToMbar struct {
|
||||
mbar float32
|
||||
}
|
||||
|
||||
func (p *pfeifferVoltsToMbar) process(volts float32) {
|
||||
// Per Pirani probe docs.
|
||||
bar := math.Pow(10.0, float64(volts)-8.5)
|
||||
p.mbar = float32(bar * 1000.0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue