fest: Aderbruch anzeigen in Iso-Display
- Schriftgröße und Farbe für "Aderbruch" angepasst (kleiner und in Rot) - Breite des isoDisplay-Bereichs erweitert für bessere Lesbarkeit
This commit is contained in:
@@ -18,7 +18,10 @@ function Kue705FO({
|
|||||||
const [currentAlarmStatus, setCurrentAlarmStatus] = useState(false);
|
const [currentAlarmStatus, setCurrentAlarmStatus] = useState(false);
|
||||||
const [currentModulName, setCurrentModulName] = useState(modulName);
|
const [currentModulName, setCurrentModulName] = useState(modulName);
|
||||||
const [activeButton, setActiveButton] = useState("Schleife");
|
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 [loading, setLoading] = useState(false);
|
||||||
const [currentDisplayValue, setCurrentDisplayValue] = useState(
|
const [currentDisplayValue, setCurrentDisplayValue] = useState(
|
||||||
schleifenwiderstand || "0"
|
schleifenwiderstand || "0"
|
||||||
@@ -269,11 +272,11 @@ function Kue705FO({
|
|||||||
const handleButtonClick = (button) => {
|
const handleButtonClick = (button) => {
|
||||||
if (button === "Schleife") {
|
if (button === "Schleife") {
|
||||||
setActiveButton("Schleife");
|
setActiveButton("Schleife");
|
||||||
setDisplayText("Schleifenwiderstand [kOhm]");
|
setloopDisplayText("Schleifenwiderstand [kOhm]");
|
||||||
setCurrentDisplayValue(schleifenwiderstand || "0");
|
setCurrentDisplayValue(schleifenwiderstand || "0");
|
||||||
} else if (button === "TDR") {
|
} else if (button === "TDR") {
|
||||||
setActiveButton("TDR");
|
setActiveButton("TDR");
|
||||||
setDisplayText("Entfernung [Km]");
|
setloopDisplayText("Entfernung [Km]");
|
||||||
setCurrentDisplayValue(tdrLocation || "0");
|
setCurrentDisplayValue(tdrLocation || "0");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -311,6 +314,24 @@ function Kue705FO({
|
|||||||
return () => clearInterval(interval); // Bereinigung bei Entladen der Komponente
|
return () => clearInterval(interval); // Bereinigung bei Entladen der Komponente
|
||||||
}, [slotIndex]);
|
}, [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 (
|
return (
|
||||||
<div className="relative bg-gray-300 w-[116px] h-[390px] border border-gray-400 scale-110 top-3">
|
<div className="relative bg-gray-300 w-[116px] h-[390px] border border-gray-400 scale-110 top-3">
|
||||||
{isModulPresent ? (
|
{isModulPresent ? (
|
||||||
@@ -354,11 +375,24 @@ function Kue705FO({
|
|||||||
<span className="text-white text-[10px]">Alarm</span>
|
<span className="text-white text-[10px]">Alarm</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* isoDisplay: Zeigt den Isolationswiderstand oder Aderbruch an */}
|
||||||
<div className="relative mt-[50px] mx-auto bg-black text-white w-[80px] 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>{isolationswert || ">200"}</span>
|
<span
|
||||||
<div className="text-[8px]">ISO MOhm</div>
|
className={
|
||||||
|
window.kueCableBreak[slotIndex] === 1
|
||||||
|
? "text-red-500 text-[14px]" // Rot und kleinere Schrift für Aderbruch
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{/* Aderbruch anzeigen, wenn Aderbruch vorhanden ist isoDisplayText*/}
|
||||||
|
{window.kueCableBreak[slotIndex] === 1
|
||||||
|
? "Aderbruch"
|
||||||
|
: isolationswert || ">200"}
|
||||||
|
</span>
|
||||||
|
{window.kueCableBreak[slotIndex] !== 1 && (
|
||||||
|
<div className="text-[8px]">ISO MOhm</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -373,10 +407,10 @@ function Kue705FO({
|
|||||||
{kueVersion}
|
{kueVersion}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* loopDisplay: Zeigt Schleifenwiderstand oder TDR-Distanz an, je nach Modus */}
|
||||||
<div className="absolute bottom-1 left-[1.095px] w-[113.182px] h-[130px] bg-gray-300 border-[1.5px] border-gray-400 p-1">
|
<div className="absolute bottom-1 left-[1.095px] w-[113.182px] h-[130px] bg-gray-300 border-[1.5px] border-gray-400 p-1">
|
||||||
<span className="text-black text-[6px] absolute top-[2px] left-1 mt-1">
|
<span className="text-black text-[6px] absolute top-[2px] left-1 mt-1">
|
||||||
{displayText}
|
{loopDisplayText}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div className="relative w-full h-[45px] bg-gray-100 border border-gray-400 flex items-center justify-center mt-3">
|
<div className="relative w-full h-[45px] bg-gray-100 border border-gray-400 flex items-center justify-center mt-3">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
var kueOnline = [
|
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,
|
1, 1, 1, 1, 1, 1,
|
||||||
];
|
];
|
||||||
var kueIso = [
|
var kueIso = [
|
||||||
@@ -25,7 +25,7 @@ var kueRes = [
|
|||||||
0.615, 0.494, 1.217, 65.0, 65.0, 65.0, 65.0,
|
0.615, 0.494, 1.217, 65.0, 65.0, 65.0, 65.0,
|
||||||
];
|
];
|
||||||
var kueCableBreak = [
|
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,
|
0, 0, 1, 1, 1, 1,
|
||||||
];
|
];
|
||||||
var kueGroundFault = [
|
var kueGroundFault = [
|
||||||
|
|||||||
Reference in New Issue
Block a user