RumPi Linux Client 1.0
A wxWidgets desktop dashboard that visualizes a RumPi robot's live sensor data as a condition-reactive scene
ComponentData Class Reference

View-model for a single component tile on the dashboard: its icon, type, name, current data string, and enabled state. More...

#include <ComponentData.h>

Public Member Functions

 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...
 

Protected Attributes

wxBitmapBundle myIcon
 The component's icon (derived from its type). More...
 
RumPi::EComponentType myComponentType
 The component's type. More...
 
wxString myName
 The component's unique instance name, shown as its label. More...
 
wxString myData
 The current data string to display. More...
 
bool myIsEnabled
 Whether the component is currently enabled. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ 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]componentTypeThe component type; its icon is derived from this.
[in]nameThe component's unique instance name, shown as its label.
[in]dataThe initial data string to display.
[in]isEnabledWhether 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

Member Function Documentation

◆ 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]componentTypeThe 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
data.SetData("On");
Parameters
[in]dataThe data string to set.

◆ SetIcon()

void ComponentData::SetIcon ( const wxBitmapBundle &  icon)

Sets the component's icon.

Author
Eddie O'Hagan
Date
8/13/2026
data.SetIcon(icon);
Parameters
[in]iconThe icon to set.

◆ SetIsEnabled()

void ComponentData::SetIsEnabled ( const bool  isEnabled)

Sets whether the component is currently enabled.

Author
Eddie O'Hagan
Date
8/13/2026
data.SetIsEnabled(true);
Parameters
[in]isEnabledTrue 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
[in]nameThe name to set.

Member Data Documentation

◆ myComponentType

RumPi::EComponentType ComponentData::myComponentType
protected

The component's type.

◆ 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: