View-model for a single component tile on the dashboard: its icon, type, name, current data string, and enabled state.
More...
#include <ComponentData.h>
|
| | ComponentData () |
| | Builds an empty component tile with an unknown type and disabled state. More...
|
| |
| | ComponentData (const RumPi::EComponentType componentType, const wxString &name, const wxString &data, const bool isEnabled) |
| | Builds a component tile from its type (which selects the icon), name, initial data string, and enabled state. More...
|
| |
| virtual | ~ComponentData ()=default |
| | Defaulted destructor. More...
|
| |
| wxBitmapBundle | GetIcon () const |
| | Gets the component's icon. More...
|
| |
| RumPi::EComponentType | GetComponentType () const |
| | Gets the component's type. More...
|
| |
| const wxString & | GetName () const |
| | Gets the component's unique instance name. More...
|
| |
| const wxString & | GetData () const |
| | Gets the component's current data string. More...
|
| |
| bool | GetIsEnabled () const |
| | Gets whether the component is currently enabled. More...
|
| |
| void | SetIcon (const wxBitmapBundle &icon) |
| | Sets the component's icon. More...
|
| |
| void | SetComponentType (const RumPi::EComponentType componentType) |
| | Sets the component's type. More...
|
| |
| void | SetName (const wxString &name) |
| | Sets the component's unique instance name. More...
|
| |
| void | SetData (const wxString &data) |
| | Sets the component's current data string. More...
|
| |
| void | SetIsEnabled (const bool isEnabled) |
| | Sets whether the component is currently enabled. More...
|
| |
View-model for a single component tile on the dashboard: its icon, type, name, current data string, and enabled state.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
◆ ComponentData() [1/2]
| ComponentData::ComponentData |
( |
| ) |
|
Builds an empty component tile with an unknown type and disabled state.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
View-model for a single component tile on the dashboard: its icon, type, name, current data string,...
Definition: ComponentData.h:14
◆ ComponentData() [2/2]
| ComponentData::ComponentData |
( |
const RumPi::EComponentType |
componentType, |
|
|
const wxString & |
name, |
|
|
const wxString & |
data, |
|
|
const bool |
isEnabled |
|
) |
| |
Builds a component tile from its type (which selects the icon), name, initial data string, and enabled state.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
ComponentData data(RumPi::EComponentType::E_LED,
"Porch LED",
"On",
true);
- Parameters
-
| [in] | componentType | The component type; its icon is derived from this. |
| [in] | name | The component's unique instance name, shown as its label. |
| [in] | data | The initial data string to display. |
| [in] | isEnabled | Whether the component is currently enabled. |
◆ ~ComponentData()
| virtual ComponentData::~ComponentData |
( |
| ) |
|
|
virtualdefault |
Defaulted destructor.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
delete data;
ComponentData()
Builds an empty component tile with an unknown type and disabled state.
Definition: ComponentData.cpp:14
◆ GetComponentType()
| RumPi::EComponentType ComponentData::GetComponentType |
( |
| ) |
const |
Gets the component's type.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
RumPi::EComponentType type = data.GetComponentType();
- Returns
- The component's type.
◆ GetData()
| const wxString & ComponentData::GetData |
( |
| ) |
const |
Gets the component's current data string.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
wxString value = data.GetData();
- Returns
- The component's data string.
◆ GetIcon()
| wxBitmapBundle ComponentData::GetIcon |
( |
| ) |
const |
Gets the component's icon.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
wxBitmapBundle icon = data.GetIcon();
- Returns
- The component's icon.
◆ GetIsEnabled()
| bool ComponentData::GetIsEnabled |
( |
| ) |
const |
Gets whether the component is currently enabled.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
bool enabled = data.GetIsEnabled();
- Returns
- True if the component is enabled.
◆ GetName()
| const wxString & ComponentData::GetName |
( |
| ) |
const |
Gets the component's unique instance name.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
wxString name = data.GetName();
- Returns
- The component's name.
◆ SetComponentType()
| void ComponentData::SetComponentType |
( |
const RumPi::EComponentType |
componentType | ) |
|
Sets the component's type.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
data.SetComponentType(RumPi::EComponentType::E_LED);
- Parameters
-
| [in] | componentType | The component type to set. |
◆ SetData()
| void ComponentData::SetData |
( |
const wxString & |
data | ) |
|
Sets the component's current data string.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
- Parameters
-
| [in] | data | The data string to set. |
◆ SetIcon()
| void ComponentData::SetIcon |
( |
const wxBitmapBundle & |
icon | ) |
|
Sets the component's icon.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
- Parameters
-
◆ SetIsEnabled()
| void ComponentData::SetIsEnabled |
( |
const bool |
isEnabled | ) |
|
Sets whether the component is currently enabled.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
- Parameters
-
| [in] | isEnabled | True if the component is enabled. |
◆ SetName()
| void ComponentData::SetName |
( |
const wxString & |
name | ) |
|
Sets the component's unique instance name.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
data.SetName("Porch LED");
- Parameters
-
◆ myComponentType
| RumPi::EComponentType ComponentData::myComponentType |
|
protected |
◆ myData
| wxString ComponentData::myData |
|
protected |
The current data string to display.
◆ myIcon
| wxBitmapBundle ComponentData::myIcon |
|
protected |
The component's icon (derived from its type).
◆ myIsEnabled
| bool ComponentData::myIsEnabled |
|
protected |
Whether the component is currently enabled.
◆ myName
| wxString ComponentData::myName |
|
protected |
The component's unique instance name, shown as its label.
The documentation for this class was generated from the following files: