Peritoneal Dialysis Capstone
Controlling catheter for peritoneal dialysis
Loading...
Searching...
No Matches
TFTDisplay Class Reference

An implementation of IDisplay for TFT color displays. More...

#include <TFTDisplay.h>

Inheritance diagram for TFTDisplay:
Collaboration diagram for TFTDisplay:

Classes

struct  Layout
 The positions of UI elements. More...

Public Member Functions

 TFTDisplay (TFTDriver &driver)
 Creates a TFT display for a specific TFT driver.
void initialize () override
 Initialize the display.
void update (float channel1Power, float channel2Power) override
 Update the display with all relevant values.
Public Member Functions inherited from IDisplay
virtual ~IDisplay ()=default

Private Member Functions

void determineLayout ()
 Pre-computes the positions of UI elements.

Private Attributes

TFTDriverm_driver
char m_text_staging [128]
Layout m_layout

Static Private Attributes

static constexpr TFTColor CLEAR_COLOR {TFTColor::Black}
 The color used for clearing the screen.
static constexpr TFTColor TEXT_COLOR {TFTColor::White}
 The default color for drawing text.

Detailed Description

An implementation of IDisplay for TFT color displays.

Constructor & Destructor Documentation

◆ TFTDisplay()

TFTDisplay::TFTDisplay ( TFTDriver & driver)
explicit

Creates a TFT display for a specific TFT driver.

Parameters
driverThe underlying driver.

Member Function Documentation

◆ determineLayout()

void TFTDisplay::determineLayout ( )
private

Pre-computes the positions of UI elements.

◆ initialize()

void TFTDisplay::initialize ( )
overridevirtual

Initialize the display.

In general, must be called before any calls to update.

Implements IDisplay.

◆ update()

void TFTDisplay::update ( float channel1Power,
float channel2Power )
overridevirtual

Update the display with all relevant values.

Parameters
channel1PowerThe output duty cycle for channel 1 (between 0 and 1)
channel2PowerThe output duty cycle for channel 2 (between 0 and 1)

Implements IDisplay.

Member Data Documentation

◆ CLEAR_COLOR

TFTColor TFTDisplay::CLEAR_COLOR {TFTColor::Black}
staticconstexprprivate

The color used for clearing the screen.

◆ m_driver

TFTDriver& TFTDisplay::m_driver
private

◆ m_layout

Layout TFTDisplay::m_layout
private

◆ m_text_staging

char TFTDisplay::m_text_staging[128]
private

◆ TEXT_COLOR

TFTColor TFTDisplay::TEXT_COLOR {TFTColor::White}
staticconstexprprivate

The default color for drawing text.


The documentation for this class was generated from the following files: