SatCat5
satcat5::gui::FileDisplay Class Reference

Detailed Description

Implement the gui::Display API using a temporary file.

The FileDisplay class writes "pixels" as an 80x40 grid of characters in a plaintext file. The foreground and background "color" are the ASCII character to be filled, usualy '*' and ' '.

The scroll() method is not supported. Buffering is not required.

This class is not particularly useful, except for unit testing and for serving as a simple working example.

Definition at line 24 of file file_display.h.

#include <file_display.h>

Inheritance diagram for satcat5::gui::FileDisplay:
[legend]
Collaboration diagram for satcat5::gui::FileDisplay:
[legend]

Public Member Functions

 FileDisplay (const char *filename, u16 rows=40, u16 cols=80)
 Create a "display" using the specified file.
 
virtual bool scroll (s16 rows)
 Optional: Advance the predefined viewport by N pixels. More...
 
u16 height () const
 Total size of the display, in pixels.
 
u16 width () const
 Total size of the display, in pixels.
 

Static Public Attributes

static constexpr LogColors LOG_COLORS
 "Color" parameters for this display are actually characters. More...
 

Protected Member Functions

bool draw (const satcat5::gui::Cursor &cursor, const satcat5::gui::DrawCmd &cmd) override
 Implement the required draw() method.
 

Protected Attributes

FILE * m_file
 
const u16 m_height
 Total size of the display, in pixels. More...
 
const u16 m_width
 

Member Function Documentation

◆ scroll()

virtual bool satcat5::gui::Display::scroll ( s16  rows)
inlinevirtualinherited

Optional: Advance the predefined viewport by N pixels.

Positive values scroll down, wrapping upper rows to the bottom of viewport. Negative values scroll up. Child class MAY implement this method if applicable. Returns false if the command should be repeated.

Reimplemented in satcat5::device::spi::Ili9341.

Definition at line 119 of file gui_display.h.

Member Data Documentation

◆ LOG_COLORS

constexpr satcat5::gui::LogColors FileDisplay::LOG_COLORS
staticconstexpr
Initial value:
=
{' ', '*', ' ', 'E', ' ', 'W', ' ', 'I', ' ', 'D'}

"Color" parameters for this display are actually characters.

Recommended set for use with the LogToDisplay class:

Definition at line 33 of file file_display.h.

◆ m_height

const u16 satcat5::gui::Display::m_height
protectedinherited

Total size of the display, in pixels.

The child must set these parameters in the constructor.

Definition at line 135 of file gui_display.h.


The documentation for this class was generated from the following files: