diff --git a/CHANGELOG.de.md b/CHANGELOG.de.md index b6e3f20..d551484 100644 --- a/CHANGELOG.de.md +++ b/CHANGELOG.de.md @@ -1,5 +1,17 @@ # Changelog +## [0.9.6] – 2026-05-02 + +### Neu +- **Fortschritts-Karte:** Verstrichen / Slicer-Schätzung / Restzeit als Mini-Cards (gleicher Stil wie Temperaturkarten) +- **Layer-Mini-Card:** Layerzahl als Mini-Card neben der Fortschrittsleiste + +### Fixes +- **Slicer-Schätzzeit:** OrcaSlicer schreibt die geschätzte Zeit ans Ende der GCode-Datei — Bridge liest jetzt auch die letzten 64 KB (vorher nur die ersten 16 KB) +- **start.sh:** `config/`-Verzeichnis wird jetzt automatisch erstellt und `config.ini.example` wird beim ersten Start hineinkopiert (Issue #15) + +--- + ## [0.9.5] – 2026-05-01 ### Neu diff --git a/CHANGELOG.md b/CHANGELOG.md index 11384df..4fbf4a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.9.6] – 2026-05-02 + +### New +- **Progress card:** Elapsed / Slicer estimate / Remaining time shown as mini-cards (same style as temperature cards) +- **Layer mini-card:** Layer count displayed as mini-card next to the progress bar + +### Fixes +- **Slicer estimate time:** OrcaSlicer writes the estimated time at the end of the GCode file — bridge now also scans the last 64 KB (previously only the first 16 KB were checked) +- **start.sh:** `config/` directory is now created automatically and `config.ini.example` is copied into it on first run (Issue #15) + +--- + ## [0.9.5] – 2026-05-01 ### New diff --git a/README.de.md b/README.de.md index 5a47981..9d50d3c 100644 --- a/README.de.md +++ b/README.de.md @@ -2,7 +2,7 @@ # KX-Bridge – Anycubic Kobra X -**Version:** 0.9.5 +**Version:** 0.9.6 Steuere deinen **Anycubic Kobra X** mit OrcaSlicer — ohne Klipper, ohne Raspberry Pi. KX-Bridge ist eine Moonraker-kompatible Bridge die direkt mit dem Drucker kommuniziert. diff --git a/README.md b/README.md index f387789..32d3386 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # KX-Bridge – Anycubic Kobra X -**Version:** 0.9.5 +**Version:** 0.9.6 Control your **Anycubic Kobra X** with OrcaSlicer — no Klipper, no Raspberry Pi. KX-Bridge is a Moonraker-compatible bridge that communicates directly with the printer. diff --git a/VERSION b/VERSION index b0bb878..85b7c69 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.5 +0.9.6 diff --git a/kobrax_moonraker_bridge.py b/kobrax_moonraker_bridge.py index 55175c2..0f1442c 100644 --- a/kobrax_moonraker_bridge.py +++ b/kobrax_moonraker_bridge.py @@ -108,11 +108,17 @@ KLIPPER_VERSION = "v0.12.0-1" def _parse_gcode_estimated_time(data: bytes) -> int: - """Liest '; estimated printing time (normal mode) = Xh Ym Zs' aus GCode-Header. - Gibt Sekunden zurück, 0 wenn nicht gefunden. Sucht nur in den ersten 8KB.""" + """Liest geschätzte Druckzeit aus GCode (OrcaSlicer + PrusaSlicer). + Gibt Sekunden zurück, 0 wenn nicht gefunden. + PrusaSlicer schreibt die Zeit ins Header (erste 16KB), + OrcaSlicer schreibt sie ans Ende der Datei (letzte 16KB).""" import re - header = data[:8192].decode("utf-8", errors="ignore") - m = re.search(r";\s*estimated printing time \(normal mode\)\s*=\s*(.*)", header) + # Anfang + Ende der Datei durchsuchen (OrcaSlicer schreibt Zeit am Ende) + search_text = (data[:16384] + data[-65536:]).decode("utf-8", errors="ignore") + # OrcaSlicer: ; total estimated time: 9m 20s + # PrusaSlicer: ; estimated printing time (normal mode) = 1h 9m 20s + m = (re.search(r";\s*total estimated time:\s*(.*)", search_text) or + re.search(r";\s*estimated printing time \(normal mode\)\s*=\s*(.*)", search_text)) if not m: return 0 parts = re.findall(r"(\d+)\s*([hms])", m.group(1)) @@ -121,6 +127,8 @@ def _parse_gcode_estimated_time(data: bytes) -> int: if unit == "h": secs += int(val) * 3600 elif unit == "m": secs += int(val) * 60 elif unit == "s": secs += int(val) + if secs: + log.info(f"Slicer-Schätzzeit: {secs}s ({m.group(1).strip()})") return secs @@ -869,6 +877,11 @@ main{flex:1;overflow-y:auto;padding:20px} .spd-bar{height:4px;border-radius:2px;background:var(--border);margin-top:10px;overflow:hidden} .spd-bar-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,var(--accent2),var(--accent));transition:width .3s} +/* ── TIME CARDS ── */ +.time-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:8px} +.time-block{background:var(--raised);border-radius:10px;padding:10px 12px} +.time-label{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--txt2);margin-bottom:4px} +.time-val{font-size:20px;font-weight:700;font-family:var(--mono);color:var(--txt)} /* ── TEMPS ── */ .temp-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px} .temp-card-inner{display:grid;grid-template-columns:1fr 1fr;gap:12px} @@ -1202,14 +1215,26 @@ nav.bottom-nav{display:none;position:fixed;bottom:0;left:0;right:0;