TDR und Schleife Button in KÜs wieder für die Funktionen
This commit is contained in:
@@ -283,6 +283,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
</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]
|
||||
@@ -309,8 +310,10 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
</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">
|
||||
@@ -334,6 +337,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
*/}
|
||||
|
||||
{/* Modal für Einstellungen */}
|
||||
</>
|
||||
@@ -347,12 +351,118 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
{/* Messkurven-Button unter dem Modul */}
|
||||
{kueOnline === 1 && (
|
||||
<>
|
||||
<button
|
||||
onClick={openChartModal}
|
||||
className="w-full h-[1.863rem] bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center mt-2"
|
||||
>
|
||||
Messkurve
|
||||
</button>
|
||||
{/*
|
||||
|
||||
Überschrift: Detailansicht
|
||||
ISO und RSL als Buttons (Firmenblau) nebeneinander
|
||||
TDR und KVz Buttons (Firmenblau) nebeneinander
|
||||
Wenn kein TDR oder kein KVz: nur grauer Button ohne Text
|
||||
|
||||
|
||||
*/}
|
||||
<div className="flex flex-col items-center w-full px-2 mt-2 space-y-2">
|
||||
{/* Detailansicht Header */}
|
||||
<span className="text-black text-[0.625rem] font-semibold">
|
||||
Detailansicht
|
||||
</span>
|
||||
|
||||
{/* ISO and RSL Buttons */}
|
||||
<div className="flex space-x-2">
|
||||
<button
|
||||
onClick={openChartModal}
|
||||
className="bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
|
||||
>
|
||||
ISO
|
||||
</button>
|
||||
<button
|
||||
onClick={openChartModal}
|
||||
className="bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
|
||||
>
|
||||
RSL
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* TDR and KVz Buttons */}
|
||||
<div className="flex space-x-2 p-1">
|
||||
<button
|
||||
onClick={() => handleButtonClick("TDR", setActiveButton)}
|
||||
className=" bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
|
||||
>
|
||||
TDR
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleButtonClick("KVz", setActiveButton)}
|
||||
className="bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
|
||||
>
|
||||
KVz
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Messkurve Button */}
|
||||
<button
|
||||
onClick={openChartModal}
|
||||
className="w-full h-[1.863rem] bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center"
|
||||
>
|
||||
Messkurve
|
||||
</button>
|
||||
<div className="flex mt-3 space-x-[0.063rem] ">
|
||||
<button
|
||||
onClick={() =>
|
||||
handleButtonClick(
|
||||
"Schleife",
|
||||
setActiveButton,
|
||||
setloopTitleText,
|
||||
(value) =>
|
||||
setLoopDisplayValue(
|
||||
typeof value === "number" ? value : Number(value)
|
||||
), // Hier sicherstellen, dass nur number übergeben wird
|
||||
Number(schleifenwiderstand), // <- Stelle sicher, dass es eine Zahl ist
|
||||
tdrLocation,
|
||||
dispatch,
|
||||
slotIndex
|
||||
)
|
||||
}
|
||||
className={`w-[50%] h-[1.563rem] text-white text-[0.625rem] flex items-center justify-center ${
|
||||
activeButton === "Schleife"
|
||||
? "bg-littwin-blue"
|
||||
: "bg-gray-400"
|
||||
}`}
|
||||
>
|
||||
Schleife
|
||||
</button>
|
||||
<button
|
||||
onClick={() => {
|
||||
setActiveButton("TDR");
|
||||
setloopTitleText("Entfernung [km]");
|
||||
|
||||
const latestTdrDistanceMeters =
|
||||
Array.isArray(tdmChartData?.[slotIndex]) &&
|
||||
tdmChartData[slotIndex].length > 0 &&
|
||||
typeof tdmChartData[slotIndex][0].d === "number"
|
||||
? tdmChartData[slotIndex][0].d
|
||||
: 0;
|
||||
|
||||
const latestTdrDistance = Number(
|
||||
(latestTdrDistanceMeters / 1000).toFixed(3)
|
||||
);
|
||||
setLoopDisplayValue(latestTdrDistance);
|
||||
}}
|
||||
className={`w-[50%] h-[1.563rem] text-white text-[0.625rem] flex items-center justify-center ${
|
||||
Array.isArray(tdrActive) && tdrActive[slotIndex] === 0
|
||||
? "bg-gray-200 cursor-not-allowed" // Deaktiviert: Hellgrau
|
||||
: activeButton === "TDR"
|
||||
? "bg-littwin-blue" // Aktiviert: Littwin Blau
|
||||
: "bg-gray-400" // Nicht geklickt: Dunkelgrau
|
||||
}`}
|
||||
disabled={
|
||||
Array.isArray(tdrActive) && tdrActive[slotIndex] === 0
|
||||
} // Button deaktiviert, wenn TDR für diesen Slot nicht aktiv ist
|
||||
>
|
||||
TDR
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Modal für Messkurve */}
|
||||
{showChartModal && (
|
||||
<ChartSwitcher
|
||||
|
||||
Reference in New Issue
Block a user