feat: Dynamische Anzeige im LoopDisplay zwischen Schleifenwiderstand und TDR-Entfernung hinzugefügt
- 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).
This commit is contained in:
@@ -22,6 +22,8 @@ function Kue705FO({
|
|||||||
const [loopTitleText, setloopTitleText] = useState(
|
const [loopTitleText, setloopTitleText] = useState(
|
||||||
"Schleifenwiderstand [kOhm]"
|
"Schleifenwiderstand [kOhm]"
|
||||||
);
|
);
|
||||||
|
const [loopDisplayValue, setLoopDisplayValue] = useState(schleifenwiderstand); // Initialisiere den loopDisplayValue mit schleifenwiderstand
|
||||||
|
|
||||||
const [isoDisplayText, setIsoDisplayText] = useState("Aderbruch");
|
const [isoDisplayText, setIsoDisplayText] = useState("Aderbruch");
|
||||||
const [groundFaultDisplayText, setGroundFaultDisplayText] =
|
const [groundFaultDisplayText, setGroundFaultDisplayText] =
|
||||||
useState("Erdschluss");
|
useState("Erdschluss");
|
||||||
@@ -66,13 +68,12 @@ function Kue705FO({
|
|||||||
if (button === "Schleife") {
|
if (button === "Schleife") {
|
||||||
setActiveButton("Schleife");
|
setActiveButton("Schleife");
|
||||||
setloopTitleText("Schleifenwiderstand [kOhm]");
|
setloopTitleText("Schleifenwiderstand [kOhm]");
|
||||||
setCurrentDisplayValue(schleifenwiderstand || "0");
|
|
||||||
} else if (button === "TDR") {
|
} else if (button === "TDR") {
|
||||||
setActiveButton("TDR");
|
setActiveButton("TDR");
|
||||||
setloopTitleText("Entfernung [Km]");
|
setloopTitleText("Entfernung [Km]");
|
||||||
setCurrentDisplayValue(tdrLocation || "0");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Funktion für die Schleifenmessung
|
// Funktion für die Schleifenmessung
|
||||||
const goLoop = () => {
|
const goLoop = () => {
|
||||||
let slot = slotIndex;
|
let slot = slotIndex;
|
||||||
@@ -106,17 +107,6 @@ function Kue705FO({
|
|||||||
};
|
};
|
||||||
// Funktion für die TDR-Messung
|
// Funktion für die TDR-Messung
|
||||||
const goTDR = () => {
|
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;
|
let slot = slotIndex;
|
||||||
|
|
||||||
@@ -340,7 +330,7 @@ function Kue705FO({
|
|||||||
<span className="text-white text-[10px]">Alarm</span>
|
<span className="text-white text-[10px]">Alarm</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* Anzeige des Isolation */}
|
||||||
<div className="relative mt-[50px] mx-auto bg-black text-white w-[100px] h-[40px] flex items-center justify-center text-[18px] z-10">
|
<div className="relative mt-[50px] mx-auto bg-black text-white w-[100px] h-[40px] flex items-center justify-center text-[18px] z-10">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<span
|
<span
|
||||||
@@ -399,7 +389,10 @@ function Kue705FO({
|
|||||||
|
|
||||||
<div className="absolute bottom-[5px] left-1/2 transform -translate-x-1/2 w-[100px] flex justify-center items-center">
|
<div className="absolute bottom-[5px] left-1/2 transform -translate-x-1/2 w-[100px] flex justify-center items-center">
|
||||||
<div className="text-center text-black text-[10px]">
|
<div className="text-center text-black text-[10px]">
|
||||||
<p>{schleifenwiderstand + " KOhm"}</p>
|
<p>
|
||||||
|
{loopDisplayValue +
|
||||||
|
(activeButton === "Schleife" ? " KOhm" : " Km")}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user