19#ifndef U8G2SH1106DISPLAY_H
20#define U8G2SH1106DISPLAY_H
25#if (OLED_CONNECTION == OLED_SPI)
36 void begin()
override;
39 void clear()
override;
61 bool selectionChanged)
override;
71 void displayThrottleScreen(
const char *locoName, uint8_t speed, Direction direction, TrackPower trackPower,
72 bool speedChanged,
bool directionChange,
bool trackPowerChanged)
override;
Interface class to abstract construction of what is displayed on screen from the physical implementat...
Definition DisplayInterface.h:29
Class to implement display on an SH1106 based OLED using the U8g2 library.
Definition U8G2SH1106Display.h:30
void _clearDisplay()
Clear the display.
Definition U8G2SH1160Display.cpp:137
const uint8_t * _throttleFont
Definition U8G2SH1106Display.h:79
uint8_t _calculateMenuItemsPerPage()
Calculates the number of menu items that will fit on screen.
Definition U8G2SH1160Display.cpp:113
void displayMenuScreen(const char *menuName, BaseMenuItem *firstMenuItem, uint8_t selectedItemIndex, bool selectionChanged) override
Display a menu.
Definition U8G2SH1160Display.cpp:73
void clear() override
Clear the display.
Definition U8G2SH1160Display.cpp:43
uint16_t _calculateMenuItemHeight()
Calculates the height of the menu item area.
Definition U8G2SH1160Display.cpp:126
U8G2 * _oled
Definition U8G2SH1106Display.h:75
uint16_t _calculateHeaderHeight()
Calculates the height of the header area.
Definition U8G2SH1160Display.cpp:120
void _displayErrorMessage(const char *errorMessage)
Display an error message with emoji.
Definition U8G2SH1160Display.cpp:255
void displayErrorScreen(const char *errorText) override
Display error screen.
Definition U8G2SH1160Display.cpp:65
uint16_t _calculateMenuFooterHeight()
Calculates the height of the footer area.
Definition U8G2SH1160Display.cpp:131
U8G2SH1106Display()
Constructor for the display object.
Definition U8G2SH1160Display.cpp:21
void _displayHeader(const char *headerText)
Display the header text with a horizontal line separator.
Definition U8G2SH1160Display.cpp:142
void _displayLocoSpeed(uint8_t speed)
Update the currenty selected loco's speed.
Definition U8G2SH1160Display.cpp:263
uint8_t _displayMenuItems(BaseMenuItem *firstMenuItem, uint8_t selectedItemIndex)
Display the list of menu items, paginated by the number that will fit on screen.
Definition U8G2SH1160Display.cpp:170
void _displayStartupInfo(const char *version)
Display the software version below the header text.
Definition U8G2SH1160Display.cpp:153
void _displayProgress(uint8_t counter)
Display progress bar.
Definition U8G2SH1160Display.cpp:242
const uint8_t * _speedFont
Definition U8G2SH1106Display.h:78
void _displayLocoDirection(Direction direction)
Update the currently selected loco's direction.
Definition U8G2SH1160Display.cpp:282
const uint8_t * _defaultFont
Definition U8G2SH1106Display.h:76
void displayThrottleScreen(const char *locoName, uint8_t speed, Direction direction, TrackPower trackPower, bool speedChanged, bool directionChange, bool trackPowerChanged) override
Display the throttle screen.
Definition U8G2SH1160Display.cpp:90
void _displayLocoName(const char *name)
Update the address of the currently selected loco.
Definition U8G2SH1160Display.cpp:303
void _displayMenuFooter()
Displays the horizontal line separator and Page # text.
Definition U8G2SH1160Display.cpp:207
void begin() override
Start the display.
Definition U8G2SH1160Display.cpp:36
void _displayPageNumber(uint8_t pageNumber)
Displays the provided page number within the menu footer.
Definition U8G2SH1160Display.cpp:225
void displayStartupScreen(const char *headerText, const char *version) override
Display the startup screen.
Definition U8G2SH1160Display.cpp:48
const uint8_t * _menuFont
Definition U8G2SH1106Display.h:77
void displayProgressScreen(const char *activity, uint8_t counter) override
Display progress screen for the specified activity.
Definition U8G2SH1160Display.cpp:56
void _displayTrackPowerState(TrackPower trackPower)
Update the current track power status.
Definition U8G2SH1160Display.cpp:312