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

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.657
NEXT_PUBLIC_APP_VERSION=1.6.658
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.657
NEXT_PUBLIC_APP_VERSION=1.6.658
NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.658] 2025-07-31
- feat; in KÜ Chart RSL und ISO start button
---
## [1.6.657] 2025-07-28
- deat: KVz anzeigen

View File

@@ -237,14 +237,13 @@ const IsoChartActionBar: React.FC = () => {
</div>
</Listbox>
{/* ISO starten button*/}
<button
onClick={handleFetchData}
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm"
disabled={isLoading}
{/* Platzhalter für "ISO starten" Button, nimmt weiterhin Platz ein, aber ist unsichtbar */}
<span
style={{ visibility: "hidden" }}
className="px-10 py-1 bg-littwin-blue text-white rounded text-sm"
>
ISO starten
</button>
</span>
<button
onClick={handleFetchData}

View File

@@ -256,12 +256,12 @@ const LoopChartActionBar: React.FC = () => {
</Listbox.Options>
</div>
</Listbox>
<div className="relative w-48"> </div>
<div className="relative w-16"> </div>
{/* Schleife starten button*/}
<button
onClick={handleFetchData}
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm"
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap"
disabled={isLoading}
>
RSL starten
@@ -269,7 +269,7 @@ const LoopChartActionBar: React.FC = () => {
<button
onClick={handleFetchData}
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm"
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap"
>
Daten laden
</button>

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">
{/* 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 */}
{/* TDR Chart Modal - nur wenn TDR aktiv ist */}
{isTdrActiveForSlot && (
<TDRChartView
isOpen={showTdrModal}
onClose={closeTdrModal}
slotIndex={slotIndex}
/>
)}
</>
)}

View File

@@ -12,8 +12,9 @@ declare global {
}
import React, { useState } from "react";
import { useSelector } from "react-redux";
import { useSelector, useDispatch } from "react-redux";
import { RootState } from "../../../../../redux/store";
import { setKueData } from "../../../../../redux/slices/kueDataSlice";
import { useAdminAuth } from "../../../settingsPageComponents/hooks/useAdminAuth";
@@ -24,6 +25,7 @@ interface Props {
export default function TdrEinstellung({ slot, onClose }: Props) {
const { isAdminLoggedIn } = useAdminAuth(true);
const dispatch = useDispatch();
const tdrSlice = useSelector((state: RootState) => state.kueDataSlice);
const cacheKey = `slot_${slot}`;
@@ -126,6 +128,11 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
setTdrActive(newState);
updateCache(tdrData, newState);
// Redux State sofort aktualisieren für UI-Update
const updatedTdrActive = [...(tdrSlice.tdrActive || [])];
updatedTdrActive[slot] = newState ? 1 : 0;
dispatch(setKueData({ tdrActive: updatedTdrActive }));
const isDev = window.location.hostname === "localhost";
const slotParam = `KTX${slot}=${newState ? 1 : 0}`;

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "cpl-v4",
"version": "1.6.657",
"version": "1.6.658",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cpl-v4",
"version": "1.6.657",
"version": "1.6.658",
"dependencies": {
"@fontsource/roboto": "^5.1.0",
"@headlessui/react": "^2.2.4",

View File

@@ -1,6 +1,6 @@
{
"name": "cpl-v4",
"version": "1.6.657",
"version": "1.6.658",
"private": true,
"scripts": {
"dev": "next dev",