RumPi Linux Client 1.0
A wxWidgets desktop dashboard that visualizes a RumPi robot's live sensor data as a condition-reactive scene
ComponentData.h
Go to the documentation of this file.
1#pragma once
2
3#include <wx/dataview.h>
4#include <RumPi/Components/BaseComponent.h>
5
14{
15protected:
16 wxBitmapBundle myIcon;
17 RumPi::EComponentType myComponentType;
18 wxString myName;
19 wxString myData;
21
22public:
34
50 ComponentData(const RumPi::EComponentType componentType, const wxString& name, const wxString& data, const bool isEnabled);
51
63 virtual ~ComponentData() = default;
64
77 wxBitmapBundle GetIcon() const;
78
91 RumPi::EComponentType GetComponentType() const;
92
105 const wxString& GetName() const;
106
119 const wxString& GetData() const;
120
133 bool GetIsEnabled() const;
134
147 void SetIcon(const wxBitmapBundle& icon);
148
161 void SetComponentType(const RumPi::EComponentType componentType);
162
175 void SetName(const wxString& name);
176
189 void SetData(const wxString& data);
190
203 void SetIsEnabled(const bool isEnabled);
204};
View-model for a single component tile on the dashboard: its icon, type, name, current data string,...
Definition: ComponentData.h:14
bool GetIsEnabled() const
Gets whether the component is currently enabled.
Definition: ComponentData.cpp:126
wxBitmapBundle GetIcon() const
Gets the component's icon.
Definition: ComponentData.cpp:58
wxString myData
The current data string to display.
Definition: ComponentData.h:19
bool myIsEnabled
Whether the component is currently enabled.
Definition: ComponentData.h:20
void SetData(const wxString &data)
Sets the component's current data string.
Definition: ComponentData.cpp:194
void SetIcon(const wxBitmapBundle &icon)
Sets the component's icon.
Definition: ComponentData.cpp:143
ComponentData()
Builds an empty component tile with an unknown type and disabled state.
Definition: ComponentData.cpp:14
wxBitmapBundle myIcon
The component's icon (derived from its type).
Definition: ComponentData.h:16
const wxString & GetName() const
Gets the component's unique instance name.
Definition: ComponentData.cpp:92
virtual ~ComponentData()=default
Defaulted destructor.
void SetComponentType(const RumPi::EComponentType componentType)
Sets the component's type.
Definition: ComponentData.cpp:160
void SetIsEnabled(const bool isEnabled)
Sets whether the component is currently enabled.
Definition: ComponentData.cpp:211
RumPi::EComponentType GetComponentType() const
Gets the component's type.
Definition: ComponentData.cpp:75
const wxString & GetData() const
Gets the component's current data string.
Definition: ComponentData.cpp:109
void SetName(const wxString &name)
Sets the component's unique instance name.
Definition: ComponentData.cpp:177
wxString myName
The component's unique instance name, shown as its label.
Definition: ComponentData.h:18
RumPi::EComponentType myComponentType
The component's type.
Definition: ComponentData.h:17