feat: Priorisiere und style PST-M Ausfall als kritischen Alarm
- Implementiert PST-M Ausfall als höchste Priorität in der Alarmanzeige. - Hinzugefügt: "PST-M prüfen" wird rot angezeigt, wie bei Aderbruch, Erdschluss, Isolationsfehler und Schleifenfehler. - Einheit "ISO MOhm" wird nur angezeigt, wenn kein Alarm aktiv ist.
This commit is contained in:
@@ -341,69 +341,68 @@ function Kue705FO({
|
||||
// Prioritätsprüfung in updateDisplay
|
||||
useEffect(() => {
|
||||
const updateDisplay = () => {
|
||||
console.log("Prüfen der window-Variablen:");
|
||||
console.log("kueCableBreak:", window.kueCableBreak);
|
||||
console.log("kueGroundFault:", window.kueGroundFault);
|
||||
console.log("kueAlarm1:", window.kueAlarm1);
|
||||
console.log("kueAlarm2:", window.kueAlarm2);
|
||||
console.log("kueOverflow:", window.kueOverflow);
|
||||
|
||||
if (
|
||||
!window.kuePSTmMinus96V ||
|
||||
!window.kueCableBreak ||
|
||||
!window.kueGroundFault ||
|
||||
!window.kueAlarm1 ||
|
||||
!window.kueAlarm2 ||
|
||||
!window.kueOverflow
|
||||
) {
|
||||
console.log("Warten auf window Variablen...");
|
||||
setTimeout(updateDisplay, 100);
|
||||
// console.log("Warten auf window Variablen...");
|
||||
setTimeout(updateDisplay, 1000); // Warte 1 Sekunde und versuche es erneut
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(
|
||||
/* console.log(
|
||||
"Alle window-Variablen sind verfügbar. Beginne mit den Prioritätsprüfungen..."
|
||||
);
|
||||
); */
|
||||
|
||||
// PST-M Ausfall
|
||||
if (window.kuePSTmMinus96V[slotIndex] === 1) {
|
||||
setCurrentDisplayValue("PST-M prüfen");
|
||||
return;
|
||||
}
|
||||
// Aderbruch
|
||||
if (window.kueCableBreak[slotIndex] === 1) {
|
||||
console.log("Aderbruch erkannt für Slot", slotIndex);
|
||||
// console.log("Aderbruch erkannt für Slot", slotIndex);
|
||||
setCurrentDisplayValue(isoDisplayText);
|
||||
return;
|
||||
}
|
||||
// Erdschluss
|
||||
else if (window.kueGroundFault[slotIndex] === 1) {
|
||||
console.log("Erdschluss erkannt für Slot", slotIndex);
|
||||
// console.log("Erdschluss erkannt für Slot", slotIndex);
|
||||
setCurrentDisplayValue(groundFaultDisplayText);
|
||||
return;
|
||||
}
|
||||
// Isolationsfehler
|
||||
else if (window.kueAlarm1[slotIndex] === 1) {
|
||||
console.log("Isolationsfehler erkannt für Slot", slotIndex);
|
||||
// console.log("Isolationsfehler erkannt für Slot", slotIndex);
|
||||
setCurrentDisplayValue(isoFaultDisplayText);
|
||||
return;
|
||||
}
|
||||
// Schleifenfehler
|
||||
else if (window.kueAlarm2[slotIndex] === 1) {
|
||||
console.log("Schleifenfehler erkannt für Slot", slotIndex);
|
||||
// console.log("Schleifenfehler erkannt für Slot", slotIndex);
|
||||
setCurrentDisplayValue(loopFaultDisplayText);
|
||||
return;
|
||||
}
|
||||
// Overflow (>200 MOhm)
|
||||
else if (window.kueOverflow[slotIndex] === 1) {
|
||||
console.log(
|
||||
/* console.log(
|
||||
"Overflow erkannt für Slot",
|
||||
slotIndex,
|
||||
"- Anzeige: '>200'"
|
||||
);
|
||||
); */
|
||||
setCurrentDisplayValue(isoGreaterThan200);
|
||||
return;
|
||||
}
|
||||
// Kein Fehler
|
||||
else {
|
||||
console.log(
|
||||
/* console.log(
|
||||
"Kein Fehler erkannt, zeige Standardisolationswert an für Slot",
|
||||
slotIndex
|
||||
);
|
||||
); */
|
||||
setCurrentDisplayValue(isolationswert); // Nur Isolationswert ohne ">200" als Fallback
|
||||
}
|
||||
};
|
||||
@@ -464,6 +463,7 @@ function Kue705FO({
|
||||
<div className="text-center">
|
||||
<span
|
||||
className={
|
||||
window.kuePSTmMinus96V[slotIndex] === 1 ||
|
||||
window.kueCableBreak[slotIndex] === 1 ||
|
||||
window.kueGroundFault[slotIndex] === 1 ||
|
||||
window.kueAlarm1[slotIndex] === 1 ||
|
||||
@@ -477,7 +477,8 @@ function Kue705FO({
|
||||
{currentDisplayValue}
|
||||
</span>
|
||||
|
||||
{window.kueCableBreak[slotIndex] !== 1 &&
|
||||
{window.kuePSTmMinus96V[slotIndex] !== 1 &&
|
||||
window.kueCableBreak[slotIndex] !== 1 &&
|
||||
window.kueGroundFault[slotIndex] !== 1 &&
|
||||
window.kueAlarm1[slotIndex] !== 1 &&
|
||||
window.kueAlarm2[slotIndex] !== 1 &&
|
||||
|
||||
Reference in New Issue
Block a user