succd: implement threshold outputs, rework processing

This commit is contained in:
Serge Bazanski 2024-09-27 02:11:04 +02:00
parent 781bbaaeb4
commit 6d97eb62a8
5 changed files with 323 additions and 167 deletions

View file

@ -106,18 +106,23 @@ func (d *daemon) httpStream(w http.ResponseWriter, r *http.Request) {
volts, mbar := d.pirani()
rp := d.rpGet()
dp := d.dpGet()
rough, high := d.vacuumStatusGet()
v := struct {
Volts string
Mbar string
MbarFloat float32
RPOn bool
DPOn bool
Volts string
Mbar string
MbarFloat float32
RPOn bool
DPOn bool
RoughReached bool
HighReached bool
}{
Volts: formatVolts(volts),
Mbar: string(formatMbar(mbar)),
MbarFloat: mbar,
RPOn: rp,
DPOn: dp,
Volts: formatVolts(volts),
Mbar: string(formatMbar(mbar)),
MbarFloat: mbar,
RPOn: rp,
DPOn: dp,
RoughReached: rough,
HighReached: high,
}
if err := wsjson.Write(ctx, c, v); err != nil {
klog.Errorf("Websocket write failed: %v", err)