Compare commits
2 Commits
72341abb23
...
a596422056
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a596422056 | ||
|
|
531fa93b70 |
@@ -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.867
|
NEXT_PUBLIC_APP_VERSION=1.6.869
|
||||||
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.867
|
NEXT_PUBLIC_APP_VERSION=1.6.869
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,3 +1,13 @@
|
|||||||
|
## [1.6.869] – 2025-09-08
|
||||||
|
|
||||||
|
- fix: Beim Ausführen einer TDR-Messung (Klick auf blauen Button in der TDR-Detailseite) erscheint keine Rückmeldung. Dort müsste ein Hinweis erscheinen “TDR-Messung wird ausgeführt und kann bis zu zwei Minuten dauern”
|
||||||
|
|
||||||
|
---
|
||||||
|
## [1.6.868] – 2025-09-08
|
||||||
|
|
||||||
|
- fix: Timer für jeder KÜ separate und nicht eine für alle, aktuell wird prozentzahl bei allen das gleiche angezeigt
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.867] – 2025-09-08
|
## [1.6.867] – 2025-09-08
|
||||||
|
|
||||||
- WIP: Timer für jeder KÜ separate und nicht eine für alle, aktuell wird prozentzahl bei allen das gleiche angezeigt
|
- WIP: Timer für jeder KÜ separate und nicht eine für alle, aktuell wird prozentzahl bei allen das gleiche angezeigt
|
||||||
|
|||||||
@@ -389,7 +389,8 @@ const LoopChartActionBar = forwardRef((_props, ref) => {
|
|||||||
<div className="mb-4 text-center space-y-1">
|
<div className="mb-4 text-center space-y-1">
|
||||||
<p className="text-lg font-semibold">RSL Messung läuft</p>
|
<p className="text-lg font-semibold">RSL Messung läuft</p>
|
||||||
<p className="text-sm text-gray-700">
|
<p className="text-sm text-gray-700">
|
||||||
Bitte warten… (noch {TOTAL_DURATION - rslProgress}s)
|
Bitte warten…{" "}
|
||||||
|
{Math.min(100, Math.round((rslProgress / TOTAL_DURATION) * 100))}%
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-2/3 max-w-xl h-4 bg-gray-200 rounded overflow-hidden shadow-inner">
|
<div className="w-2/3 max-w-xl h-4 bg-gray-200 rounded overflow-hidden shadow-inner">
|
||||||
|
|||||||
@@ -30,6 +30,36 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
const [selectedId, setSelectedId] = useState<number | null>(null);
|
const [selectedId, setSelectedId] = useState<number | null>(null);
|
||||||
const currentChartData = selectedId !== null ? tdrDataById[selectedId] : [];
|
const currentChartData = selectedId !== null ? tdrDataById[selectedId] : [];
|
||||||
|
|
||||||
|
// ▶ Fortschrittsanzeige für laufende TDR-Messung (max. 120s bzw. konfigurierbar)
|
||||||
|
const TDR_TOTAL_DURATION = parseInt(
|
||||||
|
process.env.NEXT_PUBLIC_TDR_DURATION_SECONDS || "120",
|
||||||
|
10
|
||||||
|
);
|
||||||
|
const [tdrRunning, setTdrRunning] = useState(false);
|
||||||
|
const [tdrProgress, setTdrProgress] = useState(0); // Sekunden
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!tdrRunning) return;
|
||||||
|
setTdrProgress(0);
|
||||||
|
const startedAt = Date.now();
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
const elapsed = Math.floor((Date.now() - startedAt) / 1000);
|
||||||
|
if (elapsed >= TDR_TOTAL_DURATION) {
|
||||||
|
setTdrProgress(TDR_TOTAL_DURATION);
|
||||||
|
setTdrRunning(false);
|
||||||
|
clearInterval(interval);
|
||||||
|
} else {
|
||||||
|
setTdrProgress(elapsed);
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, [tdrRunning, TDR_TOTAL_DURATION]);
|
||||||
|
|
||||||
|
const startTdrProgress = () => {
|
||||||
|
setTdrRunning(true);
|
||||||
|
setTdrProgress(0);
|
||||||
|
};
|
||||||
|
|
||||||
// 📌 Referenz setzen (nutzt Slotnummer + 1 für die API)
|
// 📌 Referenz setzen (nutzt Slotnummer + 1 für die API)
|
||||||
const handleSetReference = async () => {
|
const handleSetReference = async () => {
|
||||||
if (
|
if (
|
||||||
@@ -94,15 +124,19 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
try {
|
try {
|
||||||
console.log("🚀 Starte TDR Messung für Slot:", selectedSlot);
|
console.log("🚀 Starte TDR Messung für Slot:", selectedSlot);
|
||||||
console.log("📡 CGI URL:", cgiUrl);
|
console.log("📡 CGI URL:", cgiUrl);
|
||||||
|
const isDev = process.env.NEXT_PUBLIC_NODE_ENV === "development";
|
||||||
const response = await fetch(cgiUrl);
|
if (isDev) {
|
||||||
|
// Dev / Simulator: sofort starten & Progress anzeigen
|
||||||
if (!response.ok) {
|
await new Promise((r) => setTimeout(r, 150));
|
||||||
throw new Error(`CGI-Fehler: ${response.status}`);
|
console.log("✅ [DEV] TDR Mock-Start ok für Slot", selectedSlot);
|
||||||
|
startTdrProgress();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const response = await fetch(cgiUrl);
|
||||||
|
if (!response.ok) throw new Error(`CGI-Fehler: ${response.status}`);
|
||||||
console.log("✅ TDR Messung gestartet für Slot", selectedSlot);
|
console.log("✅ TDR Messung gestartet für Slot", selectedSlot);
|
||||||
//alert(`✅ TDR Messung für Slot ${selectedSlot + 1} gestartet`);
|
startTdrProgress();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler beim Starten der TDR Messung:", err);
|
console.error("❌ Fehler beim Starten der TDR Messung:", err);
|
||||||
//alert("❌ Fehler beim Starten der TDR Messung.");
|
//alert("❌ Fehler beim Starten der TDR Messung.");
|
||||||
@@ -130,6 +164,7 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
}, [selectedSlot, dispatch]);
|
}, [selectedSlot, dispatch]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<div className="flex justify-between items-center p-2 bg-gray-100 rounded-lg space-x-4">
|
<div className="flex justify-between items-center p-2 bg-gray-100 rounded-lg space-x-4">
|
||||||
{/* 🧩 Slot-Anzeige (1-basiert für Benutzer) */}
|
{/* 🧩 Slot-Anzeige (1-basiert für Benutzer) */}
|
||||||
<div className="text-sm font-semibold">
|
<div className="text-sm font-semibold">
|
||||||
@@ -150,9 +185,14 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
<button
|
<button
|
||||||
onClick={handleStartTDR}
|
onClick={handleStartTDR}
|
||||||
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap "
|
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap "
|
||||||
disabled={selectedSlot === null}
|
disabled={selectedSlot === null || tdrRunning}
|
||||||
>
|
>
|
||||||
TDR-Messung starten
|
{tdrRunning
|
||||||
|
? `TDR läuft... (${Math.min(
|
||||||
|
100,
|
||||||
|
Math.round((tdrProgress / TDR_TOTAL_DURATION) * 100)
|
||||||
|
)}%)`
|
||||||
|
: "TDR-Messung starten"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* 🔽 Dropdown für Messungen */}
|
{/* 🔽 Dropdown für Messungen */}
|
||||||
@@ -233,6 +273,30 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
</Listbox>
|
</Listbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{tdrRunning && (
|
||||||
|
<div className="fixed inset-0 z-[1000] flex flex-col items-center justify-center bg-white/80 backdrop-blur-sm">
|
||||||
|
<div className="mb-4 text-center space-y-1">
|
||||||
|
<p className="text-lg font-semibold">TDR Messung läuft</p>
|
||||||
|
<p className="text-sm text-gray-700">
|
||||||
|
Bitte warten…{" "}
|
||||||
|
{Math.min(
|
||||||
|
100,
|
||||||
|
Math.round((tdrProgress / TDR_TOTAL_DURATION) * 100)
|
||||||
|
)}
|
||||||
|
%
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="w-2/3 max-w-xl h-4 bg-gray-200 rounded overflow-hidden shadow-inner">
|
||||||
|
<div
|
||||||
|
className="h-full bg-littwin-blue transition-all ease-linear"
|
||||||
|
style={{
|
||||||
|
width: `${(tdrProgress / TDR_TOTAL_DURATION) * 100}%`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -174,18 +174,6 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
|||||||
const openTdrModal = () => {
|
const openTdrModal = () => {
|
||||||
setActiveButton("TDR");
|
setActiveButton("TDR");
|
||||||
setloopTitleText("Entfernung [km]");
|
setloopTitleText("Entfernung [km]");
|
||||||
|
|
||||||
const latestTdrDistanceMeters =
|
|
||||||
Array.isArray(tdmChartData?.[slotIndex]) &&
|
|
||||||
tdmChartData[slotIndex].length > 0 &&
|
|
||||||
typeof tdmChartData[slotIndex][0].d === "number"
|
|
||||||
? tdmChartData[slotIndex][0].d
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
const latestTdrDistance = Number(
|
|
||||||
(latestTdrDistanceMeters / 1000).toFixed(3)
|
|
||||||
);
|
|
||||||
setLoopDisplayValue(latestTdrDistance);
|
|
||||||
setShowTdrModal(true);
|
setShowTdrModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -272,30 +260,16 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
|||||||
return () => window.removeEventListener("resize", measure);
|
return () => window.removeEventListener("resize", measure);
|
||||||
}, [moduleName48, scrollFeatureEnabled]);
|
}, [moduleName48, scrollFeatureEnabled]);
|
||||||
//---------------------------------
|
//---------------------------------
|
||||||
const tdmChartData = useSelector(
|
// TDR Distanz wird im Display nicht angezeigt – Daten für Modal werden separat geladen
|
||||||
(state: RootState) => state.tdmChartSlice.data
|
|
||||||
);
|
|
||||||
const latestTdrDistanceMeters =
|
|
||||||
Array.isArray(tdmChartData?.[slotIndex]) &&
|
|
||||||
tdmChartData[slotIndex].length > 0 &&
|
|
||||||
typeof tdmChartData[slotIndex][0].d === "number"
|
|
||||||
? tdmChartData[slotIndex][0].d
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
const latestTdrDistance = Number((latestTdrDistanceMeters / 1000).toFixed(3));
|
|
||||||
//setLoopDisplayValue(latestTdrDistance);
|
|
||||||
|
|
||||||
//---------------------------------
|
//---------------------------------
|
||||||
|
|
||||||
const loopValue =
|
const rslValue =
|
||||||
activeButton === "TDR"
|
typeof schleifenwiderstand === "number"
|
||||||
? latestTdrDistance
|
|
||||||
: typeof schleifenwiderstand === "number"
|
|
||||||
? schleifenwiderstand
|
? schleifenwiderstand
|
||||||
: Number(schleifenwiderstand);
|
: Number(schleifenwiderstand);
|
||||||
|
|
||||||
const { loopDisplayValue, setLoopDisplayValue } = useLoopDisplay(
|
const { loopDisplayValue, setLoopDisplayValue } = useLoopDisplay(
|
||||||
loopValue,
|
rslValue,
|
||||||
activeButton
|
activeButton
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -409,7 +383,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
|||||||
.toFixed(2)
|
.toFixed(2)
|
||||||
.replace(".", ",")} MOhm`}
|
.replace(".", ",")} MOhm`}
|
||||||
</span>
|
</span>
|
||||||
{/* 3. Zeile: Schleifenwert, in Rot bei Schleifenfehler, sonst normal */}
|
{/* 3. Zeile: Schleifenwert (RSL) immer anzeigen, unabhängig von aktivem Button */}
|
||||||
<span
|
<span
|
||||||
className={`whitespace-nowrap block text-[0.65rem] font-semibold ${
|
className={`whitespace-nowrap block text-[0.65rem] font-semibold ${
|
||||||
Number(kueAlarm2?.[slotIndex]) === 1 ? "text-red-500" : ""
|
Number(kueAlarm2?.[slotIndex]) === 1 ? "text-red-500" : ""
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
// components/main/kabelueberwachung/kue705FO/hooks/useLoopDisplay.ts
|
// components/main/kabelueberwachung/kue705FO/hooks/useLoopDisplay.ts
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
// Keeps and updates the loop (RSL) display value only when "Schleife" active.
|
||||||
|
// For ISO or TDR views we do not overwrite the displayed RSL value.
|
||||||
const useLoopDisplay = (
|
const useLoopDisplay = (
|
||||||
schleifenwiderstand: number,
|
rslValue: number,
|
||||||
activeButton: "Schleife" | "TDR" | "ISO"
|
activeButton: "Schleife" | "TDR" | "ISO"
|
||||||
) => {
|
) => {
|
||||||
const [loopDisplayValue, setLoopDisplayValue] =
|
const [loopDisplayValue, setLoopDisplayValue] = useState<number>(rslValue);
|
||||||
useState<number>(schleifenwiderstand);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (activeButton === "Schleife") {
|
if (activeButton === "Schleife") {
|
||||||
setLoopDisplayValue(schleifenwiderstand);
|
setLoopDisplayValue(rslValue);
|
||||||
}
|
}
|
||||||
// For ISO and TDR, the value is set manually via setLoopDisplayValue
|
}, [rslValue, activeButton]);
|
||||||
}, [schleifenwiderstand, activeButton]);
|
|
||||||
|
|
||||||
return { loopDisplayValue, setLoopDisplayValue };
|
return { loopDisplayValue, setLoopDisplayValue };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ var tdrMeasurementEvent = [
|
|||||||
//Event Abgleich
|
//Event Abgleich
|
||||||
var comparisonEvent = [
|
var comparisonEvent = [
|
||||||
// renamed from alignmentEvent
|
// renamed from alignmentEvent
|
||||||
1, 0, 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, 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, 0, 0, 0, 0, 0,
|
||||||
];
|
];
|
||||||
// expose for browser simulation
|
// expose for browser simulation
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.867",
|
"version": "1.6.869",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.867",
|
"version": "1.6.869",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@headlessui/react": "^2.2.4",
|
"@headlessui/react": "^2.2.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.867",
|
"version": "1.6.869",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3000",
|
||||||
|
|||||||
Reference in New Issue
Block a user