This commit is contained in:
		
							parent
							
								
									bd40c4f8df
								
							
						
					
					
						commit
						5bf20711d6
					
				
					 4 changed files with 57 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -62,6 +62,17 @@ type apiData struct {
 | 
			
		|||
		// DPOn means the diffusion pump is turned on.
 | 
			
		||||
		DPOn bool
 | 
			
		||||
	}
 | 
			
		||||
	// Temperature state.
 | 
			
		||||
	Temperatures struct {
 | 
			
		||||
		DPBottom float32
 | 
			
		||||
		DPTop    float32
 | 
			
		||||
		DPInlet  float32
 | 
			
		||||
		SEM      float32
 | 
			
		||||
	}
 | 
			
		||||
	// Humidity state.
 | 
			
		||||
	Humidity struct {
 | 
			
		||||
		SEM float32
 | 
			
		||||
	}
 | 
			
		||||
	// Pressure feedback into evacuation board.
 | 
			
		||||
	Feedback struct {
 | 
			
		||||
		// RoughReached is true when the system has reached a rough vacuum
 | 
			
		||||
| 
						 | 
				
			
			@ -115,6 +126,11 @@ func (s *webServer) apiData(skipSystem bool) *apiData {
 | 
			
		|||
	ad.Pirani.MbarFloat = mbar
 | 
			
		||||
	ad.Pumps.RPOn = state.rpOn
 | 
			
		||||
	ad.Pumps.DPOn = state.dpOn
 | 
			
		||||
	ad.Temperatures.DPBottom = state.tempDPBottom
 | 
			
		||||
	ad.Temperatures.DPTop = state.tempDPTop
 | 
			
		||||
	ad.Temperatures.DPInlet = state.tempDPInlet
 | 
			
		||||
	ad.Temperatures.SEM = state.tempSEM
 | 
			
		||||
	ad.Humidity.SEM = state.humiditySEM
 | 
			
		||||
	ad.Feedback.RoughReached = rough
 | 
			
		||||
	ad.Feedback.HighReached = high
 | 
			
		||||
	ad.LoopLoad = s.d.loopLoad()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -111,6 +111,22 @@ td > span {
 | 
			
		|||
            <th>DP</th>
 | 
			
		||||
            <td id="dp">{{ if .Pumps.DPOn }}ON{{ else }}OFF{{ end }}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <th>Temperatures</th>
 | 
			
		||||
            <th>SEM</th>
 | 
			
		||||
            <td id="temp-sem">{{ .Temperatures.SEM }}</td>
 | 
			
		||||
            <th>DPBottom</th>
 | 
			
		||||
            <td id="temp-dp-bottom">{{ .Temperatures.DPBottom }}</td>
 | 
			
		||||
            <th>DPTop</th>
 | 
			
		||||
            <td id="temp-dp-top">{{ .Temperatures.DPTop }}</td>
 | 
			
		||||
            <th>DPInlet</th>
 | 
			
		||||
            <td id="temp-dp-inlet">{{ .Temperatures.DPInlet }}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <th>Humidity</th>
 | 
			
		||||
            <th>SEM</th>
 | 
			
		||||
            <td id="humidity-sem">{{ .Humidity.SEM }}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <th>Safety</th>
 | 
			
		||||
            <th style="font-size: 0.7em;">Pirani<br />Failsafe</th>
 | 
			
		||||
| 
						 | 
				
			
			@ -316,6 +332,11 @@ window.addEventListener("load", (_) => {
 | 
			
		|||
    let trough = document.querySelector("#trough");
 | 
			
		||||
    let thigh = document.querySelector("#thigh");
 | 
			
		||||
    let load = document.querySelector("#load");
 | 
			
		||||
    let tempSEM = document.querySelector("#temp-sem");
 | 
			
		||||
    let tempDPBottom = document.querySelector("#temp-dp-bottom");
 | 
			
		||||
    let tempDPTop = document.querySelector("#temp-dp-top");
 | 
			
		||||
    let tempDPInlet = document.querySelector("#temp-dp-inlet");
 | 
			
		||||
    let humiditySEM = document.querySelector('#humidity-sem');
 | 
			
		||||
 | 
			
		||||
    // Buttons
 | 
			
		||||
    let pd = document.querySelector("#pd");
 | 
			
		||||
| 
						 | 
				
			
			@ -388,6 +409,12 @@ window.addEventListener("load", (_) => {
 | 
			
		|||
                dp.style = colors.default;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            tempSEM.innerHTML = data.Temperatures.SEM + " °C";
 | 
			
		||||
            tempDPBottom.innerHTML = data.Temperatures.DPBottom + " °C";
 | 
			
		||||
            tempDPTop.innerHTML = data.Temperatures.DPTop + " °C";
 | 
			
		||||
            tempDPInlet.innerHTML = data.Temperatures.DPInlet + " °C";
 | 
			
		||||
            humiditySEM.innerHTML = data.Humidity.SEM + " %";
 | 
			
		||||
 | 
			
		||||
            let t = [];
 | 
			
		||||
            if (data.Feedback.RoughReached) {
 | 
			
		||||
                trough.innerHTML = "OK";
 | 
			
		||||
| 
						 | 
				
			
			@ -413,7 +440,7 @@ window.addEventListener("load", (_) => {
 | 
			
		|||
 | 
			
		||||
            // Indicate all process values as unknown
 | 
			
		||||
 | 
			
		||||
            [failsafe, highpressure, rp, dp, trough, thigh, volts, mbar].forEach((el) => {
 | 
			
		||||
            [failsafe, highpressure, rp, dp, trough, thigh, volts, mbar, tempDPBottom, tempDPTop, tempDPInlet].forEach((el) => {
 | 
			
		||||
                if (!el.innerHTML.includes("??")) {
 | 
			
		||||
                    el.innerHTML += "??";
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,6 +35,12 @@ func main() {
 | 
			
		|||
	d.daemonState.piraniVolts3.limit = 3
 | 
			
		||||
	d.daemonState.piraniVolts100.limit = 100
 | 
			
		||||
 | 
			
		||||
	d.tempDPBottom = 420.6
 | 
			
		||||
	d.tempDPTop = 69.0
 | 
			
		||||
	d.tempDPInlet = 42.0
 | 
			
		||||
	d.tempSEM = 42.5
 | 
			
		||||
	d.humiditySEM = 66.6
 | 
			
		||||
 | 
			
		||||
	d.aboveRough.threshold = float64(flagPressureThresholdRough)
 | 
			
		||||
	d.aboveRough.hysteresis = float64(flagPressureThresholdRoughHysteresis)
 | 
			
		||||
	d.aboveHigh.threshold = float64(flagPressureThresholdHigh)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,6 +55,13 @@ type daemonState struct {
 | 
			
		|||
	pumpdown   momentaryOutput
 | 
			
		||||
	aboveRough thresholdOutput
 | 
			
		||||
	aboveHigh  thresholdOutput
 | 
			
		||||
 | 
			
		||||
	tempDPBottom float32
 | 
			
		||||
	tempDPTop    float32
 | 
			
		||||
	tempDPInlet  float32
 | 
			
		||||
 | 
			
		||||
	tempSEM     float32
 | 
			
		||||
	humiditySEM float32
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (d *daemonState) vacuumStatus() (rough, high bool) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue