Dilbert
Firmware for the Dilbert interactive badge.
|
Used to encapsulate an individual application. More...
#include <App.h>
Public Member Functions | |
App (char *name) | |
Creates a new instance of a badge application. More... | |
char * | name () |
Gets the name of the application. More... | |
void | setBackgroundColour (uint16_t colour) |
Sets the background fill colour of the display for this application. More... | |
virtual void | create () |
Creates the application. More... | |
virtual void | onEntry () |
Called when the application is entered. More... | |
virtual void | run () |
Called in a loop while the application is active. More... | |
virtual void | exit () |
Exits the application. | |
virtual void | onExit () |
Called when the application exits. More... | |
virtual void | destroy () |
Destroys the application. More... | |
Protected Member Functions | |
virtual bool | handleButton (IButton *button) |
Handle button presses. More... | |
Protected Attributes | |
Dilbert * | m_badge |
Pointer to badge driver. | |
AppManager * | m_manager |
Pointer to application manager. | |
char * | m_name |
Name of application. | |
bool | m_ready |
If the application has been created. | |
uint16_t | m_backgroundColour |
Background colour. | |
Friends | |
class | AppManager |
Used to encapsulate an individual application.
|
inline |
Creates a new instance of a badge application.
name | Name of the application |
|
inlinevirtual |
Creates the application.
Memory allocations should be performed here.
Reimplemented in NeoTestApp, SystemSettingsApp, and MenuApp.
|
inlinevirtual |
Destroys the application.
Memory deallocation should be performed here.
Reimplemented in NeoTestApp.
|
inlineprotectedvirtual |
Handle button presses.
button | Button that has changed |
Reimplemented in Conways, StarsApp, NeoTestApp, ButtonTestApp, SystemSettingsApp, MenuApp, and StaticDisplayApp.
|
inline |
Gets the name of the application.
|
inlinevirtual |
Called when the application is entered.
Initial state should be set here, particularly for the display.
Reimplemented in Conways, NeoTestApp, StarsApp, ButtonTestApp, DilbertApp, SystemSettingsApp, MenuApp, and StaticDisplayApp.
|
inlinevirtual |
Called when the application exits.
Perform any state cleanup here.
Reimplemented in NeoTestApp, and StaticDisplayApp.
|
inlinevirtual |
Called in a loop while the application is active.
Equivalent to loop()
in Arduino.
Reimplemented in Conways, NeoTestApp, StarsApp, and ProfileApp.
|
inline |
Sets the background fill colour of the display for this application.
colour | Background colour |