HomeWaterLeaksDetection
|
#include <LCDController.h>
Public Member Functions | |
void | update () override |
Updates the state of the class. More... | |
void | addItem (IDisplayable *item) |
Adds another source of data for the LCD display (another class) More... | |
Static Public Member Functions | |
static LCDController * | getInstance () |
Returns the instance of the class. More... | |
Private Member Functions | |
LCDController () | |
Constructor of the class. More... | |
LCDController (LCDController const &) | |
Copy constructor of the class. More... | |
LCDController & | operator= (LCDController const &) |
Assignment operator of the class. More... | |
Private Attributes | |
LiquidCrystal_I2C | lcd = {0x27, 20, 4} |
0x27 - address of the [20x4] LCD on I2C More... | |
std::vector< IDisplayable * > | items |
collection of classes implementing the interface IDisplayable More... | |
TimePeriod | delay = SEC_TO_MILLIS(3) |
delay between displaying two pages More... | |
int | index |
index of the current page More... | |
Static Private Attributes | |
static LCDController * | instance = NULL |
the instance of the class More... | |
This class works as a controller for the LCD display. It holds a collection of classes capable of displaying information on the display. Each class gets repeatedly to display its content for a period of 3s.
Definition at line 32 of file LCDController.h.
|
private |
Constructor of the class.
Definition at line 5 of file LCDController.cpp.
Referenced by getInstance().
|
inlineprivate |
void LCDController::addItem | ( | IDisplayable * | item | ) |
Adds another source of data for the LCD display (another class)
item | class to be added as another page |
Definition at line 16 of file LCDController.cpp.
References items.
Referenced by setup().
|
static |
Returns the instance of the class.
If the instance has not been created, it will create it and then return it.
Definition at line 10 of file LCDController.cpp.
References instance, and LCDController().
Referenced by setup().
|
inlineprivate |
Assignment operator of the class.
Definition at line 54 of file LCDController.h.
|
overridevirtual |
Updates the state of the class.
If the period of 3s has passed, it will display the content of the next page.
Implements IControllable.
Definition at line 20 of file LCDController.cpp.
References delay, index, TimePeriod::isActive(), items, lcd, and LCD_ROWS.
|
private |
delay between displaying two pages
Definition at line 42 of file LCDController.h.
Referenced by update().
|
private |
index of the current page
Definition at line 43 of file LCDController.h.
Referenced by LCDController(), and update().
|
staticprivate |
the instance of the class
Definition at line 39 of file LCDController.h.
Referenced by getInstance().
|
private |
collection of classes implementing the interface IDisplayable
Definition at line 41 of file LCDController.h.
|
private |
0x27 - address of the [20x4] LCD on I2C
Definition at line 40 of file LCDController.h.
Referenced by LCDController(), and update().