User interface (display and input) for humidistat. Hold references to ButtonReader for keypad input, and Humidistat for updating the humidity setpoint.
More...
#include <ControllerUI.h>
|
virtual void | begin ()=0 |
| Initialize the display.
|
|
void | update () |
| Update the display and handle input: set Humidistat's setpoint.
|
|
|
| ControllerUI (Print *display, const ButtonReader *buttonReader, etl::span< const ThermistorReader, 4 > trs) |
| Constructor.
|
|
void | blink (uint8_t col, uint8_t row, const char *buf) |
| Print blinking text.
|
|
void | printNTC (uint8_t col, uint8_t row, uint8_t i) |
| Print temperature read from thermistors. Handles NaN values as 0.
|
|
template<typename... T> |
void | printf (uint8_t col, uint8_t row, const char *fmt, T... args) |
| Print formatted data to display, at (col, row). Calculates lengths and creates appropriate buffer internally.
|
|
|
static void | adjustValue (double delta, double &value, uint8_t min, uint8_t max) |
| In-/de-crement a variable, while clipping it to [min, max].
|
|
|
virtual void | draw ()=0 |
| Draw main interface (main loop).
|
|
virtual void | drawSplash ()=0 |
| Draw splash screen.
|
|
virtual void | drawInfo ()=0 |
| Draw info screen.
|
|
virtual void | clear ()=0 |
| Clear screen.
|
|
virtual void | setCursor (uint8_t col, uint8_t row)=0 |
| Set cursor to coordinates.
|
|
virtual bool | handleInput (Buttons state, uint16_t pressedFor)=0 |
| Handle input.
|
|
User interface (display and input) for humidistat. Hold references to ButtonReader for keypad input, and Humidistat for updating the humidity setpoint.
Definition at line 15 of file ControllerUI.h.
◆ ControllerUI()
◆ adjustValue()
void ControllerUI::adjustValue |
( |
double | delta, |
|
|
double & | value, |
|
|
uint8_t | min, |
|
|
uint8_t | max ) |
|
staticprotected |
In-/de-crement a variable, while clipping it to [min, max].
- Parameters
-
delta | The amount by which to in-/de-crement |
value | Value to adjust |
min | Lower limit |
max | Upper limit |
Definition at line 67 of file ControllerUI.cpp.
◆ begin()
virtual void ControllerUI::begin |
( |
| ) |
|
|
pure virtual |
◆ blink()
void ControllerUI::blink |
( |
uint8_t | col, |
|
|
uint8_t | row, |
|
|
const char * | buf ) |
|
protected |
Print blinking text.
- Parameters
-
col | LCD column |
row | LCD row |
buf | Buffer of text to blink |
Definition at line 43 of file ControllerUI.cpp.
◆ clear()
virtual void ControllerUI::clear |
( |
| ) |
|
|
privatepure virtual |
◆ draw()
virtual void ControllerUI::draw |
( |
| ) |
|
|
privatepure virtual |
◆ drawInfo()
virtual void ControllerUI::drawInfo |
( |
| ) |
|
|
privatepure virtual |
◆ drawSplash()
virtual void ControllerUI::drawSplash |
( |
| ) |
|
|
privatepure virtual |
◆ handleInput()
virtual bool ControllerUI::handleInput |
( |
Buttons | state, |
|
|
uint16_t | pressedFor ) |
|
privatepure virtual |
◆ printf()
template<typename... T>
void ControllerUI::printf |
( |
uint8_t | col, |
|
|
uint8_t | row, |
|
|
const char * | fmt, |
|
|
T... | args ) |
|
inlineprotected |
Print formatted data to display, at (col, row). Calculates lengths and creates appropriate buffer internally.
- Parameters
-
col | LCD column |
row | LCD row |
fmt | Format string |
args | Arguments specifying data to print |
Definition at line 92 of file ControllerUI.h.
◆ printNTC()
void ControllerUI::printNTC |
( |
uint8_t | col, |
|
|
uint8_t | row, |
|
|
uint8_t | i ) |
|
protected |
Print temperature read from thermistors. Handles NaN values as 0.
- Parameters
-
Definition at line 58 of file ControllerUI.cpp.
◆ setCursor()
virtual void ControllerUI::setCursor |
( |
uint8_t | col, |
|
|
uint8_t | row ) |
|
privatepure virtual |
◆ update()
void ControllerUI::update |
( |
| ) |
|
◆ adjustStep
const uint8_t ControllerUI::adjustStep = config::adjustStep |
|
protected |
◆ blinkInterval
const uint16_t ControllerUI::blinkInterval = config::blinkInterval |
|
private |
◆ buttonDebounceInterval
const uint16_t ControllerUI::buttonDebounceInterval = config::buttonDebounceInterval |
|
private |
◆ buttonReader
◆ display
Print& ControllerUI::display |
|
private |
◆ infoDrawn
bool ControllerUI::infoDrawn = false |
|
private |
◆ infoDuration
const uint16_t ControllerUI::infoDuration = config::infoDuration |
|
private |
◆ inputInterval
const uint16_t ControllerUI::inputInterval = config::inputInterval |
|
private |
◆ lastPressed
unsigned long ControllerUI::lastPressed = 0 |
|
private |
Last time a keypress event occurred (in millis)
Definition at line 20 of file ControllerUI.h.
◆ lastRefreshed
unsigned long ControllerUI::lastRefreshed = 0 |
|
protected |
Last time display was updated (in millis)
Definition at line 55 of file ControllerUI.h.
◆ refreshInterval
const uint16_t ControllerUI::refreshInterval = config::refreshInterval |
|
protected |
◆ screenCleared
bool ControllerUI::screenCleared = false |
|
private |
◆ splashDrawn
bool ControllerUI::splashDrawn = false |
|
private |
◆ splashDuration
const uint16_t ControllerUI::splashDuration = config::splashDuration |
|
private |
◆ tolerance
const double ControllerUI::tolerance = config::tolerance |
|
protected |
◆ trs
The documentation for this class was generated from the following files: