Class for the central controller for EX-Display. All application activities are controlled through this class to manage screens, displays, and user input. All devices have their begin or init type methods called from Controller::begin().
More...
#include <Controller.h>
|
| | Controller (Stream *consoleStream, Stream *commandStationStream, DisplayManager *displayManager, InputManager *inputManager, ScreenManager *screenManager, Logger *logger, unsigned long pauseDisplayUpdatesUntil=0) |
| | Constructor for this Controller.
|
| |
| void | begin () |
| | Call once to start displays and input.
|
| |
| void | update () |
| | Processes all ongoing activities, monitoring streams, receiving user input, updates displays, etc. Call at least once per main loop iteration.
|
| |
| void | updateScreen (uint8_t screenId, uint8_t row, const char *text) override |
| | Method to implement updating a screen.
|
| |
| void | onInputAction (InputAction action) override |
| | Method to implement to respond to an input action.
|
| |
| | ~Controller () override |
| | Destructor for the Controller.
|
| |
| void | setLogger (Logger *logger) |
| | Set the logger instance to use for diagnostic logging.
|
| |
| virtual | ~CallbackInterface ()=default |
| | Virtual destructor for the CallBackInterface.
|
| |
Class for the central controller for EX-Display. All application activities are controlled through this class to manage screens, displays, and user input. All devices have their begin or init type methods called from Controller::begin().
◆ Controller()
Constructor for this Controller.
- Parameters
-
| consoleStream | Pointer to the Stream for console interactions and log output |
| commandStationStream | Pointer to the incoming Stream connected to EX-CommandStation |
| displayManager | Pointer to the DisplayManager instance |
| inputManager | Pointer to the InputManager instance |
| screenManager | Pointer to the ScreenManager instance |
| logger | Pointer to the Logger instance |
| pauseDisplayUpdatesUntil | Time in milliseconds the EX-Display version will be displayed until |
◆ ~Controller()
| Controller::~Controller |
( |
| ) |
|
|
override |
◆ _selectNextScreen()
Selects the next screen for the selected display.
- Parameters
-
◆ _selectPreviousScreen()
Selects the previous screen for the selected display.
- Parameters
-
◆ begin()
| void Controller::begin |
( |
| ) |
|
Call once to start displays and input.
◆ onInputAction()
Method to implement to respond to an input action.
- Parameters
-
| action | PRESS_UP, PRESS_DOWN, PRESS_LEFT, PRESS_RIGHT, PRESS_CENTRE |
Implements CallbackInterface.
◆ update()
| void Controller::update |
( |
| ) |
|
Processes all ongoing activities, monitoring streams, receiving user input, updates displays, etc. Call at least once per main loop iteration.
◆ updateScreen()
| void Controller::updateScreen |
( |
uint8_t |
screenId, |
|
|
uint8_t |
row, |
|
|
const char * |
text |
|
) |
| |
|
overridevirtual |
Method to implement updating a screen.
- Parameters
-
| screenId | ID of the screen to update |
| row | Row number to update |
| text | Text to update |
Implements CallbackInterface.
◆ _commandStationStream
| Stream* Controller::_commandStationStream |
|
private |
◆ _consoleStream
| Stream* Controller::_consoleStream |
|
private |
◆ _displayManager
◆ _inputManager
◆ _pauseDisplayUpdates
| bool Controller::_pauseDisplayUpdates |
|
private |
◆ _pauseDisplayUpdatesUntil
| unsigned long Controller::_pauseDisplayUpdatesUntil |
|
private |
◆ _screenManager
The documentation for this class was generated from the following files: