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
 Returns the wxWidgets window used as the tab content.
wxString GetTitle () const override
 Returns the display title of the tab.
wxString GetTabType () const override
 Returns the tab type identifier.
void SetMonitor (PerformanceMonitor *monitor)
PerformanceMonitorGetMonitor () 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
 Returns the tab icon bitmap; defaults to null.
virtual void Initialize ()
 Called once when the tab is first created.
virtual void Refresh ()
 Refreshes the tab content.
virtual void OnActivated ()
 Called when the tab becomes active.
virtual void OnDeactivated ()
 Called when the tab becomes inactive.
virtual void OnClosed ()
 Called when the tab is closed.
virtual bool IsValid () const
 Returns true if the tab is in a valid state.
virtual bool CanClose () const
 Returns true if the tab can be closed.
virtual bool CanMove () const
 Returns true if the tab can be moved/reordered.
virtual wxString SerializeState () const
 Serializes tab state to a string for persistence.
virtual void DeserializeState (const wxString &state)
 Restores tab state from a serialized string.
virtual bool HasUnsavedChanges () const
 Returns true if the tab has unsaved changes.
virtual bool Save ()
 Saves the tab content; returns true on success.
virtual bool SupportsOperation (const wxString &operation) const
 Returns true if the tab supports the given operation.
virtual bool ExecuteOperation (const wxString &operation, const wxString &parameter="")
 Executes an operation with optional parameter; returns true on success.

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

Returns the tab type identifier.

Implements ITab.

Definition at line 115 of file PerformanceMonitor.h.

◆ GetTitle()

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

Returns the display title of the tab.

Implements ITab.

Definition at line 114 of file PerformanceMonitor.h.

◆ GetWidget()

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

Returns the wxWidgets window used as the tab content.

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: