diff --git a/.env.development b/.env.development index f8acdd2..e073638 100644 --- a/.env.development +++ b/.env.development @@ -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.605 +NEXT_PUBLIC_APP_VERSION=1.6.607 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 159cd8d..a4b67a5 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.605 +NEXT_PUBLIC_APP_VERSION=1.6.607 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 564b2dd..41fc4d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [1.6.607] – 2025-07-21 + +- Nach Betriebsferien einmal sichern + +--- +## [1.6.606] – 2025-07-21 + +- Nach Betriebsferien einmal sichern + +--- ## [1.6.605] – 2025-07-21 - Nach Betriebsferien einmal sichern diff --git a/components/main/analogInputs/AnalogInputsChart.tsx b/components/main/analogInputs/AnalogInputsChart.tsx index cae52c2..d8a4c06 100644 --- a/components/main/analogInputs/AnalogInputsChart.tsx +++ b/components/main/analogInputs/AnalogInputsChart.tsx @@ -1,4 +1,5 @@ "use client"; +// components/main/analogInputs/AnalogInputsChart.tsx import React, { useEffect, useRef } from "react"; import { useDispatch, useSelector } from "react-redux"; import { RootState, AppDispatch } from "@/redux/store"; @@ -13,8 +14,8 @@ import { Legend, Filler, TimeScale, + TooltipItem, } from "chart.js"; -import type { ChartOptions } from "chart.js"; import "chartjs-adapter-date-fns"; import { de } from "date-fns/locale"; import { getAnalogInputsHistoryThunk } from "@/redux/thunks/getAnalogInputsHistoryThunk"; @@ -42,6 +43,8 @@ ChartJS.register( type AnalogInputHistoryPoint = { t: string; m: number; + i?: number; + a?: number; }; export default function AnalogInputsChart() { @@ -56,7 +59,7 @@ export default function AnalogInputsChart() { }, []); const dispatch = useDispatch(); - const chartRef = useRef(null); + const chartRef = useRef(null); const { zeitraum, vonDatum, bisDatum, data, autoLoad, selectedId } = useSelector((state: RootState) => state.analogInputsHistory); @@ -88,7 +91,9 @@ export default function AnalogInputsChart() { chart.options.scales.x.max = new Date(latestBisDatum).getTime(); // Aktualisiere die Daten des Diagramms - const chartKey = selectedAnalogInput?.id ? String(selectedAnalogInput.id + 99) : null; + const chartKey = selectedAnalogInput?.id + ? String(selectedAnalogInput.id + 99) + : null; const inputData = chartKey ? data[chartKey] ?? [] : []; const filteredData = inputData.filter((point) => { const date = new Date(point.t); @@ -170,12 +175,9 @@ export default function AnalogInputsChart() { ? [ { label: selectedAnalogInput?.label - ? `Messwerteingang ${selectedAnalogInput.label}` - : "Messwerte", - data: filteredData.map((point) => ({ - x: point.t, - y: point.m, - })), + ? `Messwert (m) ${selectedAnalogInput.label}` + : "Messwert (m)", + data: filteredData.map((point) => ({ x: point.t, y: point.m })), fill: false, borderColor: getColor("littwin-blue"), backgroundColor: "rgba(59,130,246,0.3)", @@ -183,6 +185,30 @@ export default function AnalogInputsChart() { pointRadius: 0, tension: 0.1, }, + { + label: "Minimum (i)", + data: filteredData + .filter((point) => typeof point.i === "number") + .map((point) => ({ x: point.t, y: point.i })), + fill: false, + borderColor: "#22c55e", // grün + borderWidth: 1, + pointRadius: 0, + borderDash: [4, 2], + tension: 0.1, + }, + { + label: "Maximum (a)", + data: filteredData + .filter((point) => typeof point.a === "number") + .map((point) => ({ x: point.t, y: point.a })), + fill: false, + borderColor: "#ef4444", // rot + borderWidth: 1, + pointRadius: 0, + borderDash: [4, 2], + tension: 0.1, + }, ] : [], }; @@ -195,10 +221,11 @@ export default function AnalogInputsChart() { mode: "index" as const, intersect: false, callbacks: { - label: function (context: any) { - return `Messwert: ${context.parsed.y}`; + label: function (context: TooltipItem<"line">) { + const label = context.dataset.label || ""; + return `${label}: ${context.parsed.y}`; }, - title: function (tooltipItems: any[]) { + title: function (tooltipItems: TooltipItem<"line">[]) { const date = tooltipItems[0].parsed.x; return `Zeitpunkt: ${new Date(date).toLocaleString("de-DE")}`; }, @@ -212,7 +239,11 @@ export default function AnalogInputsChart() { }, zoom: { pan: { enabled: true, mode: "x" as const }, - zoom: { wheel: { enabled: true }, pinch: { enabled: true }, mode: "x" as const }, + zoom: { + wheel: { enabled: true }, + pinch: { enabled: true }, + mode: "x" as const, + }, }, }, scales: { diff --git a/package-lock.json b/package-lock.json index 8894ffe..186cb9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.605", + "version": "1.6.607", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.605", + "version": "1.6.607", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index fb0d142..4fd480b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.605", + "version": "1.6.607", "private": true, "scripts": { "dev": "next dev", diff --git a/redux/slices/analogInputs/analogInputsHistorySlice.ts b/redux/slices/analogInputs/analogInputsHistorySlice.ts index 8731a48..b1a1a76 100644 --- a/redux/slices/analogInputs/analogInputsHistorySlice.ts +++ b/redux/slices/analogInputs/analogInputsHistorySlice.ts @@ -5,6 +5,8 @@ import { getAnalogInputsHistoryThunk } from "../../thunks/getAnalogInputsHistory export type AnalogInputsHistoryEntry = { t: string; m: number; + i?: number; + a?: number; }; export interface InputHistoryState {