Ember
Loading...
Searching...
No Matches
EmberForge::PerformancePanel Class Reference

Performance panel UI for displaying real-time metrics. More...

#include <PerformanceMonitor.h>

Inheritance diagram for EmberForge::PerformancePanel:
ITab

Public Member Functions

 PerformancePanel (wxWindow *parent, PerformanceMonitor *monitor=nullptr)
virtual ~PerformancePanel ()
wxWindow * GetWidget () override
 Get the main widget for this tab.
wxString GetTitle () const override
 Get the display title for this tab.
wxString GetTabType () const override
 Get a unique identifier for this tab type.
void SetMonitor (PerformanceMonitor *monitor)
PerformanceMonitor * GetMonitor () const
void RefreshDisplay ()
void SetUpdateInterval (int milliseconds)
void SetChartEnabled (const std::string &chartName, bool enabled)
bool IsChartEnabled (const std::string &chartName) const
void SetAllChartsEnabled (bool enabled)
std::vector< std::string > GetAvailableCharts () const
Public Member Functions inherited from ITab
virtual ~ITab ()=default
virtual wxBitmap GetIcon () const
 Get an optional icon for this tab.
virtual void Initialize ()
 Initialize the tab after construction Called once after the tab is created and configured.
virtual void Refresh ()
 Called when the tab should refresh its display This should update the tab's content to reflect current state.
virtual void OnActivated ()
 Called when the tab becomes the active/visible tab.
virtual void OnDeactivated ()
 Called when the tab becomes inactive/hidden.
virtual void OnClosed ()
 Called when the tab is about to be closed/removed Use this for cleanup operations.
virtual bool IsValid () const
 Check if the tab is in a valid state.
virtual bool CanClose () const
 Check if this tab can be closed by the user.
virtual bool CanMove () const
 Check if this tab can be moved to other panels.
virtual wxString SerializeState () const
 Serialize the tab's current state to a string.
virtual void DeserializeState (const wxString &state)
 Restore the tab's state from serialized data.
virtual bool HasUnsavedChanges () const
 Check if this tab has unsaved changes.
virtual bool Save ()
 Save the tab's data (if applicable)
virtual bool SupportsOperation (const wxString &operation) const
 Check if this tab supports the given operation.
virtual bool ExecuteOperation (const wxString &operation, const wxString &parameter="")
 Execute a named operation on this tab.

Private Types

enum  {
  ID_UPDATE_TIMER = wxID_HIGHEST + 100 , ID_TOGGLE_MONITORING , ID_CLEAR_METRICS , ID_EXPORT_METRICS ,
  ID_TOGGLE_FRAME_TIME , ID_TOGGLE_FPS , ID_TOGGLE_CPU , ID_TOGGLE_MEMORY ,
  ID_HISTORY_MINUS , ID_HISTORY_PLUS
}

Private Member Functions

void CreateLayout ()
void CreateToolbar ()
void CreateMetricsDisplay ()
void CreateCharts ()
void OnUpdateTimer (wxTimerEvent &event)
void OnPaint (wxPaintEvent &event)
void OnSize (wxSizeEvent &event)
void OnToggleMonitoring (wxCommandEvent &event)
void OnClearMetrics (wxCommandEvent &event)
void OnExportMetrics (wxCommandEvent &event)
void OnToggleChart (wxCommandEvent &event)
void OnHistoryMinus (wxCommandEvent &event)
void OnHistoryPlus (wxCommandEvent &event)
void DrawChart (wxDC &dc, const wxRect &rect, std::shared_ptr< MetricData > metric)
void DrawMetricInfo (wxDC &dc, const wxRect &rect, std::shared_ptr< MetricData > metric)
void DrawGrid (wxDC &dc, const wxRect &rect, float minVal, float maxVal)
void UpdateMetricDisplays ()
wxRect GetChartRect (int index, int totalCharts) const
wxString FormatValue (float value, const wxString &unit) const
 wxDECLARE_EVENT_TABLE ()

Private Attributes

wxButton * m_toggleButton
wxButton * m_clearButton
wxButton * m_exportButton
wxStaticText * m_statusText
wxPanel * m_chartsPanel
wxPanel * m_togglePanel
wxCheckBox * m_frameTimeCheckbox
wxCheckBox * m_fpsCheckbox
wxCheckBox * m_cpuCheckbox
wxCheckBox * m_memoryCheckbox
wxButton * m_historyMinusButton
wxStaticText * m_historyText
wxButton * m_historyPlusButton
PerformanceMonitor * m_monitor
wxTimer * m_updateTimer
bool m_monitoring
int m_chartHistory
std::map< std::string, bool > m_chartEnabled
int m_chartHeight
int m_chartMargin
wxFont m_labelFont
wxFont m_valueFont

Detailed Description

Performance panel UI for displaying real-time metrics.

Definition at line 107 of file PerformanceMonitor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_UPDATE_TIMER 
ID_TOGGLE_MONITORING 
ID_CLEAR_METRICS 
ID_EXPORT_METRICS 
ID_TOGGLE_FRAME_TIME 
ID_TOGGLE_FPS 
ID_TOGGLE_CPU 
ID_TOGGLE_MEMORY 
ID_HISTORY_MINUS 
ID_HISTORY_PLUS 

Definition at line 192 of file PerformanceMonitor.h.

Constructor & Destructor Documentation

◆ PerformancePanel()

EmberForge::PerformancePanel::PerformancePanel ( wxWindow * parent,
PerformanceMonitor * monitor = nullptr )
explicit

◆ ~PerformancePanel()

EmberForge::PerformancePanel::~PerformancePanel ( )
virtual

Definition at line 330 of file PerformanceMonitor.cpp.

Member Function Documentation

◆ CreateCharts()

void EmberForge::PerformancePanel::CreateCharts ( )
private

Definition at line 447 of file PerformanceMonitor.cpp.

◆ CreateLayout()

void EmberForge::PerformancePanel::CreateLayout ( )
private

Definition at line 341 of file PerformanceMonitor.cpp.

◆ CreateMetricsDisplay()

void EmberForge::PerformancePanel::CreateMetricsDisplay ( )
private

◆ CreateToolbar()

void EmberForge::PerformancePanel::CreateToolbar ( )
private

Definition at line 351 of file PerformanceMonitor.cpp.

◆ DrawChart()

void EmberForge::PerformancePanel::DrawChart ( wxDC & dc,
const wxRect & rect,
std::shared_ptr< MetricData > metric )
private

Definition at line 516 of file PerformanceMonitor.cpp.

◆ DrawGrid()

void EmberForge::PerformancePanel::DrawGrid ( wxDC & dc,
const wxRect & rect,
float minVal,
float maxVal )
private

Definition at line 574 of file PerformanceMonitor.cpp.

◆ DrawMetricInfo()

void EmberForge::PerformancePanel::DrawMetricInfo ( wxDC & dc,
const wxRect & rect,
std::shared_ptr< MetricData > metric )
private

Definition at line 562 of file PerformanceMonitor.cpp.

◆ FormatValue()

wxString EmberForge::PerformancePanel::FormatValue ( float value,
const wxString & unit ) const
private

Definition at line 606 of file PerformanceMonitor.cpp.

◆ GetAvailableCharts()

std::vector< std::string > EmberForge::PerformancePanel::GetAvailableCharts ( ) const

Definition at line 760 of file PerformanceMonitor.cpp.

◆ GetChartRect()

wxRect EmberForge::PerformancePanel::GetChartRect ( int index,
int totalCharts ) const
private

Definition at line 590 of file PerformanceMonitor.cpp.

◆ GetMonitor()

PerformanceMonitor * EmberForge::PerformancePanel::GetMonitor ( ) const
inline

Definition at line 119 of file PerformanceMonitor.h.

◆ GetTabType()

wxString EmberForge::PerformancePanel::GetTabType ( ) const
inlineoverridevirtual

Get a unique identifier for this tab type.

Returns
wxString Identifier like "Properties", "Logger", etc.

Implements ITab.

Definition at line 115 of file PerformanceMonitor.h.

◆ GetTitle()

wxString EmberForge::PerformancePanel::GetTitle ( ) const
inlineoverridevirtual

Get the display title for this tab.

Returns
wxString The title to show in the tab header

Implements ITab.

Definition at line 114 of file PerformanceMonitor.h.

◆ GetWidget()

wxWindow * EmberForge::PerformancePanel::GetWidget ( )
inlineoverridevirtual

Get the main widget for this tab.

Returns
wxWindow* The widget that can be added to notebook pages

Implements ITab.

Definition at line 113 of file PerformanceMonitor.h.

◆ IsChartEnabled()

bool EmberForge::PerformancePanel::IsChartEnabled ( const std::string & chartName) const

Definition at line 736 of file PerformanceMonitor.cpp.

◆ OnClearMetrics()

void EmberForge::PerformancePanel::OnClearMetrics ( wxCommandEvent & event)
private

Definition at line 645 of file PerformanceMonitor.cpp.

◆ OnExportMetrics()

void EmberForge::PerformancePanel::OnExportMetrics ( wxCommandEvent & event)
private

Definition at line 652 of file PerformanceMonitor.cpp.

◆ OnHistoryMinus()

void EmberForge::PerformancePanel::OnHistoryMinus ( wxCommandEvent & event)
private

Definition at line 768 of file PerformanceMonitor.cpp.

◆ OnHistoryPlus()

void EmberForge::PerformancePanel::OnHistoryPlus ( wxCommandEvent & event)
private

Definition at line 796 of file PerformanceMonitor.cpp.

◆ OnPaint()

void EmberForge::PerformancePanel::OnPaint ( wxPaintEvent & event)
private

Definition at line 483 of file PerformanceMonitor.cpp.

◆ OnSize()

void EmberForge::PerformancePanel::OnSize ( wxSizeEvent & event)
private

Definition at line 620 of file PerformanceMonitor.cpp.

◆ OnToggleChart()

void EmberForge::PerformancePanel::OnToggleChart ( wxCommandEvent & event)
private

Definition at line 710 of file PerformanceMonitor.cpp.

◆ OnToggleMonitoring()

void EmberForge::PerformancePanel::OnToggleMonitoring ( wxCommandEvent & event)
private

Definition at line 625 of file PerformanceMonitor.cpp.

◆ OnUpdateTimer()

void EmberForge::PerformancePanel::OnUpdateTimer ( wxTimerEvent & event)
private

Definition at line 461 of file PerformanceMonitor.cpp.

◆ RefreshDisplay()

void EmberForge::PerformancePanel::RefreshDisplay ( )

Definition at line 467 of file PerformanceMonitor.cpp.

◆ SetAllChartsEnabled()

void EmberForge::PerformancePanel::SetAllChartsEnabled ( bool enabled)

Definition at line 746 of file PerformanceMonitor.cpp.

◆ SetChartEnabled()

void EmberForge::PerformancePanel::SetChartEnabled ( const std::string & chartName,
bool enabled )

Definition at line 732 of file PerformanceMonitor.cpp.

◆ SetMonitor()

void EmberForge::PerformancePanel::SetMonitor ( PerformanceMonitor * monitor)

Definition at line 337 of file PerformanceMonitor.cpp.

◆ SetUpdateInterval()

void EmberForge::PerformancePanel::SetUpdateInterval ( int milliseconds)

Definition at line 703 of file PerformanceMonitor.cpp.

◆ UpdateMetricDisplays()

void EmberForge::PerformancePanel::UpdateMetricDisplays ( )
private

Definition at line 472 of file PerformanceMonitor.cpp.

◆ wxDECLARE_EVENT_TABLE()

EmberForge::PerformancePanel::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ m_chartEnabled

std::map<std::string, bool> EmberForge::PerformancePanel::m_chartEnabled
private

Definition at line 183 of file PerformanceMonitor.h.

◆ m_chartHeight

int EmberForge::PerformancePanel::m_chartHeight
private

Definition at line 186 of file PerformanceMonitor.h.

◆ m_chartHistory

int EmberForge::PerformancePanel::m_chartHistory
private

Definition at line 182 of file PerformanceMonitor.h.

◆ m_chartMargin

int EmberForge::PerformancePanel::m_chartMargin
private

Definition at line 187 of file PerformanceMonitor.h.

◆ m_chartsPanel

wxPanel* EmberForge::PerformancePanel::m_chartsPanel
private

Definition at line 164 of file PerformanceMonitor.h.

◆ m_clearButton

wxButton* EmberForge::PerformancePanel::m_clearButton
private

Definition at line 161 of file PerformanceMonitor.h.

◆ m_cpuCheckbox

wxCheckBox* EmberForge::PerformancePanel::m_cpuCheckbox
private

Definition at line 170 of file PerformanceMonitor.h.

◆ m_exportButton

wxButton* EmberForge::PerformancePanel::m_exportButton
private

Definition at line 162 of file PerformanceMonitor.h.

◆ m_fpsCheckbox

wxCheckBox* EmberForge::PerformancePanel::m_fpsCheckbox
private

Definition at line 169 of file PerformanceMonitor.h.

◆ m_frameTimeCheckbox

wxCheckBox* EmberForge::PerformancePanel::m_frameTimeCheckbox
private

Definition at line 168 of file PerformanceMonitor.h.

◆ m_historyMinusButton

wxButton* EmberForge::PerformancePanel::m_historyMinusButton
private

Definition at line 174 of file PerformanceMonitor.h.

◆ m_historyPlusButton

wxButton* EmberForge::PerformancePanel::m_historyPlusButton
private

Definition at line 176 of file PerformanceMonitor.h.

◆ m_historyText

wxStaticText* EmberForge::PerformancePanel::m_historyText
private

Definition at line 175 of file PerformanceMonitor.h.

◆ m_labelFont

wxFont EmberForge::PerformancePanel::m_labelFont
private

Definition at line 188 of file PerformanceMonitor.h.

◆ m_memoryCheckbox

wxCheckBox* EmberForge::PerformancePanel::m_memoryCheckbox
private

Definition at line 171 of file PerformanceMonitor.h.

◆ m_monitor

PerformanceMonitor* EmberForge::PerformancePanel::m_monitor
private

Definition at line 179 of file PerformanceMonitor.h.

◆ m_monitoring

bool EmberForge::PerformancePanel::m_monitoring
private

Definition at line 181 of file PerformanceMonitor.h.

◆ m_statusText

wxStaticText* EmberForge::PerformancePanel::m_statusText
private

Definition at line 163 of file PerformanceMonitor.h.

◆ m_toggleButton

wxButton* EmberForge::PerformancePanel::m_toggleButton
private

Definition at line 160 of file PerformanceMonitor.h.

◆ m_togglePanel

wxPanel* EmberForge::PerformancePanel::m_togglePanel
private

Definition at line 165 of file PerformanceMonitor.h.

◆ m_updateTimer

wxTimer* EmberForge::PerformancePanel::m_updateTimer
private

Definition at line 180 of file PerformanceMonitor.h.

◆ m_valueFont

wxFont EmberForge::PerformancePanel::m_valueFont
private

Definition at line 189 of file PerformanceMonitor.h.


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