KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PCB_NET_INSPECTOR_PANEL::DATA_MODEL Class Reference

Data model for display in the Net Inspector panel. More...

#include <pcb_net_inspector_panel_data_model.h>

Inheritance diagram for PCB_NET_INSPECTOR_PANEL::DATA_MODEL:

Public Member Functions

 DATA_MODEL (PCB_NET_INSPECTOR_PANEL &parent)
 
unsigned int columnCount () const
 
unsigned int itemCount () const
 
wxVariant valueAt (unsigned int aCol, unsigned int aRow) const
 
const LIST_ITEMitemAt (unsigned int aRow) const
 
std::vector< std::pair< wxString, wxDataViewItem > > getGroupDataViewItems ()
 
std::optional< LIST_ITEM_ITERfindItem (int aNetCode)
 
std::optional< LIST_ITEM_ITERfindItem (NETINFO_ITEM *aNet)
 
std::optional< LIST_ITEM_ITERfindGroupItem (int aGroupNumber)
 
LIST_ITEM_ITER addGroup (LIST_ITEM_ITER groupsBegin, LIST_ITEM_ITER groupsEnd, wxString groupName, LIST_ITEM::GROUP_TYPE groupType)
 
std::optional< LIST_ITEM_ITERaddItem (std::unique_ptr< LIST_ITEM > aItem)
 
void addItems (std::vector< std::unique_ptr< LIST_ITEM > > aItems)
 
std::unique_ptr< LIST_ITEMdeleteItem (const std::optional< LIST_ITEM_ITER > &aRow)
 
void addCustomGroups ()
 Adds all custom group-by entries to the items table.
 
void deleteAllItems ()
 
void updateItem (const std::optional< LIST_ITEM_ITER > &aRow)
 
void updateAllItems ()
 
void resortIfChanged (LIST_ITEM *aItem)
 
bool itemColumnChanged (const LIST_ITEM *aItem, unsigned int aCol) const
 

Protected Member Functions

unsigned int GetColumnCount () const override
 
void GetValue (wxVariant &aOutValue, const wxDataViewItem &aItem, unsigned int aCol) const override
 
int Compare (const wxDataViewItem &aItem1, const wxDataViewItem &aItem2, unsigned int aCol, bool aAsc) const override
 
bool SetValue (const wxVariant &aInValue, const wxDataViewItem &aItem, unsigned int aCol) override
 
wxDataViewItem GetParent (const wxDataViewItem &aItem) const override
 
bool IsContainer (const wxDataViewItem &aItem) const override
 
bool HasContainerColumns (const wxDataViewItem &aItem) const override
 
unsigned int GetChildren (const wxDataViewItem &aParent, wxDataViewItemArray &aChildren) const override
 
wxString GetColumnType (unsigned int) const override
 

Static Protected Member Functions

static int compareUInt (uint64_t aValue1, uint64_t aValue2, bool aAsc)
 

Private Attributes

PCB_NET_INSPECTOR_PANELm_parent
 
std::vector< std::unique_ptr< LIST_ITEM > > m_items
 
std::map< wxString, LIST_ITEM * > m_custom_group_map
 Map of custom group names to their representative list item.
 

Detailed Description

Data model for display in the Net Inspector panel.

Definition at line 402 of file pcb_net_inspector_panel_data_model.h.

Constructor & Destructor Documentation

◆ DATA_MODEL()

PCB_NET_INSPECTOR_PANEL::DATA_MODEL::DATA_MODEL ( PCB_NET_INSPECTOR_PANEL parent)
inline

Definition at line 405 of file pcb_net_inspector_panel_data_model.h.

Member Function Documentation

◆ addCustomGroups()

void PCB_NET_INSPECTOR_PANEL::DATA_MODEL::addCustomGroups ( )
inline

Adds all custom group-by entries to the items table.

Note this assumes that m_items is empty prior to adding these groups

Definition at line 597 of file pcb_net_inspector_panel_data_model.h.

References BOARD::GetCopperLayerCount(), group, PCB_NET_INSPECTOR_PANEL::m_brd, m_custom_group_map, PCB_NET_INSPECTOR_PANEL::m_custom_group_rules, m_items, m_parent, and PCB_NET_INSPECTOR_PANEL::LIST_ITEM::USER_DEFINED.

◆ addGroup()

LIST_ITEM_ITER PCB_NET_INSPECTOR_PANEL::DATA_MODEL::addGroup ( LIST_ITEM_ITER  groupsBegin,
LIST_ITEM_ITER  groupsEnd,
wxString  groupName,
LIST_ITEM::GROUP_TYPE  groupType 
)
inline

Definition at line 470 of file pcb_net_inspector_panel_data_model.h.

References group, and m_items.

Referenced by addItem().

◆ addItem()

std::optional< LIST_ITEM_ITER > PCB_NET_INSPECTOR_PANEL::DATA_MODEL::addItem ( std::unique_ptr< LIST_ITEM aItem)
inline

◆ addItems()

void PCB_NET_INSPECTOR_PANEL::DATA_MODEL::addItems ( std::vector< std::unique_ptr< LIST_ITEM > >  aItems)
inline

Definition at line 547 of file pcb_net_inspector_panel_data_model.h.

References addItem(), and m_items.

◆ columnCount()

unsigned int PCB_NET_INSPECTOR_PANEL::DATA_MODEL::columnCount ( ) const
inline

Definition at line 407 of file pcb_net_inspector_panel_data_model.h.

References PCB_NET_INSPECTOR_PANEL::m_columns, and m_parent.

Referenced by GetColumnCount().

◆ Compare()

◆ compareUInt()

static int PCB_NET_INSPECTOR_PANEL::DATA_MODEL::compareUInt ( uint64_t  aValue1,
uint64_t  aValue2,
bool  aAsc 
)
inlinestaticprotected

Definition at line 756 of file pcb_net_inspector_panel_data_model.h.

Referenced by Compare().

◆ deleteAllItems()

void PCB_NET_INSPECTOR_PANEL::DATA_MODEL::deleteAllItems ( )
inline

Definition at line 614 of file pcb_net_inspector_panel_data_model.h.

References m_items.

◆ deleteItem()

◆ findGroupItem()

std::optional< LIST_ITEM_ITER > PCB_NET_INSPECTOR_PANEL::DATA_MODEL::findGroupItem ( int  aGroupNumber)
inline

Definition at line 458 of file pcb_net_inspector_panel_data_model.h.

References m_items.

◆ findItem() [1/2]

std::optional< LIST_ITEM_ITER > PCB_NET_INSPECTOR_PANEL::DATA_MODEL::findItem ( int  aNetCode)
inline

Definition at line 437 of file pcb_net_inspector_panel_data_model.h.

References m_items.

Referenced by findItem().

◆ findItem() [2/2]

std::optional< LIST_ITEM_ITER > PCB_NET_INSPECTOR_PANEL::DATA_MODEL::findItem ( NETINFO_ITEM aNet)
inline

Definition at line 449 of file pcb_net_inspector_panel_data_model.h.

References findItem(), and NETINFO_ITEM::GetNetCode().

◆ GetChildren()

unsigned int PCB_NET_INSPECTOR_PANEL::DATA_MODEL::GetChildren ( const wxDataViewItem &  aParent,
wxDataViewItemArray &  aChildren 
) const
inlineoverrideprotected

◆ GetColumnCount()

unsigned int PCB_NET_INSPECTOR_PANEL::DATA_MODEL::GetColumnCount ( ) const
inlineoverrideprotected

Definition at line 694 of file pcb_net_inspector_panel_data_model.h.

References columnCount().

◆ GetColumnType()

wxString PCB_NET_INSPECTOR_PANEL::DATA_MODEL::GetColumnType ( unsigned int  ) const
inlineoverrideprotected

Definition at line 882 of file pcb_net_inspector_panel_data_model.h.

◆ getGroupDataViewItems()

std::vector< std::pair< wxString, wxDataViewItem > > PCB_NET_INSPECTOR_PANEL::DATA_MODEL::getGroupDataViewItems ( )
inline

Definition at line 420 of file pcb_net_inspector_panel_data_model.h.

References m_items.

◆ GetParent()

wxDataViewItem PCB_NET_INSPECTOR_PANEL::DATA_MODEL::GetParent ( const wxDataViewItem &  aItem) const
inlineoverrideprotected

◆ GetValue()

◆ HasContainerColumns()

bool PCB_NET_INSPECTOR_PANEL::DATA_MODEL::HasContainerColumns ( const wxDataViewItem &  aItem) const
inlineoverrideprotected

Definition at line 842 of file pcb_net_inspector_panel_data_model.h.

References IsContainer().

◆ IsContainer()

bool PCB_NET_INSPECTOR_PANEL::DATA_MODEL::IsContainer ( const wxDataViewItem &  aItem) const
inlineoverrideprotected

Definition at line 834 of file pcb_net_inspector_panel_data_model.h.

Referenced by HasContainerColumns().

◆ itemAt()

const LIST_ITEM & PCB_NET_INSPECTOR_PANEL::DATA_MODEL::itemAt ( unsigned int  aRow) const
inline

Definition at line 418 of file pcb_net_inspector_panel_data_model.h.

References m_items.

◆ itemColumnChanged()

◆ itemCount()

unsigned int PCB_NET_INSPECTOR_PANEL::DATA_MODEL::itemCount ( ) const
inline

Definition at line 409 of file pcb_net_inspector_panel_data_model.h.

References m_items.

◆ resortIfChanged()

void PCB_NET_INSPECTOR_PANEL::DATA_MODEL::resortIfChanged ( LIST_ITEM aItem)
inline

◆ SetValue()

bool PCB_NET_INSPECTOR_PANEL::DATA_MODEL::SetValue ( const wxVariant &  aInValue,
const wxDataViewItem &  aItem,
unsigned int  aCol 
)
inlineoverrideprotected

Definition at line 820 of file pcb_net_inspector_panel_data_model.h.

◆ updateAllItems()

void PCB_NET_INSPECTOR_PANEL::DATA_MODEL::updateAllItems ( )
inline

Definition at line 635 of file pcb_net_inspector_panel_data_model.h.

References m_items.

◆ updateItem()

void PCB_NET_INSPECTOR_PANEL::DATA_MODEL::updateItem ( const std::optional< LIST_ITEM_ITER > &  aRow)
inline

Definition at line 621 of file pcb_net_inspector_panel_data_model.h.

References resortIfChanged().

◆ valueAt()

wxVariant PCB_NET_INSPECTOR_PANEL::DATA_MODEL::valueAt ( unsigned int  aCol,
unsigned int  aRow 
) const
inline

Definition at line 411 of file pcb_net_inspector_panel_data_model.h.

References GetValue(), and m_items.

Member Data Documentation

◆ m_custom_group_map

std::map<wxString, LIST_ITEM*> PCB_NET_INSPECTOR_PANEL::DATA_MODEL::m_custom_group_map
private

Map of custom group names to their representative list item.

Definition at line 893 of file pcb_net_inspector_panel_data_model.h.

Referenced by addCustomGroups(), and addItem().

◆ m_items

std::vector<std::unique_ptr<LIST_ITEM> > PCB_NET_INSPECTOR_PANEL::DATA_MODEL::m_items
private

◆ m_parent

PCB_NET_INSPECTOR_PANEL& PCB_NET_INSPECTOR_PANEL::DATA_MODEL::m_parent
private

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