From 344f4bdb75e0b3bb13a982d0d10453f8f9461559 Mon Sep 17 00:00:00 2001 From: ISA Date: Tue, 5 Nov 2024 13:40:02 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Dynamische=20Anzeige=20im=20LoopDisplay?= =?UTF-8?q?=20zwischen=20Schleifenwiderstand=20und=20TDR-Entfernung=20hinz?= =?UTF-8?q?ugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - loopDisplay zeigt nun den Schleifenwiderstand oder die TDR-Entfernung an, basierend auf dem aktiven Button ("Schleife" oder "TDR"). - Der Button "Schleife" setzt den Wert im loopDisplay auf den Schleifenwiderstand. - Der Button "TDR" setzt den Wert im loopDisplay auf die Entfernung (tdrLocation). --- components/modules/Kue705FO.jsx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index 8309b57..e91a051 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -22,6 +22,8 @@ function Kue705FO({ const [loopTitleText, setloopTitleText] = useState( "Schleifenwiderstand [kOhm]" ); + const [loopDisplayValue, setLoopDisplayValue] = useState(schleifenwiderstand); // Initialisiere den loopDisplayValue mit schleifenwiderstand + const [isoDisplayText, setIsoDisplayText] = useState("Aderbruch"); const [groundFaultDisplayText, setGroundFaultDisplayText] = useState("Erdschluss"); @@ -66,13 +68,12 @@ function Kue705FO({ if (button === "Schleife") { setActiveButton("Schleife"); setloopTitleText("Schleifenwiderstand [kOhm]"); - setCurrentDisplayValue(schleifenwiderstand || "0"); } else if (button === "TDR") { setActiveButton("TDR"); setloopTitleText("Entfernung [Km]"); - setCurrentDisplayValue(tdrLocation || "0"); } }; + // Funktion für die Schleifenmessung const goLoop = () => { let slot = slotIndex; @@ -106,17 +107,6 @@ function Kue705FO({ }; // Funktion für die TDR-Messung const goTDR = () => { - //------------------------------------------------- - /* const [isClient, setIsClient] = useState(false); - - useEffect(() => { - // This will only run in the client/browser, not on the server - setIsClient(true); - }, []); - - if (!isClient) { - return null; // or a loading spinner - } */ //------------------------------------------------- let slot = slotIndex; @@ -340,7 +330,7 @@ function Kue705FO({ Alarm - + {/* Anzeige des Isolation */}
-

{schleifenwiderstand + " KOhm"}

+

+ {loopDisplayValue + + (activeButton === "Schleife" ? " KOhm" : " Km")} +