Ember
Loading...
Searching...
No Matches
Ember::Monitor::MainPanel Class Reference

Central panel containing the MonitorTreeCanvas and search bar. More...

#include <MainPanel.h>

Inheritance diagram for Ember::Monitor::MainPanel:
EmberUI::Panel EmberUI::IStatusProvider IPanel

Public Types

using NodeSelectionCallback = std::function<void(EmberCore::ITreeNode *)>

Public Member Functions

 MainPanel (wxWindow *parent)
 ~MainPanel () override=default
void SetTree (std::shared_ptr< Ember::Network::TCPTreeAdapter > adapter, std::shared_ptr< Network::StateManager > stateManager)
 Loads the tree from the given adapter and state manager.
void ClearTree ()
 Clears the displayed tree.
MonitorTreeCanvasGetTreeCanvas () const
 Returns the tree canvas widget.
int GetNodeStatus (int64_t nodeId) const override
 Returns the status code for the given node.
bool IsNodeInExecutionPath (int64_t nodeId) const override
 Returns true if the node is in the current execution path.
void GetExecutionPathIds (std::set< int64_t > &outIds) const override
 Fills outIds with node IDs in the execution path.
void SetNodeSelectionCallback (NodeSelectionCallback callback)
 Registers a callback invoked when a node is selected in the tree.
Public Member Functions inherited from EmberUI::Panel
 Panel (wxWindow *parent, const wxString &name="Panel", long style=wxTAB_TRAVERSAL)
 Constructs the panel with optional name and style.
virtual ~Panel ()
wxPanel * GetPanel () override
 Returns this panel as wxPanel pointer.
wxString GetTitle () const override
 Returns the panel title.
wxString GetPanelType () const override
 Returns the panel type identifier.
void Initialize () override
 Initializes the panel layout and appearance.
void Refresh () override
 Refreshes panel content.
void OnActivated () override
 Called when the panel is activated.
void OnDeactivated () override
 Called when the panel is deactivated.
void Cleanup () override
 Cleans up panel resources.
bool IsValid () const override
 Returns true if the panel has been initialized.
wxString SerializeState () const override
 Serializes panel state to a string.
void DeserializeState (const wxString &state) override
 Restores panel state from a serialized string.
bool HasUnsavedChanges () const override
 Returns true if there are unsaved changes.
bool Save () override
 Saves panel state; returns true on success.
bool SupportsOperation (const wxString &operation) const override
 Returns true if the panel supports the given operation.
bool ExecuteOperation (const wxString &operation, const wxString &parameter="") override
 Executes a named operation with optional parameter.
wxString GetName () const override
 Returns the panel name.
void SetName (const wxString &name) override
 Sets the panel name.
void SetTitle (const wxString &title)
 Sets the panel title.
void SetPanelType (const wxString &type)
 Sets the panel type identifier.
Public Member Functions inherited from IPanel
virtual ~IPanel ()=default
Public Member Functions inherited from EmberUI::IStatusProvider
virtual ~IStatusProvider ()=default

Private Member Functions

void CreateLayout () override
 Hook: creates the panel layout. Override to customize.
void OnSearchText (wxCommandEvent &event)
void OnSearchEnter (wxCommandEvent &event)
void OnSearchCancel (wxCommandEvent &event)
void NavigateToResult (size_t index)
void CollectSearchResults (const wxString &query)

Private Attributes

MonitorTreeCanvasm_treeCanvas = nullptr
wxSearchCtrl * m_searchCtrl = nullptr
wxStaticText * m_searchStatus = nullptr
std::vector< EmberCore::ITreeNode * > m_searchResults
size_t m_searchIndex = 0
std::shared_ptr< Ember::Network::TCPTreeAdapterm_adapter
std::shared_ptr< Network::StateManagerm_stateManager

Additional Inherited Members

Protected Member Functions inherited from EmberUI::Panel
virtual void ApplyTheme ()
 Hook: applies theme colors and fonts. Override to customize.
virtual void UpdateContent ()
 Hook: updates displayed content. Override to refresh data.
virtual void HandleActivation ()
 Hook: handles panel activation. Override to customize.
virtual void HandleDeactivation ()
 Hook: handles panel deactivation. Override to customize.
virtual bool ValidateState () const
 Hook: validates panel state; returns true if valid.
void MarkChanged ()
 Marks the panel as having unsaved changes.
void MarkSaved ()
 Clears the unsaved-changes flag.
wxSizer * GetMainSizer () const
 Returns the main sizer for layout.
void SetMainSizer (wxSizer *sizer)
 Sets the main sizer.
virtual void OnPanelSize (wxSizeEvent &event)
 Hook: handles panel resize events.
virtual void OnPanelPaint (wxPaintEvent &event)
 Hook: handles panel paint events.

Detailed Description

Central panel containing the MonitorTreeCanvas and search bar.

Implements IStatusProvider for status coloring.

Definition at line 19 of file MainPanel.h.

Member Typedef Documentation

◆ NodeSelectionCallback

Definition at line 41 of file MainPanel.h.

Constructor & Destructor Documentation

◆ MainPanel()

MainPanel::MainPanel ( wxWindow * parent)
explicit

Definition at line 6 of file MainPanel.cpp.

◆ ~MainPanel()

Ember::Monitor::MainPanel::~MainPanel ( )
overridedefault

Member Function Documentation

◆ ClearTree()

void MainPanel::ClearTree ( )

Clears the displayed tree.

Definition at line 122 of file MainPanel.cpp.

◆ CollectSearchResults()

void MainPanel::CollectSearchResults ( const wxString & query)
private

Definition at line 93 of file MainPanel.cpp.

◆ CreateLayout()

void MainPanel::CreateLayout ( )
overrideprivatevirtual

Hook: creates the panel layout. Override to customize.

Reimplemented from EmberUI::Panel.

Definition at line 8 of file MainPanel.cpp.

◆ GetExecutionPathIds()

void MainPanel::GetExecutionPathIds ( std::set< int64_t > & outIds) const
overridevirtual

Fills outIds with node IDs in the execution path.

Implements EmberUI::IStatusProvider.

Definition at line 150 of file MainPanel.cpp.

◆ GetNodeStatus()

int MainPanel::GetNodeStatus ( int64_t nodeId) const
overridevirtual

Returns the status code for the given node.

Implements EmberUI::IStatusProvider.

Definition at line 132 of file MainPanel.cpp.

◆ GetTreeCanvas()

MonitorTreeCanvas * Ember::Monitor::MainPanel::GetTreeCanvas ( ) const
inline

Returns the tree canvas widget.

Definition at line 31 of file MainPanel.h.

◆ IsNodeInExecutionPath()

bool MainPanel::IsNodeInExecutionPath ( int64_t nodeId) const
overridevirtual

Returns true if the node is in the current execution path.

Implements EmberUI::IStatusProvider.

Definition at line 138 of file MainPanel.cpp.

◆ NavigateToResult()

void MainPanel::NavigateToResult ( size_t index)
private

Definition at line 72 of file MainPanel.cpp.

◆ OnSearchCancel()

void MainPanel::OnSearchCancel ( wxCommandEvent & event)
private

Definition at line 64 of file MainPanel.cpp.

◆ OnSearchEnter()

void MainPanel::OnSearchEnter ( wxCommandEvent & event)
private

Definition at line 57 of file MainPanel.cpp.

◆ OnSearchText()

void MainPanel::OnSearchText ( wxCommandEvent & event)
private

Definition at line 40 of file MainPanel.cpp.

◆ SetNodeSelectionCallback()

void MainPanel::SetNodeSelectionCallback ( NodeSelectionCallback callback)

Registers a callback invoked when a node is selected in the tree.

Definition at line 158 of file MainPanel.cpp.

◆ SetTree()

void MainPanel::SetTree ( std::shared_ptr< Ember::Network::TCPTreeAdapter > adapter,
std::shared_ptr< Network::StateManager > stateManager )

Loads the tree from the given adapter and state manager.

Definition at line 108 of file MainPanel.cpp.

Member Data Documentation

◆ m_adapter

std::shared_ptr<Ember::Network::TCPTreeAdapter> Ember::Monitor::MainPanel::m_adapter
private

Definition at line 60 of file MainPanel.h.

◆ m_searchCtrl

wxSearchCtrl* Ember::Monitor::MainPanel::m_searchCtrl = nullptr
private

Definition at line 54 of file MainPanel.h.

◆ m_searchIndex

size_t Ember::Monitor::MainPanel::m_searchIndex = 0
private

Definition at line 58 of file MainPanel.h.

◆ m_searchResults

std::vector<EmberCore::ITreeNode *> Ember::Monitor::MainPanel::m_searchResults
private

Definition at line 57 of file MainPanel.h.

◆ m_searchStatus

wxStaticText* Ember::Monitor::MainPanel::m_searchStatus = nullptr
private

Definition at line 55 of file MainPanel.h.

◆ m_stateManager

std::shared_ptr<Network::StateManager> Ember::Monitor::MainPanel::m_stateManager
private

Definition at line 61 of file MainPanel.h.

◆ m_treeCanvas

MonitorTreeCanvas* Ember::Monitor::MainPanel::m_treeCanvas = nullptr
private

Definition at line 53 of file MainPanel.h.


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