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_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer # 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) 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_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.657 NEXT_PUBLIC_APP_VERSION=1.6.658
NEXT_PUBLIC_CPL_MODE=production 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 ## [1.6.657] 2025-07-28
- deat: KVz anzeigen - deat: KVz anzeigen

View File

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

View File

@@ -256,12 +256,12 @@ const LoopChartActionBar: React.FC = () => {
</Listbox.Options> </Listbox.Options>
</div> </div>
</Listbox> </Listbox>
<div className="relative w-48"> </div> <div className="relative w-16"> </div>
{/* Schleife starten button*/} {/* Schleife starten button*/}
<button <button
onClick={handleFetchData} 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} disabled={isLoading}
> >
RSL starten RSL starten
@@ -269,7 +269,7 @@ const LoopChartActionBar: React.FC = () => {
<button <button
onClick={handleFetchData} 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 Daten laden
</button> </button>

View File

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

View File

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

4
package-lock.json generated
View File

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

View File

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