Events Prograssbar in Prozent

This commit is contained in:
ISA
2025-08-13 14:15:51 +02:00
parent 8fcbf6cfcd
commit 5496254acb
7 changed files with 20 additions and 25 deletions

View File

@@ -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.708 NEXT_PUBLIC_APP_VERSION=1.6.709
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)

View File

@@ -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.708 NEXT_PUBLIC_APP_VERSION=1.6.709
NEXT_PUBLIC_CPL_MODE=production NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.709] 2025-08-13
- Progressbar mit Prozent und Zeit
---
## [1.6.708] 2025-08-13 ## [1.6.708] 2025-08-13
- feat: Slot Nummer anzeigen bei Events - feat: Slot Nummer anzeigen bei Events

View File

@@ -35,13 +35,6 @@ export default function GlobalActivityOverlay() {
const clamp = (v: number, min = 0, max = 1) => const clamp = (v: number, min = 0, max = 1) =>
Math.max(min, Math.min(max, v)); Math.max(min, Math.min(max, v));
const formatEta = (ms: number) => {
if (ms <= 0) return "gleich fertig";
const totalSec = Math.ceil(ms / 1000);
const m = Math.floor(totalSec / 60);
const s = totalSec % 60;
return m > 0 ? `${m}:${s.toString().padStart(2, "0")} min` : `${s} s`;
};
const compute = (startedAt: number | null, durationMs: number) => { const compute = (startedAt: number | null, durationMs: number) => {
if (!startedAt) return { pct: 0, remaining: durationMs }; if (!startedAt) return { pct: 0, remaining: durationMs };
@@ -67,7 +60,7 @@ export default function GlobalActivityOverlay() {
Schleifenmessung läuft (: {fmt(ksx)}) Schleifenmessung läuft (: {fmt(ksx)})
</div> </div>
{(() => { {(() => {
const { pct, remaining } = compute(loopStartedAt, LOOP_MS); const { pct } = compute(loopStartedAt, LOOP_MS);
return ( return (
<div> <div>
<div className="h-2 w-full bg-gray-200 rounded overflow-hidden"> <div className="h-2 w-full bg-gray-200 rounded overflow-hidden">
@@ -77,7 +70,7 @@ export default function GlobalActivityOverlay() {
/> />
</div> </div>
<div className="text-xs text-gray-600 mt-1"> <div className="text-xs text-gray-600 mt-1">
{Math.round(pct)}% · ~{formatEta(remaining)} {Math.round(pct)}%
</div> </div>
</div> </div>
); );
@@ -91,17 +84,17 @@ export default function GlobalActivityOverlay() {
TDR-Messung läuft (: {fmt(ksy)}) TDR-Messung läuft (: {fmt(ksy)})
</div> </div>
{(() => { {(() => {
const { pct, remaining } = compute(tdrStartedAt, TDR_MS); const { pct } = compute(tdrStartedAt, TDR_MS);
return ( return (
<div> <div>
<div className="h-2 w-full bg-gray-200 rounded overflow-hidden"> <div className="h-2 w-full bg-gray-200 rounded overflow-hidden">
<div <div
className="h-full bg-yellow-500 transition-all" className="h-full bg-littwin-blue transition-all"
style={{ width: `${pct}%` }} style={{ width: `${pct}%` }}
/> />
</div> </div>
<div className="text-xs text-gray-600 mt-1"> <div className="text-xs text-gray-600 mt-1">
{Math.round(pct)}% · ~{formatEta(remaining)} {Math.round(pct)}%
</div> </div>
</div> </div>
); );
@@ -115,20 +108,17 @@ export default function GlobalActivityOverlay() {
Abgleich läuft (: {fmt(ksz)}) Abgleich läuft (: {fmt(ksz)})
</div> </div>
{(() => { {(() => {
const { pct, remaining } = compute( const { pct } = compute(alignmentStartedAt, ALIGN_MS);
alignmentStartedAt,
ALIGN_MS
);
return ( return (
<div> <div>
<div className="h-2 w-full bg-gray-200 rounded overflow-hidden"> <div className="h-2 w-full bg-gray-200 rounded overflow-hidden">
<div <div
className="h-full bg-emerald-500 transition-all" className="h-full bg-littwin-blue transition-all"
style={{ width: `${pct}%` }} style={{ width: `${pct}%` }}
/> />
</div> </div>
<div className="text-xs text-gray-600 mt-1"> <div className="text-xs text-gray-600 mt-1">
{Math.round(pct)}% · ~{formatEta(remaining)} {Math.round(pct)}%
</div> </div>
</div> </div>
); );

View File

@@ -260,7 +260,7 @@ var win_fallSensors = [
// Event Schleifenmessung KSX // Event Schleifenmessung KSX
var loopMeasurementEvent = [ var loopMeasurementEvent = [
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, 0, 0,
]; ];
//Event TDR-Messung //Event TDR-Messung
@@ -270,6 +270,6 @@ var tdrMeasurementEvent = [
]; ];
//Event Abgleich //Event Abgleich
var alignmentEvent = [ var alignmentEvent = [
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, 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,
]; ];

4
package-lock.json generated
View File

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

View File

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