From 47e0efeb80dedbf977a406a500951a28787b5de2 Mon Sep 17 00:00:00 2001 From: ISA Date: Thu, 4 Sep 2025 11:16:06 +0200 Subject: [PATCH] feat: local-cpl-sim.mjs kabelueberwachung --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 +++++ package-lock.json | 4 ++-- package.json | 2 +- scripts/local-cpl-sim.mjs | 42 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.env.development b/.env.development index 2d058cc..98b5134 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.834 +NEXT_PUBLIC_APP_VERSION=1.6.835 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 723da56..a4ff04e 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.834 +NEXT_PUBLIC_APP_VERSION=1.6.835 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dee412..c85a199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.835] – 2025-09-04 + +- feat: local-cpl-sim.mjs Einstellungen done + +--- ## [1.6.834] – 2025-09-04 - feat: local-cpl-sim.mjs diff --git a/package-lock.json b/package-lock.json index e952500..4346ac4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.834", + "version": "1.6.835", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.834", + "version": "1.6.835", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index e5115b7..035c955 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.834", + "version": "1.6.835", "private": true, "scripts": { "dev": "next dev -p 3000", diff --git a/scripts/local-cpl-sim.mjs b/scripts/local-cpl-sim.mjs index 7773e03..e3b3892 100644 --- a/scripts/local-cpl-sim.mjs +++ b/scripts/local-cpl-sim.mjs @@ -69,6 +69,38 @@ function getRelFromRoot(filePath) { function tryServeSpecialMocks(res, relPath) { const rp = relPath.replace(/^\/+/, ""); // Serve ready JS/JSON mocks for some routes + // Digital Inputs JSON + if (rp === "CPL/SERVICE/digitalInputs.json") { + const mockPath = path.join( + process.cwd(), + "mocks", + "device-cgi-simulator", + "SERVICE", + "digitalInputsMockData.json" + ); + if (exists(mockPath)) return streamRaw(res, mockPath); + } + // Kabelüberwachung main JS (kueData.js) + if (rp === "CPL/SERVICE/kueData.js") { + const mockPath = path.join( + process.cwd(), + "mocks", + "device-cgi-simulator", + "SERVICE", + "kabelueberwachungMockData.js" + ); + if (exists(mockPath)) return streamRaw(res, mockPath); + } + // Kabelüberwachung Knotenpunkte slot JS files + if (rp.startsWith("CPL/SERVICE/knotenpunkte/") && rp.endsWith(".js")) { + const mockPath = path.join( + process.cwd(), + "mocks", + "device-cgi-simulator", + rp.replace(/^CPL\//, "") + ); + if (exists(mockPath)) return streamRaw(res, mockPath); + } if (rp === "CPL/SERVICE/systemVoltTemp.js") { const mockPath = path.join( process.cwd(), @@ -108,6 +140,16 @@ function tryServeSpecialMocks(res, relPath) { ); if (exists(mockPath)) return streamRaw(res, mockPath); } + // TDR reference curves (if mocks exist) + if (rp.startsWith("CPL/tdr-reference-curves/")) { + const mockPath = path.join( + process.cwd(), + "mocks", + "device-cgi-simulator", + rp.replace(/^CPL\//, "") + ); + if (exists(mockPath)) return streamRaw(res, mockPath); + } return false; }