Files
Flipdot-display/src/esp32/display/frames.h
T
mangavalkandClaude Opus 5.5 fc6fa1a180 Add scrolling, countdown, stopwatch, images, seconds, multiplier and degree sign
- Text elements can scroll in a window at a set speed; clock, countdown and
  stopwatch can show seconds. Moving pages are sent as instant frames (new
  Nano command D1) and paced by the estimated flip time.
- Countdown to a date and time (smart, days, days + time, with seconds),
  stopwatch (web UI, HA switch and reset button), image element (fixed or
  by Home Assistant state), multiplier for HA values, degree sign (char 127)
  in all fonts and the font converter.
- Page format version 2; version 1 pages are converted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:01:14 +02:00

49 lines
1.7 KiB
C++

#pragma once
#include "BROSE9323.h"
#include "logic/bitmap_format.h"
#include "logic/display_controller.h"
#include "logic/page_render.h"
#include "logic/settings.h"
// Draws the screens on the flipdot display. Each method sends one complete frame.
class FlipdotFrames : public Frames
{
public:
FlipdotFrames(BROSE9323 &display, PageResources &resources);
// The page set with setDynamicPage(), drawn for this time. Not sent when it looks the
// same as the last frame (unless redraw). Moving pages are sent without the refresh
// effect, and not faster than the Nano can flip the dots.
uint32_t dynamicPage(const LocalTime &time, uint32_t now, bool redraw) override;
// "No WiFi" with the time below it
void noWifi(int hour, int minute) override;
// The bitmap set with setPageBitmap()
void page() override;
// The image set with setLiveBitmap()
void live() override;
// Blank, or the bitmap set with setOffBitmap()
void off() override;
void setDynamicPage(const DynamicPage &page);
// How the Nano flips the dots: for the time a frame takes
void setDrive(uint16_t flip_time, const DriveSettings &drive);
void setPageBitmap(const uint8_t *bitmap);
void setLiveBitmap(const uint8_t *bitmap);
// nullptr: blank
void setOffBitmap(const uint8_t *bitmap);
private:
BROSE9323 &_display;
PageResources &_resources;
DynamicPage _dynamic;
uint8_t _last_dynamic[BITMAP_BYTES] = {};
uint32_t _dot_us = 1000; // per changed dot: pulses x (flip time + gap)
uint8_t _page[BITMAP_BYTES] = {};
uint8_t _live[BITMAP_BYTES] = {};
uint8_t _off[BITMAP_BYTES] = {}; // all zero: blank
void _drawFullScreen(const uint8_t *bitmap, bool instant = false);
uint32_t _flipMs(const uint8_t *bitmap, bool all) const;
};