diff --git a/.env.local b/.env.local
index a79b512..8d9ec74 100644
--- a/.env.local
+++ b/.env.local
@@ -1,5 +1 @@
-#Next.js Webserver, bleibt localhost auf CPL bei production
-#NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
-#CPL Webserver für die Entwicklung , um Daten von CPL zu bekommen, hat funktioniert auf dem CPL selbst
-#NEXT_PUBLIC_API_BASE_URL=https://10.10.0.118:443
-#NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
+NEXT_PUBLIC_NODE_ENV=development
diff --git a/app/kabelueberwachung/page.jsx b/app/kabelueberwachung/page.jsx
index c795875..683f5b6 100644
--- a/app/kabelueberwachung/page.jsx
+++ b/app/kabelueberwachung/page.jsx
@@ -3,24 +3,12 @@ import React, { useState, useEffect } from "react";
import Kue705FO from "../../components/modules/Kue705FO";
function Kabelueberwachung() {
- const [isClient, setIsClient] = useState(false);
-
const [activeRack, setActiveRack] = useState(1); // Track the active rack
const [kueIso, setKueIso] = useState([]); // State to store isolation values
- const [kueName, setKueName] = useState([]); // State to store the KUE names
- const [kueID, setKueID] = useState([]); // State to store the KUE IDs
+ const [kueID, setKueID] = useState([]); // State to store the KUE names
const [schleifenwiderstand, setSchleifenwiderstand] = useState([]); // State to store the resistance values
- //const [kueOnline, setKueOnline] = useState([ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]); // Example array for module status
const [kueOnline, setKueOnline] = useState([]); // State to store the module status
- // Function to handle rack change
- const changeRack = (rack) => {
- setActiveRack(rack);
- };
-
- /* if (!isClient) {
- return null; // or a loading spinner
- }*/
// Load the external JavaScript file and fetch the isolation values
useEffect(() => {
if (window.kueIso && Array.isArray(window.kueIso)) {
@@ -35,69 +23,48 @@ function Kabelueberwachung() {
setKueOnline(window.kueOnline); // Store the module status from the global variable
}
if (window.kueID && Array.isArray(window.kueID)) {
- setKueName(window.kueID); // Store the KUE names from the global variable
+ setKueID(window.kueID); // Store the KUE names from the global variable
}
}, []);
- // Data for each rack, using isolation values from kueIso, kueName, and schleifenwiderstand
+ // Zuerst alle Werte der Arrays speichern
+ const allModules = kueIso.map((iso, index) => ({
+ isolationswert: iso,
+ schleifenwiderstand: schleifenwiderstand[index],
+ modulName: kueID[index] || "Unknown",
+ kueOnlineStatus: kueOnline[index],
+ }));
+
+ // Dann die Module für jedes Rack in 8er-Gruppen aufteilen
const racks = {
- rack1: kueIso.slice(0, 8).map((value, index) => ({
- isolationswert: value, // Isolation value for this slot
- schleifenwiderstand: schleifenwiderstand[index], // Resistance for this slot
- modulName: kueID[index] || "Unknown", // Name for this slot
- kueOnlineStatus: kueOnline[index], // Online status for this slot
- })),
- rack2: kueIso.slice(8, 16).map((value, index) => ({
- isolationswert: value,
- schleifenwiderstand: schleifenwiderstand[8 + index],
- modulName: kueID[8 + index] || "Unknown",
- kueOnlineStatus: kueOnline[8 + index], // Online status for this slot
- })),
- rack3: kueIso.slice(16, 24).map((value, index) => ({
- isolationswert: value,
- schleifenwiderstand: schleifenwiderstand[16 + index],
- modulName: kueID[16 + index] || "Unknown",
- kueOnlineStatus: kueOnline[16 + index], // Online status for this slot
- })),
- rack4: kueIso.slice(24, 32).map((value, index) => ({
- isolationswert: value,
- schleifenwiderstand: schleifenwiderstand[24 + index],
- modulName: kueID[24 + index] || "Unknown",
- kueOnlineStatus: kueOnline[24 + index], // Online status for this slot
- })),
+ rack1: allModules.slice(0, 8),
+ rack2: allModules.slice(8, 16),
+ rack3: allModules.slice(16, 24),
+ rack4: allModules.slice(24, 32),
+ };
+ // Log the racks in the console for debugging
+ console.log("Rack 1:", racks.rack1);
+ console.log("Rack 2:", racks.rack2);
+ console.log("Rack 3:", racks.rack3);
+ console.log("Rack 4:", racks.rack4);
+
+ // Function to handle rack change
+ const changeRack = (rack) => {
+ setActiveRack(rack);
};
useEffect(() => {
const script = document.createElement("script");
- script.src = `CPL?Service/kueData.js`; // Path to your JavaScript file
+ // Dynamischer Pfad basierend auf der Umgebung
+ const environment = process.env.NEXT_PUBLIC_NODE_ENV || "production";
+ if (environment === "production") {
+ script.src = `CPL?/SERVICE/kueData.js`; // Produktions-Pfad
+ } else {
+ script.src = `/mockData/kueData.js`; // Mock-Daten-Pfad
+ }
script.async = true;
document.body.appendChild(script);
- // Once the script is loaded, get the isolation values
- /* script.onload = () => {
- if (window.kueName && Array.isArray(window.kueName)) {
- setKueName(window.kueName); // Store the KUE names from the global variable
- }
- }; */
-
- // Cleanup the script if the component unmounts
- return () => {
- document.body.removeChild(script);
- };
- }, []);
- useEffect(() => {
- const script = document.createElement("script");
- script.src = "CPL?last20Messages.acp"; // Path to your JavaScript file
- script.async = true;
- document.body.appendChild(script);
-
- // Once the script is loaded, get the isolation values
- /* script.onload = () => {
- if (window.kueName && Array.isArray(window.kueName)) {
- setKueName(window.kueName); // Store the KUE names from the global variable
- }
- }; */
-
// Cleanup the script if the component unmounts
return () => {
document.body.removeChild(script);
@@ -108,7 +75,6 @@ function Kabelueberwachung() {
Kabelüberwachung
- {/* Tabs for Racks */}
- {/* Slots for the active rack */}
{racks[`rack${activeRack}`].map((slot, index) => (
@@ -160,9 +125,14 @@ function Kabelueberwachung() {
isolationswert={slot.isolationswert}
schleifenwiderstand={slot.schleifenwiderstand}
modulName={slot.modulName}
- kueOnline={kueOnline}
- slotIndex={index + (activeRack - 1) * 8} // Slot index calculation for each rack
+ kueOnline={slot.kueOnlineStatus}
+ slotIndex={index + (activeRack - 1) * 8}
/>
+ {console.log(
+ `Module Data (Rack ${activeRack}, Slot ${index + 1}):`,
+ slot
+ )}{" "}
+ {/* Log each module's data */}
))}
diff --git a/components/DeviceData.jsx b/components/DeviceData.jsx
deleted file mode 100644
index 5043288..0000000
--- a/components/DeviceData.jsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import React, { useEffect, useState } from "react";
-
-const DeviceData = () => {
- const [deviceData, setDeviceData] = useState("");
- const [error, setError] = useState(null);
-
- useEffect(() => {
- const fetchData = async () => {
- try {
- // Stelle sicher, dass die URL auf den richtigen Server zeigt (localhost:3000)
- const response = await fetch(
- "http://localhost:3000/api/fetchDeviceData"
- );
- if (!response.ok) {
- throw new Error(`Fehler beim Abrufen der Daten: ${response.status}`);
- }
- const data = await response.json();
- setDeviceData(data.content); // Die Daten aus der API-Antwort setzen
- } catch (error) {
- setError(error.message);
- }
- };
-
- fetchData();
- }, []);
-
- return (
-
- {error ? (
-
Fehler: {error}
- ) : (
-
- )}
-
- );
-};
-
-export default DeviceData;
diff --git a/components/Header.jsx b/components/Header.jsx
index 3a97a5c..560cc38 100644
--- a/components/Header.jsx
+++ b/components/Header.jsx
@@ -8,7 +8,6 @@ import SettingsModal from "./modales/SettingsModal";
function Header() {
const [isClient, setIsClient] = useState(false);
-
const [stationsname, setStationsname] = useState("Lädt..."); // Platzhalter
const [cplStatus, setCplStatus] = useState("Lädt...");
const [showSettingsModal, setShowSettingsModal] = useState(false);
@@ -26,13 +25,18 @@ function Header() {
};
const handleLogout = () => {
- window.location.href = "/offline.html"; // Opens offline.html
+ window.location.href = "/offline.html"; // Öffnet offline.html
};
useEffect(() => {
if (typeof window !== "undefined") {
+ console.log("Lade Window-Variablen...");
+
loadWindowVariables()
.then(() => {
+ // Überprüfe, ob die erwarteten Variablen verfügbar sind
+ console.log("Window-Variablen geladen:", window);
+
if (window.ip) {
setStationsname(window.deviceName || "Unbekannt");
setCplStatus(window.hardware_version || "Unbekannt");
@@ -57,15 +61,17 @@ function Header() {
"System.acp",
];
+ const environment = process.env.NEXT_PUBLIC_NODE_ENV || "production"; // Fallback auf 'production'
+
files.forEach((file) => {
const script = document.createElement("script");
- const environment = process.env.NODE_ENV;
+
if (environment === "production") {
script.src = `/CPL?/CPL/SERVICE/${file}`; // Produktions-Pfad
} else {
- script.src = `/CPL/CPL/SERVICE/${file}`; // Entwicklungs-Pfad
+ script.src = `/mockData/${file}`; // Entwicklungs-Pfad
}
- //script.src = `/CPL?/CPL/SERVICE/${file}`;
+
script.async = true;
script.onload = () => console.log(`${file} wurde erfolgreich geladen.`);
script.onerror = (error) =>
@@ -75,7 +81,11 @@ function Header() {
}
}, [isClient]);
- if (!isClient) return null; // Don't render the component until on the client side
+ useEffect(() => {
+ console.log("Environment:", process.env.NEXT_PUBLIC_NODE_ENV); // Logge die Umgebungsvariable
+ }, []);
+
+ if (!isClient) return null; // Rendere die Komponente nicht, bis sie clientseitig ausgeführt wird
return (
@@ -94,7 +104,7 @@ function Header() {
{/* CPL Status und Stationsname */}
-
Stationsname
+
Stationsname
{stationsname}
diff --git a/components/Navigation.jsx b/components/Navigation.jsx
index 42d62e4..0995fb1 100644
--- a/components/Navigation.jsx
+++ b/components/Navigation.jsx
@@ -14,7 +14,7 @@ function Navigation() {
}, [pathname]);
const menuItems = [
- { name: "Übersicht", path: "/dashboard.html" },
+ { name: "Übersicht", path: "/dashboard" },
{ name: "Kabelüberwachung", path: "/kabelueberwachung" },
//{ name: "Zutrittskontrolle", path: "/access" },
//{ name: "Ein- und Ausgänge", path: "/einausgaenge" },
diff --git a/components/modales/KueModal.jsx b/components/modales/KueModal.jsx
index 8a8d921..2eb1a7a 100644
--- a/components/modales/KueModal.jsx
+++ b/components/modales/KueModal.jsx
@@ -114,7 +114,7 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
// Falls Änderungen vorhanden sind, die fetch-Requests auslösen
if (Object.keys(changes).length > 0) {
- let url = `https://${window.ip}:443/cpl?Service/kueDetail.HTML&slot=${slot}`;
+ let url = `/cpl?/SERVICE/kueDetail.HTML&slot=${slot}`;
Object.keys(changes).forEach((paramKey) => {
url += `&${paramKey}${slot}=${encodeURIComponent(changes[paramKey])}`;
@@ -142,7 +142,7 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
};
const handleDisplayEinschalten = () => {
- const url = `https://${window.ip}:443/cpl?Service/kueDetail.HTML&KSD${slot}=1`;
+ const url = `/CPL?/Service/kueDetail.HTML&KSD${slot}=1`;
fetch(url, { method: "GET" })
.then((response) => {
if (response.ok) {
diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx
index 1abe1f2..506968b 100644
--- a/components/modules/Kue705FO.jsx
+++ b/components/modules/Kue705FO.jsx
@@ -240,7 +240,7 @@ function Kue705FO({
};
// Überprüfe, ob ein Modul im Slot vorhanden ist
- const isModulPresent = kueOnline[slotIndex] === 1;
+ const isModulPresent = kueOnline === 1; // Since you're passing the status directly now
const handleButtonClick = (button) => {
if (button === "Schleife") {
diff --git a/public/mockData/Start.acp b/public/mockData/Start.acp
new file mode 100644
index 0000000..4d5ce8d
--- /dev/null
+++ b/public/mockData/Start.acp
@@ -0,0 +1 @@
+var last20Messages="| 16750 | 03501 | 2024-10-23 15:08:58:000 | Modul 26 Isofehler kommend | 1 |
| 16749 | 03201 | 2024-10-23 15:07:24:000 | Modul 23 Isofehler gehend | 0 |
| 16748 | 03501 | 2024-10-23 15:01:52:000 | Modul 26 Isofehler gehend | 0 |
| 16747 | 02801 | 2024-10-23 15:01:30:000 | Modul 19 Isofehler kommend | 1 |
| 16746 | 03501 | 2024-10-23 14:57:33:000 | Modul 26 Isofehler kommend | 1 |
| 16745 | 03201 | 2024-10-23 14:56:54:000 | Modul 23 Isofehler kommend | 1 |
| 16744 | 02801 | 2024-10-23 14:51:01:000 | Modul 19 Isofehler gehend | 0 |
| 16743 | 03501 | 2024-10-23 14:50:46:000 | Modul 26 Isofehler gehend | 0 |
| 16742 | 03201 | 2024-10-23 14:49:49:000 | Modul 23 Isofehler gehend | 0 |
| 16741 | 03501 | 2024-10-23 14:49:13:000 | Modul 26 Isofehler kommend | 1 |
| 16740 | 02801 | 2024-10-23 14:45:28:000 | Modul 19 Isofehler kommend | 1 |
| 16739 | 03201 | 2024-10-23 14:44:16:000 | Modul 23 Isofehler kommend | 1 |
| 16738 | 03501 | 2024-10-23 14:42:08:000 | Modul 26 Isofehler gehend | 0 |
| 16737 | 03201 | 2024-10-23 14:37:10:000 | Modul 23 Isofehler gehend | 0 |
| 16736 | 03501 | 2024-10-23 14:35:20:000 | Modul 26 Isofehler kommend | 1 |
| 16735 | 01201 | 2024-10-23 14:31:44:000 | Modul 03 Isofehler kommend | 1 |
| 16734 | 01701 | 2024-10-23 14:30:14:000 | Modul 08 Isofehler kommend | 1 |
| 16733 | 03501 | 2024-10-23 14:28:15:000 | Modul 26 Isofehler gehend | 0 |
| 16732 | 03301 | 2024-10-23 14:26:23:000 | Modul 24 Isofehler kommend | 1 |
| 16731 | 01201 | 2024-10-23 14:24:58:000 | Modul 03 Isofehler gehend | 0 |
";
\ No newline at end of file
diff --git a/public/mockData/System.acp b/public/mockData/System.acp
new file mode 100644
index 0000000..a133129
--- /dev/null
+++ b/public/mockData/System.acp
@@ -0,0 +1,16 @@
+var appVersion="0.02";
+var deviceName="CPLV4_Maschen";
+var mac1="0 48 86 81 46 143";
+var mac2="0 48 86 81 46 144";
+var ip="10.10.0.243";
+var subnet="255.255.255.0";
+var gateway="10.10.0.1";
+var datetime="23.10.24 15:10:28 Uhr";
+var opcState="1";
+var opcSessions="0";
+var opcName="CPL V4 OPC UA Application Deutsche Bahne']'])";
+var ntp1="192.53.103.108";
+var ntp2="0.0.0.0";
+var ntp3="0.0.0.0";
+var ntpTimezone="2";
+var ntpActive="1";
\ No newline at end of file
diff --git a/public/mockData/de.acp b/public/mockData/de.acp
new file mode 100644
index 0000000..d4ae109
--- /dev/null
+++ b/public/mockData/de.acp
@@ -0,0 +1,3 @@
+var de=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var counter=[0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000];
+var flutter=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
\ No newline at end of file
diff --git a/public/mockData/kueConfig.acp b/public/mockData/kueConfig.acp
new file mode 100644
index 0000000..90b7a73
--- /dev/null
+++ b/public/mockData/kueConfig.acp
@@ -0,0 +1,4 @@
+var kueOnline=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueID=['FTZ_2','B23','Kabel 3','Kabel 4','Kabel 5','Kabel 6','FTZ4562','Kabel 8','12344','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','H56-77','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueName=['Kabel_2','Petersfehn','Kabel 3','Kabel 4','Kabel 5','Kabel 6','Melanie','Kabel 8','Merle','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','Daniela','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueIso=[10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.50,10.00,200.00,200.00,200.00,200.00];
\ No newline at end of file
diff --git a/public/mockData/kueData.js b/public/mockData/kueData.js
new file mode 100644
index 0000000..0a01042
--- /dev/null
+++ b/public/mockData/kueData.js
@@ -0,0 +1,25 @@
+
+var kueOnline=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueIso=[10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.50,10.00,200.00,200.00,200.00,200.00];
+var kueValid=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueAlarm1=[1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0];
+var kueAlarm2=[1,0,1,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0];
+var kueRes=[0.000,0.612,0.000,0.645,0.821,0.970,0.000,0.000,1.452,0.000,0.734,0.370,0.566,0.000,0.738,0.684,1.166,0.595,0.000,1.651,1.180,1.387,1.214,0.000,1.475,0.615,0.494,1.217,65.000,65.000,65.000,65.000];
+var kueCableBreak=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1];
+var kueGroundFault=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var kueLimit1=[10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00];
+var kueLimit2Low=[0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100];
+var kueLimit2High=[1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000];
+var kueDelay1=[420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420];
+var kueLoopInterval=[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6];
+var kueID=['FTZ_2','B23','Kabel 3','Kabel 4','Kabel 5','Kabel 6','FTZ4562','Kabel 8','12344','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','H56-77','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueName=['Kabel_2','Petersfehn','Kabel 3','Kabel 4','Kabel 5','Kabel 6','Melanie','Kabel 8','Merle','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','Daniela','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueVersion=[419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419];
+var kueOverflow=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1];
+var kue100V=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var kueResidence=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var kueBooting=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+
+
+
+
diff --git a/public/mockData/kueDetailTdr.acp b/public/mockData/kueDetailTdr.acp
new file mode 100644
index 0000000..5c2fa39
--- /dev/null
+++ b/public/mockData/kueDetailTdr.acp
@@ -0,0 +1,17 @@
+var kueOnline=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueValid=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+
+
+var kueID=['FTZ_2','B23','Kabel 3','Kabel 4','Kabel 5','Kabel 6','FTZ4562','Kabel 8','12344','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','H56-77','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueName=['Kabel_2','Petersfehn','Kabel 3','Kabel 4','Kabel 5','Kabel 6','Melanie','Kabel 8','Merle','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','Daniela','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueVersion=[419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419];
+
+
+var tdrAtten=[2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0];
+var tdrPulse=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrSpeed=[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100];
+var tdrAmp=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrTrigger=[80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80];
+var tdrLocation=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrActive=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrLast=['2024-10-17 07:51:54:000','2024-09-30 08:38:50:000','?','?','?','?','?','?','2024-09-30 08:36:43:000','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?'];
\ No newline at end of file
diff --git a/public/mockData/last20Messages.acp b/public/mockData/last20Messages.acp
new file mode 100644
index 0000000..0dc32aa
--- /dev/null
+++ b/public/mockData/last20Messages.acp
@@ -0,0 +1,58 @@
+// Letzte 20 Meldungen für dashboard.html Start.acp
+var last20Messages = `| 16750 | 03501 | 2024-10-23 15:08:58:000 | Modul 26 Isofehler kommend | 1 |
| 16749 | 03201 | 2024-10-23 15:07:24:000 | Modul 23 Isofehler gehend | 0 |
| 16748 | 03501 | 2024-10-23 15:01:52:000 | Modul 26 Isofehler gehend | 0 |
| 16747 | 02801 | 2024-10-23 15:01:30:000 | Modul 19 Isofehler kommend | 1 |
| 16746 | 03501 | 2024-10-23 14:57:33:000 | Modul 26 Isofehler kommend | 1 |
| 16745 | 03201 | 2024-10-23 14:56:54:000 | Modul 23 Isofehler kommend | 1 |
| 16744 | 02801 | 2024-10-23 14:51:01:000 | Modul 19 Isofehler gehend | 0 |
| 16743 | 03501 | 2024-10-23 14:50:46:000 | Modul 26 Isofehler gehend | 0 |
| 16742 | 03201 | 2024-10-23 14:49:49:000 | Modul 23 Isofehler gehend | 0 |
| 16741 | 03501 | 2024-10-23 14:49:13:000 | Modul 26 Isofehler kommend | 1 |
| 16740 | 02801 | 2024-10-23 14:45:28:000 | Modul 19 Isofehler kommend | 1 |
| 16739 | 03201 | 2024-10-23 14:44:16:000 | Modul 23 Isofehler kommend | 1 |
| 16738 | 03501 | 2024-10-23 14:42:08:000 | Modul 26 Isofehler gehend | 0 |
| 16737 | 03201 | 2024-10-23 14:37:10:000 | Modul 23 Isofehler gehend | 0 |
| 16736 | 03501 | 2024-10-23 14:35:20:000 | Modul 26 Isofehler kommend | 1 |
| 16735 | 01201 | 2024-10-23 14:31:44:000 | Modul 03 Isofehler kommend | 1 |
| 16734 | 01701 | 2024-10-23 14:30:14:000 | Modul 08 Isofehler kommend | 1 |
| 16733 | 03501 | 2024-10-23 14:28:15:000 | Modul 26 Isofehler gehend | 0 |
| 16732 | 03301 | 2024-10-23 14:26:23:000 | Modul 24 Isofehler kommend | 1 |
| 16731 | 01201 | 2024-10-23 14:24:58:000 | Modul 03 Isofehler gehend | 0 |
`;
+
+//System.acp
+var appVersion="0.02";
+var deviceName="CPLV4_Maschen";
+var mac1="0 48 86 81 46 143";
+var mac2="0 48 86 81 46 144";
+var ip="10.10.0.243";
+var subnet="255.255.255.0";
+var gateway="10.10.0.1";
+var datetime="23.10.24 15:10:27 Uhr";
+
+//de.acp
+var de=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var counter=[0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000];
+var flutter=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+
+//kueConfig.acp
+var kueOnline=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueID=['FTZ_2','B23','Kabel 3','Kabel 4','Kabel 5','Kabel 6','FTZ4562','Kabel 8','12344','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','H56-77','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueIso=[10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.50,10.00,200.00,200.00,200.00,200.00];
+
+//kueDetail.acp
+var kueOnline=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueIso=[10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.50,10.00,10.00,10.00,10.00,10.00,10.50,10.00,200.00,200.00,200.00,200.00];
+var kueValid=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
+var kueAlarm1=[1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0];
+var kueAlarm2=[1,0,1,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0];
+
+var kueRes=[0.000,0.612,0.000,0.645,0.821,0.970,0.000,0.000,1.452,0.000,0.734,0.370,0.566,0.000,0.738,0.684,1.166,0.595,0.000,1.651,1.180,1.387,1.214,0.000,1.475,0.615,0.494,1.217,65.000,65.000,65.000,65.000];
+
+var kueCableBreak=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1];
+var kueGroundFault=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+
+var kueLimit1=[10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00];
+var kueLimit2Low=[0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100,0.100];
+var kueLimit2High=[1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000];
+var kueDelay1=[420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420];
+var kueLoopInterval=[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6];
+
+var kueID=['FTZ_2','B23','Kabel 3','Kabel 4','Kabel 5','Kabel 6','FTZ4562','Kabel 8','12344','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','H56-77','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+var kueVersion=[419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419];
+var kueName=['Kabel_2','Petersfehn','Kabel 3','Kabel 4','Kabel 5','Kabel 6','Melanie','Kabel 8','Merle','Kabel 10','Kabel 11','Kabel 12','Kabel 13','Kabel 14','Kabel 15','Daniela','Kabel 17','Kabel 18','Kabel 19','Kabel 20','Kabel 21','Kabel 22','Kabel 23','Kabel 24','Kabel 25','Kabel 26','Kabel 27','Kabel 28','Kabel 29','Kabel 30','Kabel 31','Kabel 32'];
+
+
+var tdrAtten=[2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0];
+var tdrPulse=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrSpeed=[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100];
+var tdrAmp=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrTrigger=[80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80];
+var tdrLocation=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrActive=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var kueOverflow=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1];
+var kue100V=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var kueResidence=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
+var tdrLastMeasurement=['2024-10-17 07:51:54:000','2024-09-30 08:38:50:000','?','?','?','?','?','?','2024-09-30 08:36:43:000','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?'];
+var kueBooting=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
\ No newline at end of file
diff --git a/utils/loadWindowVariables.js b/utils/loadWindowVariables.js
index acfd98e..4c272a3 100644
--- a/utils/loadWindowVariables.js
+++ b/utils/loadWindowVariables.js
@@ -6,7 +6,15 @@ export async function loadWindowVariables() {
const loadScript = (src) => {
return new Promise((resolve, reject) => {
const script = document.createElement("script");
- script.src = `/CPL?${src}`;
+ //script.src = `/CPL?${src}`;
+ // Dynamischer Pfad basierend auf der Umgebung
+ const environment = process.env.NEXT_PUBLIC_NODE_ENV || "production"; // Fallback auf 'production'
+
+ if (environment === "production") {
+ script.src = `/CPL?/${src}`; // Produktions-Pfad
+ } else {
+ script.src = `/mockData/${src}`; // Entwicklungs-Pfad
+ }
script.async = true;
script.onload = () => {
resolve();