remove HAL implementation files for v3 and v4, and the build script

This commit is contained in:
2026-01-04 18:41:38 +01:00
parent 412a26390a
commit d33b05e1d7
21 changed files with 504 additions and 1418 deletions

View File

@@ -1,4 +1,4 @@
import {PlantConfig, PumpTestResult} from "./api";
import {DetectionPlant, DetectionResult, PlantConfig, PumpTestResult} from "./api";
const PLANT_COUNT = 8;
@@ -47,6 +47,13 @@ export class PlantViews {
const plantView = this.plants[plantId];
plantView.setTestResult(response)
}
applyDetectionResult(json: DetectionResult) {
for (let i = 0; i < PLANT_COUNT; i++) {
var plantResult = json.plant[i];
this.plants[i].setDetectionResult(plantResult);
}
}
}
@@ -80,9 +87,12 @@ export class PlantView {
private readonly pump_test_pump_time: HTMLElement;
private readonly pump_test_flow_ml: HTMLElement;
private readonly pump_test_flow_raw: HTMLElement;
private showDisabled: boolean = false;
private readonly controller: Controller;
constructor(plantId: number, parent: HTMLDivElement, controller: Controller) {
this.controller = controller;
this.plantId = plantId;
this.plantDiv = document.createElement("div")! as HTMLDivElement
const template = require('./plant.html') as string;
@@ -217,6 +227,14 @@ export class PlantView {
let showTarget = plantConfig.mode === "TargetMoisture"
let showMin = plantConfig.mode === "MinMoisture"
if(this.showDisabled || plantConfig.sensor_a || plantConfig.sensor_b) {
console.log("Showing plant " + this.plantId);
this.plantDiv.style.display = "block";
} else {
console.log("Hiding plant " + this.plantId);
this.plantDiv.style.display = "none";
}
console.log("updateVisibility showsensor: " + showSensor + " pump " + showPump + " target " +showTarget + " min " + showMin)
for (const element of Array.from(sensorOnly)) {
@@ -315,4 +333,20 @@ export class PlantView {
this.updateVisibility(conv);
return conv;
}
setDetectionResult(plantResult: DetectionPlant) {
var changed = false;
if (this.sensorAInstalled.checked != plantResult.sensor_b){
changed = true;
this.sensorAInstalled.checked = plantResult.sensor_a;
}
if (this.sensorBInstalled.checked != plantResult.sensor_b){
changed = true;
this.sensorBInstalled.checked = plantResult.sensor_b;
}
if (changed) {
this.controller.configChanged();
}
}
}