DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DisplayInterface Class Referenceabstract

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>

Inheritance diagram for DisplayInterface:
Inheritance graph
[legend]

Public Member Functions

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.
 

Private Attributes

bool _needsRedraw = false
 
bool _needsMenuRefresh = false
 
uint8_t _menuItemsPerPage = 0
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~DisplayInterface()

virtual DisplayInterface::~DisplayInterface ( )
virtualdefault

Destructor for the object.

Member Function Documentation

◆ begin()

virtual void DisplayInterface::begin ( )
pure virtual

Implement this to perform any initial startup methods or activities.

Implemented in U8G2SH1106Display.

Here is the caller graph for this function:

◆ clear()

virtual void DisplayInterface::clear ( )
pure virtual

Implement this to entirely clear a display.

Implemented in U8G2SH1106Display.

◆ displayErrorScreen()

virtual void DisplayInterface::displayErrorScreen ( const char *  errorText)
pure virtual

Display error screen.

Parameters
errorTextError text to display

Implemented in U8G2SH1106Display.

Here is the caller graph for this function:

◆ displayMenuScreen()

virtual void DisplayInterface::displayMenuScreen ( const char *  menuName,
BaseMenuItem firstMenuItem,
uint8_t  selectedItemIndex,
bool  selectionChanged 
)
pure virtual

Display a menu.

Parameters
menuNameName of the menu being displayed
firstMenuItemPointer to the first menu item in the list of items
selectedItemIndexIndex of the currently selected item to be highlighted
selectionChangedFlag if the user has changed the selection

Implemented in U8G2SH1106Display.

Here is the caller graph for this function:

◆ displayProgressScreen()

virtual void DisplayInterface::displayProgressScreen ( const char *  activity,
uint8_t  counter 
)
pure virtual

Display progress screen for the specified activity.

Parameters
activityText of the activity in progress
counterCounter of the current attempt

Implemented in U8G2SH1106Display.

Here is the caller graph for this function:

◆ displayStartupScreen()

virtual void DisplayInterface::displayStartupScreen ( const char *  headerText,
const char *  version 
)
pure virtual

Display the startup screen.

Parameters
headerTextHeader text to display
versionSoftware version to display

Implemented in U8G2SH1106Display.

Here is the caller graph for this function:

◆ 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
locoNameName of the loco currently being operated
speedCurrent speed of the loco
directionCurrent direction of the loco
trackPowerCurrent track power state
speedChangedFlag if the speed has changed
directionChangeFlag if the direction has changed
trackPowerChangedFlag if the track power state has changed

Implemented in U8G2SH1106Display.

Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

◆ needsMenuRefresh()

bool DisplayInterface::needsMenuRefresh ( )
inline

Check if the menu needs refreshing - avoids a complete redraw for menu screens.

Returns
True|False
Here is the caller graph for this function:

◆ needsRedraw()

bool DisplayInterface::needsRedraw ( )
inline

Check if the display needs to be redrawn to prevent unnecessary redraws and flicker.

Returns
True|False
Here is the caller graph for this function:

◆ setMenuItemsPerPage()

void DisplayInterface::setMenuItemsPerPage ( uint8_t  menuItemsPerPage)
inline

Set the number of menu items per page this display can handle.

Parameters
menuItemsPerPageItems per page
Here is the caller graph for this function:

◆ setNeedsMenuRefresh()

void DisplayInterface::setNeedsMenuRefresh ( bool  refresh)
inline

Set the refresh menu flag for this display.

Parameters
refreshTrue|False
Here is the caller graph for this function:

◆ setNeedsRedraw()

void DisplayInterface::setNeedsRedraw ( bool  redraw)
inline

Set the redraw flag for this display.

Parameters
redrawTrue|False
Here is the caller graph for this function:

Member Data Documentation

◆ _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: