KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PIN_TABLE_DATA_MODEL Class Reference
Inheritance diagram for PIN_TABLE_DATA_MODEL:
WX_GRID_TABLE_BASE

Public Member Functions

 PIN_TABLE_DATA_MODEL (SYMBOL_EDIT_FRAME *aFrame, DIALOG_LIB_EDIT_PIN_TABLE *aPinTable, LIB_SYMBOL *aSymbol, const std::vector< SCH_PIN * > &aOrigSelectedPins)
 
 ~PIN_TABLE_DATA_MODEL ()
 
void onUnitsChanged (wxCommandEvent &aEvent)
 
void SetUnitFilter (int aFilter)
 
void SetBodyStyleFilter (int aFilter)
 
void SetFilterBySelection (bool aFilter)
 
int GetNumberRows () override
 
int GetNumberCols () override
 
wxString GetColLabelValue (int aCol) override
 
bool IsEmptyCell (int row, int col) override
 
wxString GetValue (int aRow, int aCol) override
 
void SetValue (int aRow, int aCol, const wxString &aValue) override
 
void RebuildRows (const std::vector< SCH_PIN * > &aPins, bool groupByName, bool groupBySelection)
 
void SortRows (int aSortCol, bool ascending)
 
void SortPins (std::vector< SCH_PIN * > &aRow)
 
void AppendRow (SCH_PIN *aPin)
 
std::vector< SCH_PIN * > RemoveRow (int aRow)
 
std::vector< SCH_PIN * > GetRowPins (int aRow)
 
bool IsEdited ()
 
void SetColAttr (wxGridCellAttr *aAttr, int aCol) override
 
wxGridCellAttr * GetAttr (int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
 
virtual bool HasRowLabelExpanders () const
 Show grouping controls in the row headers instead of row numbers.
 
virtual ROW_STATE GetRowState (int aRow) const
 
virtual bool HasUndoStateSerialization () const
 Optional identity-based serialization for the host dialog's Ctrl+Z/Ctrl+Y.
 
virtual wxString SerializeUndoState () const
 
virtual void RestoreUndoState (const wxString &aState)
 
void Clear () override
 

Static Public Member Functions

static wxString GetValue (const std::vector< SCH_PIN * > &pins, int aCol, EDA_DRAW_FRAME *aParentFrame)
 
static int findRow (const std::vector< std::vector< SCH_PIN * > > &aRowSet, const wxString &aName)
 
static bool compare (const std::vector< SCH_PIN * > &lhs, const std::vector< SCH_PIN * > &rhs, int sortCol, bool ascending, EDA_DRAW_FRAME *parentFrame)
 

Protected Member Functions

wxGridCellAttr * enhanceAttr (wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
 

Protected Attributes

std::map< int, wxGridCellAttr * > m_colAttrs
 

Private Attributes

SYMBOL_EDIT_FRAME * m_frame
 
std::vector< std::vector< SCH_PIN * > > m_rows
 
int m_unitFilter
 
int m_bodyStyleFilter
 
bool m_filterBySelection
 
bool m_edited
 
DIALOG_LIB_EDIT_PIN_TABLE * m_pinTable
 
LIB_SYMBOL * m_symbol
 
const std::vector< SCH_PIN * > & m_origSelectedPins
 The pins in the symbol that are selected at dialog start.
 
std::unique_ptr< NUMERIC_EVALUATOR > m_eval
 
std::map< std::pair< std::vector< SCH_PIN * >, int >, wxString > m_evalOriginal
 

Detailed Description

Definition at line 330 of file dialog_lib_edit_pin_table.cpp.

Constructor & Destructor Documentation

◆ PIN_TABLE_DATA_MODEL()

PIN_TABLE_DATA_MODEL::PIN_TABLE_DATA_MODEL ( SYMBOL_EDIT_FRAME * aFrame,
DIALOG_LIB_EDIT_PIN_TABLE * aPinTable,
LIB_SYMBOL * aSymbol,
const std::vector< SCH_PIN * > & aOrigSelectedPins )
inline

◆ ~PIN_TABLE_DATA_MODEL()

PIN_TABLE_DATA_MODEL::~PIN_TABLE_DATA_MODEL ( )
inline

Definition at line 349 of file dialog_lib_edit_pin_table.cpp.

References m_frame, and onUnitsChanged().

Member Function Documentation

◆ AppendRow()

void PIN_TABLE_DATA_MODEL::AppendRow ( SCH_PIN * aPin)
inline

Definition at line 759 of file dialog_lib_edit_pin_table.cpp.

References m_edited, and m_rows.

◆ Clear()

void WX_GRID_TABLE_BASE::Clear ( )
inlineoverrideinherited

Definition at line 122 of file wx_grid.h.

◆ compare()

static bool PIN_TABLE_DATA_MODEL::compare ( const std::vector< SCH_PIN * > & lhs,
const std::vector< SCH_PIN * > & rhs,
int sortCol,
bool ascending,
EDA_DRAW_FRAME * parentFrame )
inlinestatic

◆ enhanceAttr()

wxGridCellAttr * WX_GRID_TABLE_BASE::enhanceAttr ( wxGridCellAttr * aInputAttr,
int aRow,
int aCol,
wxGridCellAttr::wxAttrKind aKind )
protectedinherited

◆ findRow()

static int PIN_TABLE_DATA_MODEL::findRow ( const std::vector< std::vector< SCH_PIN * > > & aRowSet,
const wxString & aName )
inlinestatic

Definition at line 543 of file dialog_lib_edit_pin_table.cpp.

Referenced by RebuildRows().

◆ GetAttr()

wxGridCellAttr * WX_GRID_TABLE_BASE::GetAttr ( int aRow,
int aCol,
wxGridCellAttr::wxAttrKind aKind )
inlineoverrideinherited

◆ GetColLabelValue()

wxString PIN_TABLE_DATA_MODEL::GetColLabelValue ( int aCol)
inlineoverride

Definition at line 369 of file dialog_lib_edit_pin_table.cpp.

References GetPinTableColLabel().

◆ GetNumberCols()

int PIN_TABLE_DATA_MODEL::GetNumberCols ( )
inlineoverride

Definition at line 367 of file dialog_lib_edit_pin_table.cpp.

References COL_COUNT.

◆ GetNumberRows()

int PIN_TABLE_DATA_MODEL::GetNumberRows ( )
inlineoverride

Definition at line 366 of file dialog_lib_edit_pin_table.cpp.

References m_rows.

◆ GetRowPins()

std::vector< SCH_PIN * > PIN_TABLE_DATA_MODEL::GetRowPins ( int aRow)
inline

Definition at line 790 of file dialog_lib_edit_pin_table.cpp.

References m_rows.

◆ GetRowState()

◆ GetValue() [1/2]

static wxString PIN_TABLE_DATA_MODEL::GetValue ( const std::vector< SCH_PIN * > & pins,
int aCol,
EDA_DRAW_FRAME * aParentFrame )
inlinestatic

◆ GetValue() [2/2]

wxString PIN_TABLE_DATA_MODEL::GetValue ( int aRow,
int aCol )
inlineoverride

Definition at line 379 of file dialog_lib_edit_pin_table.cpp.

References GetValue(), grid, m_evalOriginal, m_frame, and m_rows.

Referenced by compare(), and GetValue().

◆ HasRowLabelExpanders()

virtual bool WX_GRID_TABLE_BASE::HasRowLabelExpanders ( ) const
inlinevirtualinherited

Show grouping controls in the row headers instead of row numbers.

Reimplemented in FIELDS_TABLE_DATA_MODEL_BASE.

Definition at line 108 of file wx_grid.h.

◆ HasUndoStateSerialization()

virtual bool WX_GRID_TABLE_BASE::HasUndoStateSerialization ( ) const
inlinevirtualinherited

Optional identity-based serialization for the host dialog's Ctrl+Z/Ctrl+Y.

The dialog's generic grid undo snapshots cells by (row, col) position, which is wrong for tables whose rows can regroup/sort/reorder. A table that returns true here is asked to serialize and restore its own state by stable identity instead.

Reimplemented in FIELDS_TABLE_DATA_MODEL_BASE.

Definition at line 118 of file wx_grid.h.

◆ IsEdited()

bool PIN_TABLE_DATA_MODEL::IsEdited ( )
inline

Definition at line 795 of file dialog_lib_edit_pin_table.cpp.

References m_edited.

◆ IsEmptyCell()

bool PIN_TABLE_DATA_MODEL::IsEmptyCell ( int row,
int col )
inlineoverride

Definition at line 374 of file dialog_lib_edit_pin_table.cpp.

◆ onUnitsChanged()

void PIN_TABLE_DATA_MODEL::onUnitsChanged ( wxCommandEvent & aEvent)
inline

Definition at line 354 of file dialog_lib_edit_pin_table.cpp.

Referenced by PIN_TABLE_DATA_MODEL(), and ~PIN_TABLE_DATA_MODEL().

◆ RebuildRows()

void PIN_TABLE_DATA_MODEL::RebuildRows ( const std::vector< SCH_PIN * > & aPins,
bool groupByName,
bool groupBySelection )
inline

◆ RemoveRow()

std::vector< SCH_PIN * > PIN_TABLE_DATA_MODEL::RemoveRow ( int aRow)
inline

Definition at line 774 of file dialog_lib_edit_pin_table.cpp.

References m_edited, and m_rows.

◆ RestoreUndoState()

virtual void WX_GRID_TABLE_BASE::RestoreUndoState ( const wxString & aState)
inlinevirtualinherited

Reimplemented in FIELDS_TABLE_DATA_MODEL_BASE.

Definition at line 120 of file wx_grid.h.

◆ SerializeUndoState()

virtual wxString WX_GRID_TABLE_BASE::SerializeUndoState ( ) const
inlinevirtualinherited

Reimplemented in FIELDS_TABLE_DATA_MODEL_BASE.

Definition at line 119 of file wx_grid.h.

◆ SetBodyStyleFilter()

void PIN_TABLE_DATA_MODEL::SetBodyStyleFilter ( int aFilter)
inline

Definition at line 363 of file dialog_lib_edit_pin_table.cpp.

References m_bodyStyleFilter.

◆ SetColAttr()

void WX_GRID_TABLE_BASE::SetColAttr ( wxGridCellAttr * aAttr,
int aCol )
inlineoverrideinherited

Definition at line 90 of file wx_grid.h.

References m_colAttrs.

Referenced by DIALOG_FIELDS_TABLE::SetupColumnProperties().

◆ SetFilterBySelection()

void PIN_TABLE_DATA_MODEL::SetFilterBySelection ( bool aFilter)
inline

Definition at line 364 of file dialog_lib_edit_pin_table.cpp.

References m_filterBySelection.

◆ SetUnitFilter()

void PIN_TABLE_DATA_MODEL::SetUnitFilter ( int aFilter)
inline

Definition at line 362 of file dialog_lib_edit_pin_table.cpp.

References m_unitFilter.

◆ SetValue()

◆ SortPins()

void PIN_TABLE_DATA_MODEL::SortPins ( std::vector< SCH_PIN * > & aRow)
inline

Definition at line 750 of file dialog_lib_edit_pin_table.cpp.

Referenced by RebuildRows().

◆ SortRows()

void PIN_TABLE_DATA_MODEL::SortRows ( int aSortCol,
bool ascending )
inline

Definition at line 740 of file dialog_lib_edit_pin_table.cpp.

References m_rows.

Referenced by RebuildRows().

Member Data Documentation

◆ m_bodyStyleFilter

int PIN_TABLE_DATA_MODEL::m_bodyStyleFilter
private

◆ m_colAttrs

std::map<int, wxGridCellAttr*> WX_GRID_TABLE_BASE::m_colAttrs
protectedinherited

◆ m_edited

bool PIN_TABLE_DATA_MODEL::m_edited
private

◆ m_eval

std::unique_ptr<NUMERIC_EVALUATOR> PIN_TABLE_DATA_MODEL::m_eval
private

Definition at line 819 of file dialog_lib_edit_pin_table.cpp.

Referenced by PIN_TABLE_DATA_MODEL(), and SetValue().

◆ m_evalOriginal

std::map< std::pair<std::vector<SCH_PIN*>, int>, wxString > PIN_TABLE_DATA_MODEL::m_evalOriginal
private

Definition at line 820 of file dialog_lib_edit_pin_table.cpp.

Referenced by GetValue(), and SetValue().

◆ m_filterBySelection

bool PIN_TABLE_DATA_MODEL::m_filterBySelection
private

◆ m_frame

SYMBOL_EDIT_FRAME* PIN_TABLE_DATA_MODEL::m_frame
private

◆ m_origSelectedPins

const std::vector<SCH_PIN*>& PIN_TABLE_DATA_MODEL::m_origSelectedPins
private

The pins in the symbol that are selected at dialog start.

Definition at line 817 of file dialog_lib_edit_pin_table.cpp.

Referenced by PIN_TABLE_DATA_MODEL(), and RebuildRows().

◆ m_pinTable

DIALOG_LIB_EDIT_PIN_TABLE* PIN_TABLE_DATA_MODEL::m_pinTable
private

Definition at line 813 of file dialog_lib_edit_pin_table.cpp.

Referenced by PIN_TABLE_DATA_MODEL(), and SetValue().

◆ m_rows

std::vector<std::vector<SCH_PIN*> > PIN_TABLE_DATA_MODEL::m_rows
private

◆ m_symbol

LIB_SYMBOL* PIN_TABLE_DATA_MODEL::m_symbol
private

Definition at line 814 of file dialog_lib_edit_pin_table.cpp.

Referenced by PIN_TABLE_DATA_MODEL(), and SetValue().

◆ m_unitFilter

int PIN_TABLE_DATA_MODEL::m_unitFilter
private

Definition at line 807 of file dialog_lib_edit_pin_table.cpp.

Referenced by PIN_TABLE_DATA_MODEL(), RebuildRows(), and SetUnitFilter().


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