feat: API für Systemspannung +5V erfolgreich implementiert
- API-Handler `getSystemspannung5VplusHandler.ts` erstellt - JSON-Daten werden aus dem Verzeichnis `mocks/device-cgi-simulator/chartsData/systemspannung5Vplus/` geladen - unterstützt die Parameter DIA0, DIA1, DIA2 für unterschiedliche Datenfrequenzen - Fehlerbehandlung bei ungültigen Typen und fehlenden Dateien eingebaut - API getestet unter `/api/cpl/getSystemspannung5VplusHandler?typ=DIA0`
This commit is contained in:
@@ -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.530
|
NEXT_PUBLIC_APP_VERSION=1.6.531
|
||||||
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)
|
||||||
|
|
||||||
|
|||||||
@@ -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.530
|
NEXT_PUBLIC_APP_VERSION=1.6.531
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,3 +1,14 @@
|
|||||||
|
## [1.6.531] – 2025-07-03
|
||||||
|
|
||||||
|
- feat: API für Systemspannung +5V erfolgreich implementiert
|
||||||
|
|
||||||
|
- API-Handler `getSystemspannung5VplusHandler.ts` erstellt
|
||||||
|
- JSON-Daten werden aus dem Verzeichnis `mocks/device-cgi-simulator/chartsData/systemspannung5Vplus/` geladen
|
||||||
|
- unterstützt die Parameter DIA0, DIA1, DIA2 für unterschiedliche Datenfrequenzen
|
||||||
|
- Fehlerbehandlung bei ungültigen Typen und fehlenden Dateien eingebaut
|
||||||
|
- API getestet unter `/api/cpl/getSystemspannung5VplusHandler?typ=DIA0`
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.530] – 2025-07-03
|
## [1.6.530] – 2025-07-03
|
||||||
|
|
||||||
- fix: KÜ Firmwareupdate
|
- fix: KÜ Firmwareupdate
|
||||||
|
|||||||
@@ -28,8 +28,9 @@ export const DetailModal = ({ isOpen, selectedKey, onClose }: Props) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Zeitstempel und Werte extrahieren
|
// Zeitstempel und Werte extrahieren
|
||||||
const labels = reduxData.map((e: any) => e.t);
|
type DataPoint = { t: string; i: number };
|
||||||
const values = reduxData.map((e: any) => e.i);
|
const labels = reduxData.map((e: unknown) => (e as DataPoint).t);
|
||||||
|
const values = reduxData.map((e: unknown) => (e as DataPoint).i);
|
||||||
|
|
||||||
const baseOptions = {
|
const baseOptions = {
|
||||||
responsive: true,
|
responsive: true,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ ChartJS.register(
|
|||||||
Legend
|
Legend
|
||||||
);
|
);
|
||||||
|
|
||||||
type HistoryEntry = {
|
export type HistoryEntry = {
|
||||||
time: string | number | Date;
|
time: string | number | Date;
|
||||||
"+5V": number;
|
"+5V": number;
|
||||||
"+15V": number;
|
"+15V": number;
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.530",
|
"version": "1.6.531",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.530",
|
"version": "1.6.531",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@iconify-icons/ri": "^1.2.10",
|
"@iconify-icons/ri": "^1.2.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.530",
|
"version": "1.6.531",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
@@ -7,15 +7,17 @@ import { getSystemVoltTempThunk } from "../redux/thunks/getSystemVoltTempThunk";
|
|||||||
import { SystemOverviewGrid } from "@/components/main/system/SystemOverviewGrid";
|
import { SystemOverviewGrid } from "@/components/main/system/SystemOverviewGrid";
|
||||||
import { SystemCharts } from "@/components/main/system/SystemCharts";
|
import { SystemCharts } from "@/components/main/system/SystemCharts";
|
||||||
import { DetailModal } from "@/components/main/system/DetailModal";
|
import { DetailModal } from "@/components/main/system/DetailModal";
|
||||||
|
import type { HistoryEntry } from "@/components/main/system/SystemCharts";
|
||||||
|
|
||||||
const SystemPage = () => {
|
const SystemPage = () => {
|
||||||
const dispatch = useDispatch<AppDispatch>();
|
const dispatch = useDispatch<AppDispatch>();
|
||||||
const voltages = useSelector(
|
const voltages = useSelector(
|
||||||
(state: RootState) => state.systemVoltTemp.voltages
|
(state: RootState) => state.systemVoltTemp.voltages
|
||||||
);
|
);
|
||||||
|
|
||||||
const history = useSelector(
|
const history = useSelector(
|
||||||
(state: RootState) => state.systemVoltTemp.history
|
(state: RootState) => state.systemVoltTemp.history
|
||||||
);
|
) as HistoryEntry[];
|
||||||
|
|
||||||
const [selectedKey, setSelectedKey] = useState<string | null>(null);
|
const [selectedKey, setSelectedKey] = useState<string | null>(null);
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
@@ -28,8 +30,6 @@ const SystemPage = () => {
|
|||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
const labels = history.map((h) => new Date(h.time).toLocaleTimeString());
|
|
||||||
|
|
||||||
const handleOpenDetail = (key: string) => {
|
const handleOpenDetail = (key: string) => {
|
||||||
setSelectedKey(key);
|
setSelectedKey(key);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
@@ -50,7 +50,6 @@ const SystemPage = () => {
|
|||||||
<DetailModal
|
<DetailModal
|
||||||
isOpen={isModalOpen}
|
isOpen={isModalOpen}
|
||||||
selectedKey={selectedKey}
|
selectedKey={selectedKey}
|
||||||
history={history}
|
|
||||||
onClose={handleCloseDetail}
|
onClose={handleCloseDetail}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|||||||
import { getSystemspannung5VplusThunk } from "../thunks/getSystemspannung5VplusThunk";
|
import { getSystemspannung5VplusThunk } from "../thunks/getSystemspannung5VplusThunk";
|
||||||
|
|
||||||
type StateType = {
|
type StateType = {
|
||||||
DIA0: any[]; // alle Werte
|
DIA0: unknown[]; // alle Werte
|
||||||
DIA1: any[]; // stündlich
|
DIA1: unknown[]; // stündlich
|
||||||
DIA2: any[]; // täglich
|
DIA2: unknown[]; // täglich
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
};
|
};
|
||||||
@@ -32,7 +32,10 @@ export const systemspannung5VplusSlice = createSlice({
|
|||||||
getSystemspannung5VplusThunk.fulfilled,
|
getSystemspannung5VplusThunk.fulfilled,
|
||||||
(
|
(
|
||||||
state,
|
state,
|
||||||
action: PayloadAction<{ typ: "DIA0" | "DIA1" | "DIA2"; data: any[] }>
|
action: PayloadAction<{
|
||||||
|
typ: "DIA0" | "DIA1" | "DIA2";
|
||||||
|
data: unknown[];
|
||||||
|
}>
|
||||||
) => {
|
) => {
|
||||||
state.isLoading = false;
|
state.isLoading = false;
|
||||||
state[action.payload.typ] = action.payload.data;
|
state[action.payload.typ] = action.payload.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user