diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index 11b978a..886f46e 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -18,7 +18,10 @@ function Kue705FO({ const [currentAlarmStatus, setCurrentAlarmStatus] = useState(false); const [currentModulName, setCurrentModulName] = useState(modulName); const [activeButton, setActiveButton] = useState("Schleife"); - const [displayText, setDisplayText] = useState("Schleifenwiderstand [kOhm]"); + const [loopDisplayText, setloopDisplayText] = useState( + "Schleifenwiderstand [kOhm]" + ); + const [isoDisplayText, setIsoDisplayText] = useState("Aderbruch"); const [loading, setLoading] = useState(false); const [currentDisplayValue, setCurrentDisplayValue] = useState( schleifenwiderstand || "0" @@ -269,11 +272,11 @@ function Kue705FO({ const handleButtonClick = (button) => { if (button === "Schleife") { setActiveButton("Schleife"); - setDisplayText("Schleifenwiderstand [kOhm]"); + setloopDisplayText("Schleifenwiderstand [kOhm]"); setCurrentDisplayValue(schleifenwiderstand || "0"); } else if (button === "TDR") { setActiveButton("TDR"); - setDisplayText("Entfernung [Km]"); + setloopDisplayText("Entfernung [Km]"); setCurrentDisplayValue(tdrLocation || "0"); } }; @@ -311,6 +314,24 @@ function Kue705FO({ return () => clearInterval(interval); // Bereinigung bei Entladen der Komponente }, [slotIndex]); + //------------------------------------------------- + + // Intervall für den Wechsel der Anzeige zwischen "Aderbruch" und ">200 MOhm" + useEffect(() => { + if (window.kueCableBreak[slotIndex] === 1) { + const intervalId = setInterval(() => { + setIsoDisplayText((prevText) => + prevText === "Aderbruch" ? ">200 MOhm" : "Aderbruch" + ); + }, 2000); + + return () => clearInterval(intervalId); + } else { + setIsoDisplayText(isolationswert || ">200"); + } + }, [slotIndex, isolationswert]); + //------------------------------------------------- + return (
{isModulPresent ? ( @@ -354,11 +375,24 @@ function Kue705FO({ Alarm
- -
+ {/* isoDisplay: Zeigt den Isolationswiderstand oder Aderbruch an */} +
- {isolationswert || ">200"} -
ISO MOhm
+ + {/* Aderbruch anzeigen, wenn Aderbruch vorhanden ist isoDisplayText*/} + {window.kueCableBreak[slotIndex] === 1 + ? "Aderbruch" + : isolationswert || ">200"} + + {window.kueCableBreak[slotIndex] !== 1 && ( +
ISO MOhm
+ )}
@@ -373,10 +407,10 @@ function Kue705FO({ {kueVersion}
- + {/* loopDisplay: Zeigt Schleifenwiderstand oder TDR-Distanz an, je nach Modus */}
- {displayText} + {loopDisplayText}
diff --git a/public/CPLmockData/SERVICE/kueData.js b/public/CPLmockData/SERVICE/kueData.js index 37f3cbe..d13880b 100644 --- a/public/CPLmockData/SERVICE/kueData.js +++ b/public/CPLmockData/SERVICE/kueData.js @@ -1,5 +1,5 @@ var kueOnline = [ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ]; var kueIso = [ @@ -25,7 +25,7 @@ var kueRes = [ 0.615, 0.494, 1.217, 65.0, 65.0, 65.0, 65.0, ]; var kueCableBreak = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, ]; var kueGroundFault = [