diff --git a/.env.development b/.env.development index 8162e2e..d848a19 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ 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.446 +NEXT_PUBLIC_APP_VERSION=1.6.447 NEXT_PUBLIC_CPL_MODE=jsSimulatedProd # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) #### Feature-Flags #### diff --git a/.env.production b/.env.production index 1f97e8b..32a5ebf 100644 --- a/.env.production +++ b/.env.production @@ -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.446 +NEXT_PUBLIC_APP_VERSION=1.6.447 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index cd77fd4..3b6dc27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.447] – 2025-06-25 + +- feat: Zeitraum einstellbar in AnalogInputsChart mit Zoom- und Pan-Funktion umgesetzt + +--- ## [1.6.446] – 2025-06-25 - docs: Zusatzfunktionen (Kai, 25.06.2025) in TODO.md ergänzt diff --git a/components/main/analogInputs/AnalogInputsChart.tsx b/components/main/analogInputs/AnalogInputsChart.tsx index 366afc0..efd717f 100644 --- a/components/main/analogInputs/AnalogInputsChart.tsx +++ b/components/main/analogInputs/AnalogInputsChart.tsx @@ -36,6 +36,9 @@ export default function AnalogInputsChart({ }: { selectedId: number | null; }) { + const selectedInput = useSelector( + (state: RootState) => state.selectedAnalogInput + ); const zoomEnabled = process.env.NEXT_PUBLIC_FEATURE_MESSWERTANZEIGE_EINGANG === "true"; const dispatch = useDispatch(); @@ -82,7 +85,9 @@ export default function AnalogInputsChart({ const chartData = { datasets: [ { - label: `Messkurve Messwerteingang ${selectedId}`, + label: `Messkurve ${selectedInput?.label ?? "Eingang"} (${ + selectedInput?.unit ?? "" + })`, data: inputData.map((point: any) => ({ x: point.t, y: point.m, @@ -145,7 +150,7 @@ export default function AnalogInputsChart({ y: { title: { display: true, - text: "Messwert", + text: `Messwert (${selectedInput?.unit ?? ""})`, }, }, }, diff --git a/components/main/analogInputs/AnalogInputsTable.tsx b/components/main/analogInputs/AnalogInputsTable.tsx index eacc411..6a66a8d 100644 --- a/components/main/analogInputs/AnalogInputsTable.tsx +++ b/components/main/analogInputs/AnalogInputsTable.tsx @@ -18,6 +18,7 @@ import { getAnalogInputsThunk } from "@/redux/thunks/getAnalogInputsThunk"; import { Icon } from "@iconify/react"; import settingsIcon from "@iconify/icons-mdi/settings"; import waveformIcon from "@iconify/icons-mdi/waveform"; +import { setSelectedAnalogInput } from "@/redux/slices/selectedAnalogInputSlice"; export default function AnalogInputsTable({ setSelectedId, @@ -39,9 +40,10 @@ export default function AnalogInputsTable({ (state: RootState) => state.analogInputs ?? [] ); - const handleSelect = (id: number) => { + const handleSelect = (id: number, input: AnalogInput) => { setSelectedId(id); setActiveId(id); + dispatch(setSelectedAnalogInput(input)); // 🧠 hier kommt die Bezeichnung in Redux }; return ( @@ -79,7 +81,7 @@ export default function AnalogInputsTable({ > handleSelect(e.id!)} + onClick={() => handleSelect(e.id!, e)} >
handleSelect(e.id!)} + onClick={() => handleSelect(e.id!, e)} > {typeof e.value === "number" ? e.value.toFixed(2) : "-"} @@ -99,7 +101,7 @@ export default function AnalogInputsTable({ {e.unit || "-"} handleSelect(e.id!)} + onClick={() => handleSelect(e.id!, e)} > {e.label || "----"} @@ -107,7 +109,7 @@ export default function AnalogInputsTable({ ))}
- {racks[`rack${activeRack}` as RackKey].map((slot, index) => { - const slotIndex = index + (activeRack - 1) * 8; - return ( -
- -
- ); - })} +
+ {racks[`rack${activeRack}`].map((slot, index) => { + const slotIndex = index + (activeRack - 1) * 8; + return ( +
+ +
+ ); + })} +
); } diff --git a/public/CPL/SERVICE/Start.json b/public/CPL/SERVICE/Start.json new file mode 100644 index 0000000..3533961 --- /dev/null +++ b/public/CPL/SERVICE/Start.json @@ -0,0 +1,3 @@ +{ + "win_last20Messages": "<%=SAM01%>" +} diff --git a/public/CPL/SERVICE/System.json b/public/CPL/SERVICE/System.json new file mode 100644 index 0000000..29bae80 --- /dev/null +++ b/public/CPL/SERVICE/System.json @@ -0,0 +1,17 @@ +{ + "win_appVersion": "<%=SAV00%>", + "win_deviceName": "<%=SAN01%>", + "win_mac1": "<%=SEM01%>", + "win_ip": "<%=SEI01%>", + "win_subnet": "<%=SES01%>", + "win_gateway": "<%=SEG01%>", + "win_cplInternalTimestamp": "<%=SCL01%>", + "win_ntp1": "<%=STP01%>", + "win_ntp2": "<%=STP02%>", + "win_ntp3": "<%=STP03%>", + "win_ntpTimezone": "<%=STT00%>", + "win_ntpActive": "<%=STA00%>", + "win_opcState": "<%=SOS01%>", + "win_opcSessions": "<%=SOC01%>", + "win_opcName": "<%=SON01%>" +} diff --git a/public/CPL/SERVICE/digitalInputs.json b/public/CPL/SERVICE/digitalInputs.json new file mode 100644 index 0000000..f7699e6 --- /dev/null +++ b/public/CPL/SERVICE/digitalInputs.json @@ -0,0 +1,20 @@ +{ + "win_de_state": ["<%=DES80%>", "<%=DES81%>", "<%=DES82%>", "<%=DES83%>"], + "win_de_label": ["<%=DEN80%>", "<%=DEN81%>", "<%=DEN82%>", "<%=DEN83%>"], + "win_de_counter": ["<%=DEC80%>", "<%=DEC81%>", "<%=DEC82%>", "<%=DEC83%>"], + "win_de_time_filter": [ + "<%=DEF80%>", + "<%=DEF81%>", + "<%=DEF82%>", + "<%=DEF83%>" + ], + "win_de_weighting": ["<%=DEG80%>", "<%=DEG81%>", "<%=DEG82%>", "<%=DEG83%>"], + "win_de_invert": ["<%=DEI80%>", "<%=DEI81%>", "<%=DEI82%>", "<%=DEI83%>"], + "win_de_counter_active": [ + "<%=DEZ80%>", + "<%=DEZ81%>", + "<%=DEZ82%>", + "<%=DEZ83%>" + ], + "win_de_offline": ["<%=DEA80%>", "<%=DEA81%>", "<%=DEA82%>", "<%=DEA83%>"] +} diff --git a/public/CPL/SERVICE/digitalOutputs.json b/public/CPL/SERVICE/digitalOutputs.json new file mode 100644 index 0000000..57ce80c --- /dev/null +++ b/public/CPL/SERVICE/digitalOutputs.json @@ -0,0 +1,4 @@ +{ + "win_da_state": ["<%=DAS01%>", "<%=DAS02%>", "<%=DAS03%>", "<%=DAS04%>"], + "win_da_bezeichnung": ["<%=DAN01%>", "<%=DAN02%>", "<%=DAN03%>", "<%=DAN04%>"] +} diff --git a/public/CPL/SERVICE/kueData.json b/public/CPL/SERVICE/kueData.json new file mode 100644 index 0000000..04bb774 --- /dev/null +++ b/public/CPL/SERVICE/kueData.json @@ -0,0 +1,42 @@ +{ + "win_kueOnline": ["<%=KSO80%>", "<%=KSO81%>", "<%=KSO82%>", "<%=KSO83%>"], + "win_kueVersion": ["<%=KSV80%>", "<%=KSV81%>", "<%=KSV82%>", "<%=KSV83%>"], + "win_kuePSTmMinus96V": [ + "<%=KSS80%>", + "<%=KSS81%>", + "<%=KSS82%>", + "<%=KSS83%>" + ], + "win_kueCableBreak": ["<%=KSC80%>", "<%=KSC81%>", "<%=KSC82%>", "<%=KSC83%>"], + "win_kueGroundFault": [ + "<%=KSG80%>", + "<%=KSG81%>", + "<%=KSG82%>", + "<%=KSG83%>" + ], + "win_kueOverflow": ["<%=KIW80%>", "<%=KIW81%>", "<%=KIW82%>", "<%=KIW83%>"], + "win_kueIso": ["<%=KIM80%>", "<%=KIM81%>", "<%=KIM82%>", "<%=KIM83%>"], + "win_kueAlarm1": ["<%=KIA80%>", "<%=KIA81%>", "<%=KIA82%>", "<%=KIA83%>"], + "win_kueLimit1": ["<%=KIG80%>", "<%=KIG81%>", "<%=KIG82%>", "<%=KIG83%>"], + "win_kueResidence": ["<%=KRM80%>", "<%=KRM81%>", "<%=KRM82%>", "<%=KRM83%>"], + "win_kueAlarm2": ["<%=KRA80%>", "<%=KRA81%>", "<%=KRA82%>", "<%=KRA83%>"], + "win_kueLimit2Low": ["<%=KRG80%>", "<%=KRG81%>", "<%=KRG82%>", "<%=KRG83%>"], + "win_kueDelay1": ["<%=KID80%>", "<%=KID81%>", "<%=KID82%>", "<%=KID83%>"], + "win_kueLoopInterval": [ + "<%=KRI80%>", + "<%=KRI81%>", + "<%=KRI82%>", + "<%=KRI83%>" + ], + "win_kueID": ["<%=KSI80%>", "<%=KSI81%>", "<%=KSI82%>", "<%=KSI83%>"], + "win_kueName": ["<%=KSA80%>", "<%=KSA81%>", "<%=KSA82%>", "<%=KSA83%>"], + "win_tdrActive": ["<%=KTX80%>", "<%=KTX81%>", "<%=KTX82%>", "<%=KTX83%>"], + "win_tdrAtten": ["<%=KTD80%>", "<%=KTD81%>", "<%=KTD82%>", "<%=KTD83%>"], + "win_tdrSpeed": ["<%=KTS80%>", "<%=KTS81%>", "<%=KTS82%>", "<%=KTS83%>"], + "win_tdrTrigger": ["<%=KTE80%>", "<%=KTE81%>", "<%=KTE82%>", "<%=KTE83%>"], + "win_tdrPulse": ["<%=KTP80%>", "<%=KTP81%>", "<%=KTP82%>", "<%=KTP83%>"], + "win_tdrAmp": ["<%=KTA80%>", "<%=KTA81%>", "<%=KTA82%>", "<%=KTA83%>"], + "win_tdrLast": ["<%=KTL80%>", "<%=KTL81%>", "<%=KTL82%>", "<%=KTL83%>"], + "win_tdrLocation": ["<%=KTF80%>", "<%=KTF81%>", "<%=KTF82%>", "<%=KTF83%>"], + "win_memoryInterval": ["<%=KIL80%>", "<%=KIL81%>", "<%=KIL82%>", "<%=KIL83%>"] +} diff --git a/public/CPL/SERVICE/kueDataKnoten/kueData0.json b/public/CPL/SERVICE/kueDataKnoten/kueData0.json new file mode 100644 index 0000000..fab6f03 --- /dev/null +++ b/public/CPL/SERVICE/kueDataKnoten/kueData0.json @@ -0,0 +1,50 @@ +{ + "kueNodeID": [ + "<%=KN001%>", + "<%=KN101%>", + "<%=KN201%>", + "<%=KN301%>", + "<%=KN401%>", + "<%=KN501%>", + "<%=KN601%>", + "<%=KN701%>", + "<%=KN801%>", + "<%=KN901%>" + ], + "kueLinkID": [ + "<%=KP001%>", + "<%=KP101%>", + "<%=KP201%>", + "<%=KP301%>", + "<%=KP401%>", + "<%=KP501%>", + "<%=KP601%>", + "<%=KP701%>", + "<%=KP801%>", + "<%=KP901%>" + ], + "kueLinkLength": [ + "<%=KQ001%>", + "<%=KQ101%>", + "<%=KQ201%>", + "<%=KQ301%>", + "<%=KQ401%>", + "<%=KQ501%>", + "<%=KQ601%>", + "<%=KQ701%>", + "<%=KQ801%>", + "<%=KQ901%>" + ], + "kueLinkStatus": [ + "<%=KU001%>", + "<%=KU101%>", + "<%=KU201%>", + "<%=KU301%>", + "<%=KU401%>", + "<%=KU501%>", + "<%=KU601%>", + "<%=KU701%>", + "<%=KU801%>", + "<%=KU901%>" + ] +} diff --git a/public/CPL/SERVICE/opcua.json b/public/CPL/SERVICE/opcua.json new file mode 100644 index 0000000..72fce9d --- /dev/null +++ b/public/CPL/SERVICE/opcua.json @@ -0,0 +1,5 @@ +{ + "win_opcUaZustand": "<%=SOS01%>", + "win_opcUaActiveClientCount": "<%=SOC01%>", + "win_opcUaNodesetName": "<%=SON01%>" +} diff --git a/public/CPL/SERVICE/systemVoltTemp.json b/public/CPL/SERVICE/systemVoltTemp.json new file mode 100644 index 0000000..8d15e3d --- /dev/null +++ b/public/CPL/SERVICE/systemVoltTemp.json @@ -0,0 +1,3 @@ +{ + "win_systemVoltTemp": ["AAV09", "AAV11", "AAV15", "AAV16", "AAV17", "AAV18"] +} diff --git a/redux/slices.zip b/redux/slices.zip new file mode 100644 index 0000000..c63406e Binary files /dev/null and b/redux/slices.zip differ diff --git a/redux/slices/selectedAnalogInputSlice.ts b/redux/slices/selectedAnalogInputSlice.ts new file mode 100644 index 0000000..656cde0 --- /dev/null +++ b/redux/slices/selectedAnalogInputSlice.ts @@ -0,0 +1,35 @@ +// /redux/slices/selectedAnalogInputSlice.ts +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; + +export interface SelectedAnalogInput { + id: number; + label: string; + unit?: string; + value?: number; + offset?: number; + factor?: number; + loggerInterval?: number; + weighting?: number; +} + +const initialState: SelectedAnalogInput | null = null; + +const selectedAnalogInputSlice = createSlice({ + name: "selectedAnalogInput", + initialState, + reducers: { + setSelectedAnalogInput: ( + state, + action: PayloadAction + ) => { + return action.payload; + }, + clearSelectedAnalogInput: () => { + return null; + }, + }, +}); + +export const { setSelectedAnalogInput, clearSelectedAnalogInput } = + selectedAnalogInputSlice.actions; +export default selectedAnalogInputSlice.reducer; diff --git a/redux/store.ts b/redux/store.ts index 71a67e8..fc55a8a 100644 --- a/redux/store.ts +++ b/redux/store.ts @@ -24,6 +24,7 @@ import tdrReferenceChartDataBySlotReducer from "./slices/tdrReferenceChartDataBy import loopChartTypeSlice from "./slices/loopChartTypeSlice"; import systemVoltTempReducer from "./slices/systemVoltTempSlice"; import analogInputsHistoryReducer from "./slices/analogInputsHistorySlice"; +import selectedAnalogInputReducer from "./slices/selectedAnalogInputSlice"; const store = configureStore({ reducer: { @@ -50,6 +51,7 @@ const store = configureStore({ loopChartType: loopChartTypeSlice, systemVoltTemp: systemVoltTempReducer, analogInputsHistory: analogInputsHistoryReducer, + selectedAnalogInput: selectedAnalogInputReducer, }, }); diff --git a/redux/thunks.zip b/redux/thunks.zip new file mode 100644 index 0000000..1251419 Binary files /dev/null and b/redux/thunks.zip differ diff --git a/redux/types.zip b/redux/types.zip new file mode 100644 index 0000000..bf78cd0 Binary files /dev/null and b/redux/types.zip differ