Commit Graph

5 Commits

Author SHA1 Message Date
MaPaLo76
e273f1ea6c feat(display): showSessionRing - Sekunden-Kreisanzeige auf Modulen 5-7, 12-Uhr-Start (Phase 5b / 5.7 abgeschlossen) 2026-02-23 20:19:33 +01:00
MaPaLo76
e98002db7b refactor(laser,web): getSessionMinutes->getAllSessionsSumMinutes, Platzhalter SESSION->ALLSESSIONS, BURST->LASTSESSION 2026-02-23 19:50:47 +01:00
MaPaLo76
d5d0085d93 docs(readme): README auf Phase-5-Stand aktualisiert, Tests-Sektion ergaenzt 2026-02-22 19:14:15 +01:00
MaPaLo76
d114a58de6 fix(phase5): LaserTracker neu - Session/Burst-Logik korrigiert
- BurstState-Maschine: INACTIVE -> GRATIS -> NET_COUNTING
- _sessionNetSec (RAM): Netto-Sekunden der Betriebssitzung, reset beim Start
- _totalMinutesBase (NVS via settings.saveTotalMinutes): persistierte Gesamtzeit
- Gratis-Countdown startet bei JEDEM Laser-AN-Ereignis neu
- Netto-Zeit wird erst nach Ablauf der Gratiszeit gezaehlt
- getSessionMinutes(): sessionNetSec / 60 (ganzzahlig, hart)
- getCountdownRemaining(): nur 0 wenn INACTIVE oder NET_COUNTING
- Display Module 1-3: Session-Minuten (nicht Gesamtzeit)
- Display Module 5-7: Countdown waehrend GRATIS, sonst Idle
- settings.saveTotalMinutes() statt direkter Preferences-Calls
- main.cpp + test_laser_tracker.cpp auf neue API umgestellt
2026-02-22 18:48:35 +01:00
MaPaLo76
3827342c0c feat(laser): implement LaserTracker with debounce, gratis time and NVS save
- Add include/laser_tracker.h: LaserTracker class declaration
  - Software debounce (LASER_DEBOUNCE_MS = 50ms from config.h)
  - Polarity-aware GPIO read (LOW_ACTIVE / HIGH_ACTIVE from settings)
  - Session lifecycle: onSessionStart / onSessionEnd
  - Gratis time countdown, net seconds accumulation
  - Getters: isActive, getTotalMinutes, getSessionSeconds,
    getCountdownRemaining, getLastSessionSeconds, resetTotal

- Add src/laser_tracker.cpp: full implementation
  - readRaw() applies signal polarity
  - loop() handles debounce state machine and edge detection
  - onSessionEnd() saves updated totalMinutes to NVS
  - getTotalMinutes() returns live value (base + current net session)

- Add test_sketches/test_laser_tracker.cpp: interactive test sketch
  - Button on GPIO 4 simulates laser signal
  - BOOT button (GPIO 0, 3s hold) resets total
  - Display: modules 1-3 = total minutes, modules 5-7 = countdown/net

- Add test-laser-tracker env to platformio.ini
- Update src/main.cpp: integrate laserTracker.begin/loop + live display
- Update Implementation-Plan.md: mark Phase 5 tasks 5.1-5.6 complete
2026-02-22 14:30:14 +01:00