Files
planar-EL512.256-H/components/el512/trek.h
T

38 lines
1.5 KiB
C++
Raw Normal View History

// Star Trek / Lower Decks-themed animated pages for the ESPHome display: an
// LCARS ship status screen (with red alert when the 3D printer pauses), the
// Cerritos duty roster from the agenda, a warp core driven by solar power,
// and a captain's log under a viewscreen. Fan art: the pixel art
// (trek_sprites.h, from tools/trek_sprites.py), layouts and texts are original.
//
// Each function draws a whole page. Call it from a page lambda and list that
// page under animated_pages; the animation clock is the display's page_age_ms().
#pragma once
#include "el512_pages.h"
#include "esphome/components/display/display.h"
#include "esphome/core/time.h"
namespace esphome::el512 {
class EL512Display;
namespace trek {
struct Fonts {
display::BaseFont *small{nullptr}; // LCARS labels (Antonio 16)
display::BaseFont *medium{nullptr}; // LCARS headers (Antonio 26)
display::BaseFont *large{nullptr}; // LCARS big numbers (Antonio 60)
display::BaseFont *text{nullptr}; // log and roster text (Nunito 16)
display::BaseFont *pixel{nullptr}; // tiny data (Press Start 2P 8)
};
// Red alert: the 3D printer is paused or in error and needs a look.
bool red_alert(const HomeData &d);
void lcars_status(EL512Display &it, const Fonts &f, const HomeData &d, ESPTime now);
void duty_roster(EL512Display &it, const Fonts &f, const HomeData &d, ESPTime now);
void warp_core(EL512Display &it, const Fonts &f, const HomeData &d);
void captains_log(EL512Display &it, const Fonts &f, const HomeData &d, ESPTime now);
} // namespace trek
} // namespace esphome::el512