remove: comment out unused plant visibility logic, update moisture sensor processing, and enhance plant ID handling in TWAI communication

This commit is contained in:
2026-02-13 23:24:21 +01:00
parent 979f982565
commit c909b33af0
2 changed files with 52 additions and 47 deletions

View File

@@ -227,47 +227,47 @@ 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";
}
// 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)) {
if (showSensor) {
element.classList.remove("plantHidden_" + this.plantId)
} else {
element.classList.add("plantHidden_" + this.plantId)
}
}
for (const element of Array.from(pumpOnly)) {
if (showPump) {
element.classList.remove("plantHidden_" + this.plantId)
} else {
element.classList.add("plantHidden_" + this.plantId)
}
}
for (const element of Array.from(targetOnly)) {
if (showTarget) {
element.classList.remove("plantHidden_" + this.plantId)
} else {
element.classList.add("plantHidden_" + this.plantId)
}
}
for (const element of Array.from(minOnly)) {
if (showMin) {
element.classList.remove("plantHidden_" + this.plantId)
} else {
element.classList.add("plantHidden_" + this.plantId)
}
}
// for (const element of Array.from(sensorOnly)) {
// if (showSensor) {
// element.classList.remove("plantHidden_" + this.plantId)
// } else {
// element.classList.add("plantHidden_" + this.plantId)
// }
// }
//
// for (const element of Array.from(pumpOnly)) {
// if (showPump) {
// element.classList.remove("plantHidden_" + this.plantId)
// } else {
// element.classList.add("plantHidden_" + this.plantId)
// }
// }
//
// for (const element of Array.from(targetOnly)) {
// if (showTarget) {
// element.classList.remove("plantHidden_" + this.plantId)
// } else {
// element.classList.add("plantHidden_" + this.plantId)
// }
// }
//
// for (const element of Array.from(minOnly)) {
// if (showMin) {
// element.classList.remove("plantHidden_" + this.plantId)
// } else {
// element.classList.add("plantHidden_" + this.plantId)
// }
// }
}
setTestResult(result: PumpTestResult) {
@@ -335,8 +335,9 @@ export class PlantView {
}
setDetectionResult(plantResult: DetectionPlant) {
console.log("setDetectionResult plantResult: " + plantResult.sensor_a + " " + plantResult.sensor_b)
var changed = false;
if (this.sensorAInstalled.checked != plantResult.sensor_b){
if (this.sensorAInstalled.checked != plantResult.sensor_a){
changed = true;
this.sensorAInstalled.checked = plantResult.sensor_a;
}