Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::ScreenManager Class Reference

UI Thread: Manages multiple view trees ("Screen") and draws the active one at the provided refresh rate. More...

#include <ScreenManager.h>

Inheritance diagram for Boardcore::ScreenManager:
Collaboration diagram for Boardcore::ScreenManager:

Public Member Functions

 ScreenManager (mxgui::DisplayManager &display, unsigned int refreshRate)
 
void showScreen (uint8_t id)
 
uint8_t getScreen ()
 
void addScreen (uint8_t id, View *root)
 
void onButtonEvent (ButtonEvent press)
 
mxgui::DrawingContext & getDrawingContext ()
 
- Public Member Functions inherited from Boardcore::ActiveObject
 ActiveObject (unsigned int stacksize=miosix::STACK_DEFAULT_FOR_PTHREAD, miosix::Priority priority=miosix::MAIN_PRIORITY)
 
virtual ~ActiveObject ()
 
virtual bool start ()
 Start the thread associated with this active object.
 
virtual void stop ()
 Signals the runner thread to terminate and joins the thread.
 
bool isRunning ()
 

Protected Member Functions

void run () override
 
- Protected Member Functions inherited from Boardcore::ActiveObject
bool shouldStop ()
 Tells whether or not the ActiveObject should stop its execution.
 

Additional Inherited Members

- Protected Attributes inherited from Boardcore::ActiveObject
miosix::Thread * thread = nullptr
 Gives access to the thread object.
 
std::atomic< bool > stopFlag {false}
 
std::atomic< bool > running {false}
 

Detailed Description

UI Thread: Manages multiple view trees ("Screen") and draws the active one at the provided refresh rate.

Definition at line 41 of file ScreenManager.h.

Constructor & Destructor Documentation

◆ ScreenManager()

Boardcore::ScreenManager::ScreenManager ( mxgui::DisplayManager & display,
unsigned int refreshRate )
inline

Definition at line 44 of file ScreenManager.h.

Member Function Documentation

◆ addScreen()

void Boardcore::ScreenManager::addScreen ( uint8_t id,
View * root )
inline

Definition at line 57 of file ScreenManager.h.

◆ getDrawingContext()

mxgui::DrawingContext & Boardcore::ScreenManager::getDrawingContext ( )
inline

Definition at line 69 of file ScreenManager.h.

◆ getScreen()

uint8_t Boardcore::ScreenManager::getScreen ( )
inline

Definition at line 55 of file ScreenManager.h.

◆ onButtonEvent()

void Boardcore::ScreenManager::onButtonEvent ( ButtonEvent press)
inline

Definition at line 67 of file ScreenManager.h.

◆ run()

void Boardcore::ScreenManager::run ( )
inlineoverrideprotectedvirtual

The thread that will be spawned just calls this function. Override it to implement your logic. Remember to frequently check for shouldStop() to see if you should terminate the execution of the thread.

Implements Boardcore::ActiveObject.

Definition at line 72 of file ScreenManager.h.

◆ showScreen()

void Boardcore::ScreenManager::showScreen ( uint8_t id)
inline

Definition at line 49 of file ScreenManager.h.


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