STM32G474RB firmware for solar buck converter with MPPT, CC control, Vfly compensation, and adaptive deadtime. Includes Textual TUI debug console for real-time telemetry, parameter tuning, and SQLite logging. Added pyproject.toml for uv: `cd code64 && uv run debug-console` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
751 B
Python
29 lines
751 B
Python
"""Connection status bar."""
|
|
from textual.widgets import Static
|
|
|
|
|
|
class StatusBar(Static):
|
|
"""Bottom status bar showing connection info."""
|
|
|
|
DEFAULT_CSS = """
|
|
StatusBar {
|
|
dock: bottom;
|
|
height: 1;
|
|
background: $primary-background;
|
|
color: $text;
|
|
padding: 0 1;
|
|
}
|
|
"""
|
|
|
|
def __init__(self):
|
|
super().__init__("")
|
|
self.connected = False
|
|
self.pkt_count = 0
|
|
self.drop_count = 0
|
|
self.last_seq = 0
|
|
self.fps = 0.0
|
|
|
|
def refresh_status(self):
|
|
conn = "[green]CONN:OK[/green]" if self.connected else "[red]CONN:LOST[/red]"
|
|
self.update(f" {conn} PKTS:{self.pkt_count} DROPS:{self.drop_count} SEQ:{self.last_seq} FPS:{self.fps:.1f}")
|