Interface class to abstract construction of what is displayed on screen from the physical implementations All physical display classes must extend this This allows for different display types and resolutions to be used.
More...
#include <DisplayInterface.h>
|
virtual void | begin ()=0 |
| Implement this to perform any initial startup methods or activities.
|
|
virtual void | clear ()=0 |
| Implement this to entirely clear a display.
|
|
virtual void | displayStartupScreen (const char *headerText, const char *version)=0 |
| Display the startup screen.
|
|
virtual void | displayProgressScreen (const char *activity, uint8_t counter)=0 |
| Display progress screen for the specified activity.
|
|
virtual void | displayErrorScreen (const char *errorText)=0 |
| Display error screen.
|
|
virtual void | displayMenuScreen (const char *menuName, BaseMenuItem *firstMenuItem, uint8_t selectedItemIndex, bool selectionChanged)=0 |
| Display a menu.
|
|
virtual void | displayThrottleScreen (const char *locoName, uint8_t speed, Direction direction, TrackPower trackPower, bool speedChanged, bool directionChange, bool trackPowerChanged)=0 |
| Display the throttle screen.
|
|
bool | needsRedraw () |
| Check if the display needs to be redrawn to prevent unnecessary redraws and flicker.
|
|
void | setNeedsRedraw (bool redraw) |
| Set the redraw flag for this display.
|
|
bool | needsMenuRefresh () |
| Check if the menu needs refreshing - avoids a complete redraw for menu screens.
|
|
void | setNeedsMenuRefresh (bool refresh) |
| Set the refresh menu flag for this display.
|
|
uint8_t | getMenuItemsPerPage () |
| Get the number of menu items to be displayed per page for this display.
|
|
void | setMenuItemsPerPage (uint8_t menuItemsPerPage) |
| Set the number of menu items per page this display can handle.
|
|
virtual | ~DisplayInterface ()=default |
| Destructor for the object.
|
|
Interface class to abstract construction of what is displayed on screen from the physical implementations All physical display classes must extend this This allows for different display types and resolutions to be used.
◆ ~DisplayInterface()
virtual DisplayInterface::~DisplayInterface |
( |
| ) |
|
|
virtualdefault |
Destructor for the object.
◆ begin()
virtual void DisplayInterface::begin |
( |
| ) |
|
|
pure virtual |
Implement this to perform any initial startup methods or activities.
Implemented in U8G2SH1106Display.
◆ clear()
virtual void DisplayInterface::clear |
( |
| ) |
|
|
pure virtual |
◆ displayErrorScreen()
virtual void DisplayInterface::displayErrorScreen |
( |
const char * |
errorText | ) |
|
|
pure virtual |
Display error screen.
- Parameters
-
errorText | Error text to display |
Implemented in U8G2SH1106Display.
◆ displayMenuScreen()
virtual void DisplayInterface::displayMenuScreen |
( |
const char * |
menuName, |
|
|
BaseMenuItem * |
firstMenuItem, |
|
|
uint8_t |
selectedItemIndex, |
|
|
bool |
selectionChanged |
|
) |
| |
|
pure virtual |
Display a menu.
- Parameters
-
menuName | Name of the menu being displayed |
firstMenuItem | Pointer to the first menu item in the list of items |
selectedItemIndex | Index of the currently selected item to be highlighted |
selectionChanged | Flag if the user has changed the selection |
Implemented in U8G2SH1106Display.
◆ displayProgressScreen()
virtual void DisplayInterface::displayProgressScreen |
( |
const char * |
activity, |
|
|
uint8_t |
counter |
|
) |
| |
|
pure virtual |
Display progress screen for the specified activity.
- Parameters
-
activity | Text of the activity in progress |
counter | Counter of the current attempt |
Implemented in U8G2SH1106Display.
◆ displayStartupScreen()
virtual void DisplayInterface::displayStartupScreen |
( |
const char * |
headerText, |
|
|
const char * |
version |
|
) |
| |
|
pure virtual |
Display the startup screen.
- Parameters
-
headerText | Header text to display |
version | Software version to display |
Implemented in U8G2SH1106Display.
◆ displayThrottleScreen()
virtual void DisplayInterface::displayThrottleScreen |
( |
const char * |
locoName, |
|
|
uint8_t |
speed, |
|
|
Direction |
direction, |
|
|
TrackPower |
trackPower, |
|
|
bool |
speedChanged, |
|
|
bool |
directionChange, |
|
|
bool |
trackPowerChanged |
|
) |
| |
|
pure virtual |
Display the throttle screen.
- Parameters
-
locoName | Name of the loco currently being operated |
speed | Current speed of the loco |
direction | Current direction of the loco |
trackPower | Current track power state |
speedChanged | Flag if the speed has changed |
directionChange | Flag if the direction has changed |
trackPowerChanged | Flag if the track power state has changed |
Implemented in U8G2SH1106Display.
◆ getMenuItemsPerPage()
uint8_t DisplayInterface::getMenuItemsPerPage |
( |
| ) |
|
|
inline |
Get the number of menu items to be displayed per page for this display.
- Returns
- Number of items per page this display can handle
◆ needsMenuRefresh()
bool DisplayInterface::needsMenuRefresh |
( |
| ) |
|
|
inline |
Check if the menu needs refreshing - avoids a complete redraw for menu screens.
- Returns
- True|False
◆ needsRedraw()
bool DisplayInterface::needsRedraw |
( |
| ) |
|
|
inline |
Check if the display needs to be redrawn to prevent unnecessary redraws and flicker.
- Returns
- True|False
◆ setMenuItemsPerPage()
void DisplayInterface::setMenuItemsPerPage |
( |
uint8_t |
menuItemsPerPage | ) |
|
|
inline |
Set the number of menu items per page this display can handle.
- Parameters
-
menuItemsPerPage | Items per page |
◆ setNeedsMenuRefresh()
void DisplayInterface::setNeedsMenuRefresh |
( |
bool |
refresh | ) |
|
|
inline |
Set the refresh menu flag for this display.
- Parameters
-
◆ setNeedsRedraw()
void DisplayInterface::setNeedsRedraw |
( |
bool |
redraw | ) |
|
|
inline |
Set the redraw flag for this display.
- Parameters
-
◆ _menuItemsPerPage
uint8_t DisplayInterface::_menuItemsPerPage = 0 |
|
private |
◆ _needsMenuRefresh
bool DisplayInterface::_needsMenuRefresh = false |
|
private |
◆ _needsRedraw
bool DisplayInterface::_needsRedraw = false |
|
private |
The documentation for this class was generated from the following file: