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”
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.867
|
NEXT_PUBLIC_APP_VERSION=1.6.868
|
||||||
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.868
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
## [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,109 +164,139 @@ 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">
|
<>
|
||||||
{/* 🧩 Slot-Anzeige (1-basiert für Benutzer) */}
|
<div className="flex justify-between items-center p-2 bg-gray-100 rounded-lg space-x-4">
|
||||||
<div className="text-sm font-semibold">
|
{/* 🧩 Slot-Anzeige (1-basiert für Benutzer) */}
|
||||||
{selectedSlot !== null ? `KÜ ${selectedSlot + 1}` : "Kein KÜ gewählt"}
|
<div className="text-sm font-semibold">
|
||||||
</div>
|
{selectedSlot !== null ? `KÜ ${selectedSlot + 1}` : "Kein KÜ gewählt"}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* ✅ Referenz setzen */}
|
{/* ✅ Referenz setzen */}
|
||||||
{selectedId !== null && (
|
{selectedId !== null && (
|
||||||
|
<button
|
||||||
|
onClick={handleSetReference}
|
||||||
|
className="border border-littwin-blue text-littwin-blue bg-white rounded px-3 py-1 text-sm hover:bg-gray-200"
|
||||||
|
>
|
||||||
|
TDR-Kurve als Referenz speichern
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 🚀 TDR starten */}
|
||||||
<button
|
<button
|
||||||
onClick={handleSetReference}
|
onClick={handleStartTDR}
|
||||||
className="border border-littwin-blue text-littwin-blue bg-white rounded px-3 py-1 text-sm hover:bg-gray-200"
|
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap "
|
||||||
|
disabled={selectedSlot === null || tdrRunning}
|
||||||
>
|
>
|
||||||
TDR-Kurve als Referenz speichern
|
{tdrRunning
|
||||||
|
? `TDR läuft... (${Math.min(
|
||||||
|
100,
|
||||||
|
Math.round((tdrProgress / TDR_TOTAL_DURATION) * 100)
|
||||||
|
)}%)`
|
||||||
|
: "TDR-Messung starten"}
|
||||||
</button>
|
</button>
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 🚀 TDR starten */}
|
{/* 🔽 Dropdown für Messungen */}
|
||||||
<button
|
<div className="flex items-center space-x-2">
|
||||||
onClick={handleStartTDR}
|
<Listbox
|
||||||
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap "
|
value={selectedId}
|
||||||
disabled={selectedSlot === null}
|
onChange={(id) => {
|
||||||
>
|
setSelectedId(id);
|
||||||
TDR-Messung starten
|
if (id !== null) {
|
||||||
</button>
|
dispatch(getTDRChartDataByIdThunk(id));
|
||||||
|
}
|
||||||
{/* 🔽 Dropdown für Messungen */}
|
}}
|
||||||
<div className="flex items-center space-x-2">
|
disabled={idsForSlot.length === 0}
|
||||||
<Listbox
|
>
|
||||||
value={selectedId}
|
<div className="relative w-96">
|
||||||
onChange={(id) => {
|
<Listbox.Button className="w-full border px-2 py-1 rounded text-left bg-white flex justify-between items-center text-sm">
|
||||||
setSelectedId(id);
|
<span className="whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
if (id !== null) {
|
{selectedId
|
||||||
dispatch(getTDRChartDataByIdThunk(id));
|
? (() => {
|
||||||
}
|
const selected = idsForSlot.find(
|
||||||
}}
|
(e) => e.id === selectedId
|
||||||
disabled={idsForSlot.length === 0}
|
);
|
||||||
>
|
return selected
|
||||||
<div className="relative w-96">
|
? `${new Date(selected.t).toLocaleString("de-DE", {
|
||||||
<Listbox.Button className="w-full border px-2 py-1 rounded text-left bg-white flex justify-between items-center text-sm">
|
day: "2-digit",
|
||||||
<span className="whitespace-nowrap overflow-hidden text-ellipsis">
|
month: "2-digit",
|
||||||
{selectedId
|
year: "numeric",
|
||||||
? (() => {
|
hour: "2-digit",
|
||||||
const selected = idsForSlot.find(
|
minute: "2-digit",
|
||||||
(e) => e.id === selectedId
|
second: "2-digit",
|
||||||
);
|
})} – Fehlerstelle: ${selected.d} m`
|
||||||
return selected
|
: "Wähle Messung";
|
||||||
? `${new Date(selected.t).toLocaleString("de-DE", {
|
})()
|
||||||
day: "2-digit",
|
: "Wähle Messung"}
|
||||||
month: "2-digit",
|
</span>
|
||||||
year: "numeric",
|
<svg
|
||||||
hour: "2-digit",
|
className="w-5 h-5 text-gray-400"
|
||||||
minute: "2-digit",
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
second: "2-digit",
|
viewBox="0 0 20 20"
|
||||||
})} – Fehlerstelle: ${selected.d} m`
|
fill="currentColor"
|
||||||
: "Wähle Messung";
|
aria-hidden="true"
|
||||||
})()
|
|
||||||
: "Wähle Messung"}
|
|
||||||
</span>
|
|
||||||
<svg
|
|
||||||
className="w-5 h-5 text-gray-400"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
fill="currentColor"
|
|
||||||
aria-hidden="true"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
fillRule="evenodd"
|
|
||||||
d="M5.23 7.21a.75.75 0 011.06.02L10 10.585l3.71-3.355a.75.75 0 111.02 1.1l-4.25 3.85a.75.75 0 01-1.02 0l-4.25-3.85a.75.75 0 01.02-1.06z"
|
|
||||||
clipRule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</Listbox.Button>
|
|
||||||
<Listbox.Options className="absolute z-50 mt-1 w-full border rounded bg-white shadow max-h-60 overflow-auto text-sm">
|
|
||||||
{idsForSlot.map((entry) => (
|
|
||||||
<Listbox.Option
|
|
||||||
key={entry.id}
|
|
||||||
value={entry.id}
|
|
||||||
className={({ selected, active }) =>
|
|
||||||
`px-4 py-1 cursor-pointer whitespace-nowrap overflow-hidden text-ellipsis ${
|
|
||||||
selected
|
|
||||||
? "bg-littwin-blue text-white"
|
|
||||||
: active
|
|
||||||
? "bg-gray-200"
|
|
||||||
: ""
|
|
||||||
}`
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{new Date(entry.t).toLocaleString("de-DE", {
|
<path
|
||||||
day: "2-digit",
|
fillRule="evenodd"
|
||||||
month: "2-digit",
|
d="M5.23 7.21a.75.75 0 011.06.02L10 10.585l3.71-3.355a.75.75 0 111.02 1.1l-4.25 3.85a.75.75 0 01-1.02 0l-4.25-3.85a.75.75 0 01.02-1.06z"
|
||||||
year: "numeric",
|
clipRule="evenodd"
|
||||||
hour: "2-digit",
|
/>
|
||||||
minute: "2-digit",
|
</svg>
|
||||||
second: "2-digit",
|
</Listbox.Button>
|
||||||
})}{" "}
|
<Listbox.Options className="absolute z-50 mt-1 w-full border rounded bg-white shadow max-h-60 overflow-auto text-sm">
|
||||||
– Fehlerstelle: {entry.d} m
|
{idsForSlot.map((entry) => (
|
||||||
</Listbox.Option>
|
<Listbox.Option
|
||||||
))}
|
key={entry.id}
|
||||||
</Listbox.Options>
|
value={entry.id}
|
||||||
</div>
|
className={({ selected, active }) =>
|
||||||
</Listbox>
|
`px-4 py-1 cursor-pointer whitespace-nowrap overflow-hidden text-ellipsis ${
|
||||||
|
selected
|
||||||
|
? "bg-littwin-blue text-white"
|
||||||
|
: active
|
||||||
|
? "bg-gray-200"
|
||||||
|
: ""
|
||||||
|
}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{new Date(entry.t).toLocaleString("de-DE", {
|
||||||
|
day: "2-digit",
|
||||||
|
month: "2-digit",
|
||||||
|
year: "numeric",
|
||||||
|
hour: "2-digit",
|
||||||
|
minute: "2-digit",
|
||||||
|
second: "2-digit",
|
||||||
|
})}{" "}
|
||||||
|
– Fehlerstelle: {entry.d} m
|
||||||
|
</Listbox.Option>
|
||||||
|
))}
|
||||||
|
</Listbox.Options>
|
||||||
|
</div>
|
||||||
|
</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>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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.868",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.867",
|
"version": "1.6.868",
|
||||||
"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.868",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3000",
|
||||||
|
|||||||
Reference in New Issue
Block a user