refactor(display): extract dashboard tile grid logic to DisplayManager
This commit is contained in:
@@ -7,6 +7,31 @@ enum class ScreenID { BOOT, OFF, ALERT, DASHBOARD };
|
||||
|
||||
enum class BootStage { SPLASH, INIT_DISPLAY, INIT_NETWORK, CONNECTING_WIFI, READY, DONE };
|
||||
|
||||
/// Dashboard tile action handlers
|
||||
enum class TileAction {
|
||||
NONE,
|
||||
ALERT, // Trigger alert
|
||||
SILENCE, // Silence alert
|
||||
STATUS, // Send heartbeat/status
|
||||
REBOOT, // Reboot device
|
||||
};
|
||||
|
||||
/// Dashboard tile definitions — shared across all boards
|
||||
struct DashboardTile {
|
||||
const char* label;
|
||||
uint16_t bgColor; // RGB565
|
||||
TileAction action;
|
||||
};
|
||||
|
||||
/// Standard dashboard tiles (auto-gridded based on count)
|
||||
static constexpr DashboardTile DASHBOARD_TILES[] = {
|
||||
{ "Alert", 0x0280, TileAction::ALERT },
|
||||
{ "Silent", 0x0400, TileAction::SILENCE },
|
||||
{ "Status", 0x0440, TileAction::STATUS },
|
||||
{ "Reboot", 0x0100, TileAction::REBOOT },
|
||||
};
|
||||
static constexpr int DASHBOARD_TILE_COUNT = sizeof(DASHBOARD_TILES) / sizeof(DASHBOARD_TILES[0]);
|
||||
|
||||
struct ScreenState {
|
||||
DeviceState deviceState = DeviceState::BOOTED;
|
||||
ScreenID screen = ScreenID::BOOT;
|
||||
|
||||
Reference in New Issue
Block a user