fix: Schleifenwiderstand (TDR) Messung starten Button auf der Produktion

This commit is contained in:
ISA
2025-07-31 09:54:22 +02:00
parent ad6642b5e7
commit 86b35e9925
6 changed files with 37 additions and 8 deletions

View File

@@ -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.658
NEXT_PUBLIC_APP_VERSION=1.6.659
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_USE_CGI=true
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.658
NEXT_PUBLIC_APP_VERSION=1.6.659
NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.659] 2025-07-31
- feat: Display und Chart für KÜs
---
## [1.6.658] 2025-07-31
- feat; in KÜ Chart RSL und ISO start button

View File

@@ -7,12 +7,10 @@ import { RootState } from "@/redux/store";
import {
setLoopMeasurementCurveChartData,
setSelectedMode,
setSelectedSlotType,
setChartOpen,
setLoading,
} from "@/redux/slices/kabelueberwachungChartSlice";
import { setBrushRange } from "@/redux/slices/brushSlice";
import { setChartTitle } from "@/redux/slices/loopChartTypeSlice";
import { Listbox } from "@headlessui/react";
//-----------------------------------------------------------------------------------useLoopChartLoader
@@ -130,6 +128,32 @@ const LoopChartActionBar: React.FC = () => {
return `${year};${month};${day}`;
};
const handleStartRSL = async () => {
if (slotNumber === null) {
alert("⚠️ Bitte zuerst einen KÜ auswählen!");
return;
}
const cgiUrl = `${window.location.origin}/CPL?kabelueberwachung.html&KS_${slotNumber}=1`;
try {
console.log("🚀 Starte RSL Messung für Slot:", slotNumber);
console.log("📡 CGI URL:", cgiUrl);
const response = await fetch(cgiUrl);
if (!response.ok) {
throw new Error(`CGI-Fehler: ${response.status}`);
}
console.log("✅ RSL Messung gestartet für Slot", slotNumber);
alert(`✅ RSL Messung für Slot ${slotNumber + 1} gestartet`);
} catch (err) {
console.error("❌ Fehler beim Starten der RSL Messung:", err);
alert("❌ Fehler beim Starten der RSL Messung.");
}
};
const handleFetchData = async () => {
const type = selectedSlotType === "schleifenwiderstand" ? 4 : 3;
@@ -260,7 +284,7 @@ const LoopChartActionBar: React.FC = () => {
{/* Schleife starten button*/}
<button
onClick={handleFetchData}
onClick={handleStartRSL}
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap"
disabled={isLoading}
>

4
package-lock.json generated
View File

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

View File

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