feat: Display und Chart für KÜs

This commit is contained in:
ISA
2025-07-31 09:37:34 +02:00
parent e76c8d9bd2
commit ad6642b5e7
9 changed files with 47 additions and 31 deletions

View File

@@ -78,6 +78,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
kueAlarm2: kueAlarm2Raw,
kueOverflow: kueOverflowRaw,
kuePSTmMinus96V, // <- richtig, weil so im State vorhanden
tdrActive, // <- TDR aktiv Status hinzugefügt
} = useSelector((state: RootState) => state.kueDataSlice);
//---------------------------------------------
@@ -168,10 +169,6 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
const openKvzModal = () => {
setShowKvzPanel(!showKvzPanel);
};
const closeKvzModal = () => {
setShowKvzPanel(false);
};
//----------------------------------
//hooks einbinden
const kueVersion = useKueVersion(slotIndex, reduxKueVersion);
@@ -227,6 +224,9 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
activeButton
);
// TDR aktiv Status für diesen Slot prüfen
const isTdrActiveForSlot = tdrActive?.[slotIndex] === 1;
// Removed useChartData(loopMeasurementCurveChartData) as the state was unused
//---------------------------------
@@ -392,12 +392,15 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
{/* TDR and KVz Buttons */}
<div className="flex space-x-2 p-1">
<button
onClick={openTdrModal}
className=" bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
>
TDR
</button>
{/* TDR Button - nur anzeigen wenn TDR aktiv ist */}
{isTdrActiveForSlot && (
<button
onClick={openTdrModal}
className=" bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
>
TDR
</button>
)}
<button
onClick={openKvzModal}
className="bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center p-2"
@@ -429,12 +432,14 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
slotIndex={slotIndex}
/>
{/* TDR Chart Modal */}
<TDRChartView
isOpen={showTdrModal}
onClose={closeTdrModal}
slotIndex={slotIndex}
/>
{/* TDR Chart Modal - nur wenn TDR aktiv ist */}
{isTdrActiveForSlot && (
<TDRChartView
isOpen={showTdrModal}
onClose={closeTdrModal}
slotIndex={slotIndex}
/>
)}
</>
)}