Files
groundstation/internal/display/status.go
T
piotr b169a64ad5
Build Ground Station / build (push) Successful in 44s
feat: show no-WFB kiosk fallback only while video absent (#2)
2026-10-01 14:40:24 +02:00

28 lines
657 B
Go

package display
// StatusTemplate is the fallback kiosk layout: a cleared black canvas with
// status lines. It is the "no pilot video" state of a display target.
type StatusTemplate struct {
lines []string
}
// NewStatusTemplate builds a template that draws the given status lines.
func NewStatusTemplate(lines ...string) StatusTemplate {
return StatusTemplate{lines: lines}
}
func (t StatusTemplate) Draw(canvas Canvas) {
canvas.Clear()
drawLines(canvas, t.lines)
canvas.Flush()
}
func drawLines(canvas Canvas, lines []string) {
_, height := canvas.Size()
y := height / 2
for _, line := range lines {
canvas.Text(32, y, line)
y += 32
}
}