cleanup: Kue705FO

This commit is contained in:
ISA
2025-07-28 13:47:21 +02:00
parent ce1dacda9b
commit 9a8a0501a5
6 changed files with 13 additions and 76 deletions

View File

@@ -1,5 +1,5 @@
"use client"; // components/modules/kue705FO/Kue705FO.tsx
import React, { useState, useRef, useMemo } from "react";
import React, { useState, useMemo } from "react";
import { useSelector } from "react-redux";
import KueModal from "./modals/SettingsModalWrapper";
import "bootstrap-icons/font/bootstrap-icons.css"; // Import Bootstrap Icons
@@ -24,8 +24,6 @@ import useIsoDisplay from "./hooks/useIsoDisplay";
import useLoopDisplay from "./hooks/useLoopDisplay";
import useModulName from "./hooks/useModulName";
import type { Chart } from "chart.js";
//--------handlers----------------
// Keep needed imports
import handleOpenModal from "./handlers/handleOpenModal";
@@ -41,8 +39,6 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
modulName,
kueOnline,
slotIndex,
tdrLocation,
win_fallSensorsActive,
}) => {
/* console.log(
`Rendering Kue705FO - SlotIndex: ${slotIndex}, ModulName: ${modulName}`
@@ -55,17 +51,13 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
"Schleife"
);
const [loopTitleText, setloopTitleText] = useState(
"Schleifenwiderstand [kOhm]"
);
const [, setloopTitleText] = useState("Schleifenwiderstand [kOhm]");
const [isoDisplayText] = useState("Aderbruch");
const [groundFaultDisplayText] = useState("Erdschluss");
const [loopFaultDisplayText] = useState("Schleifenfehler");
const [isoFaultDisplayText] = useState("Isolationsfehler");
const [isoGreaterThan200] = useState(">200 MOhm");
const [loading, setLoading] = useState(false);
const [showModal, setShowModal] = useState(false);
// Separate modal states for each ChartView
const [showIsoModal, setShowIsoModal] = useState(false);
@@ -78,7 +70,6 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
//------- Redux-Variablen abrufen--------------------------------
const {
kueVersion: reduxKueVersion,
tdrActive,
kueCableBreak: kueCableBreakRaw,
kueGroundFault: kueGroundFaultRaw,
kueAlarm1: kueAlarm1Raw,
@@ -329,9 +320,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
Number(kueAlarm2?.[slotIndex]) === 1 ? "text-red-500" : ""
}`}
>
{activeButton === "Schleife" && loading
? "RSL: Messung"
: `RSL: ${loopDisplayValue} kOhm`}
{`RSL: ${loopDisplayValue} kOhm`}
</span>
</div>
</div>
@@ -348,63 +337,6 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
</div>
</div>
{/* Schleifenwiderstand Bereich */}
{/*
<div className="absolute bottom-[5.963rem] left-[0.068rem] w-[7.074rem] h-[4.1rem] bg-gray-300 border-[0.094rem] border-gray-400 p-[0.063rem]">
<span className="text-black text-[0.438rem] absolute top-[0.125rem] left-[0.063rem] mt-1">
Schleifenwiderstand [kOhm]
</span>
<div className="relative w-full h-[2.813rem] bg-gray-100 border border-gray-400 flex items-center justify-center mt-4">
<button
onClick={() =>
handleRefreshClick("Schleife", slotIndex, setLoading)
}
className="absolute -top-[0.063rem] -right-[0.063rem] w-[1.25rem] h-[1.25rem] bg-gray-400 flex items-center justify-center"
disabled={loading}
>
<span className="text-white text-[1.125rem]">⟳</span>
</button>
<div className="absolute bottom-[0.313rem] left-1/2 transform -translate-x-1/2 w-[6.25rem] flex justify-center items-center">
<div className="text-center text-black text-[0.625rem]">
<p>
{typeof schleifenwiderstand === "number"
? schleifenwiderstand
: Number(schleifenwiderstand)}{" "}
kOhm
</p>
</div>
</div>
</div>
</div>
*/}
{/* TDR Bereich */}
{/*
{Array.isArray(tdrActive) && tdrActive[slotIndex] === 1 && (
<div className="absolute bottom-[0.063rem] left-[0.068rem] w-[7.074rem] h-[4.1rem] bg-gray-300 border-[0.094rem] border-gray-400 p-[0.063rem]">
<span className="text-black text-[0.438rem] absolute top-[0.125rem] left-[0.063rem] mt-1">
TDR Entfernung [km]
</span>
<div className="relative w-full h-[2.813rem] bg-gray-100 border border-gray-400 flex items-center justify-center mt-4">
<button
onClick={() =>
handleRefreshClick("TDR", slotIndex, setLoading)
}
className="absolute -top-[0.063rem] -right-[0.063rem] w-[1.25rem] h-[1.25rem] bg-gray-400 flex items-center justify-center"
disabled={loading}
>
<span className="text-white text-[1.125rem]">⟳</span>
</button>
<div className="absolute bottom-[0.313rem] left-1/2 transform -translate-x-1/2 w-[6.25rem] flex justify-center items-center">
<div className="text-center text-black text-[0.625rem]">
<p>{latestTdrDistance} km</p>
</div>
</div>
</div>
</div>
)}
*/}
{/* Modal für Einstellungen */}
</>
) : (