|
KiCad PCB EDA Suite
|
Composed widget that edits a symbol's named pin maps and the footprint each is bound to. More...
#include <panel_symbol_pin_map.h>
Public Member Functions | |
| PANEL_SYMBOL_PIN_MAP (wxWindow *aParent) | |
| ~PANEL_SYMBOL_PIN_MAP () override | |
| void | SetSymbol (LIB_SYMBOL *aSymbol) |
| Load the editable state from aSymbol. | |
| bool | TransferDataToWindow () override |
| bool | TransferDataFromWindow () override |
| void | ApplyToSymbol (LIB_SYMBOL *aSymbol) |
| Write the edited pin maps and associations into aSymbol. | |
| bool | CommitPendingChanges () |
| Commit any in-progress grid cell edit;. | |
| void | ResetColumnToIdentity (int aCol) |
| Set every cell in pad column aCol back to its row's symbol pin number (1:1). | |
| void | CopyColumn (int aSrcCol, int aDstCol) |
| Copy every pad value from column aSrcCol into column aDstCol. | |
| void | RenameColumn (int aCol) |
| Prompt for a new name for column aCol's map and update every reference to it. | |
| wxString | GetColumnMapName (int aCol) const |
| void | ValidateCell (int aRow, int aCol) |
| Re-evaluate the colour of pad cell (aRow, aCol) from its current contents. | |
Static Public Attributes | |
| static constexpr int | FIXED_COLS = 3 |
| Number of fixed leading columns (unit, pin number, pin name). | |
Protected Member Functions | |
| void | OnAddMap (wxCommandEvent &aEvent) override |
| void | OnRemoveMap (wxCommandEvent &aEvent) override |
| void | OnSizeGrid (wxSizeEvent &aEvent) override |
Protected Attributes | |
| WX_GRID * | m_grid |
| STD_BITMAP_BUTTON * | m_addMapButton |
| STD_BITMAP_BUTTON * | m_removeMapButton |
Private Member Functions | |
| void | onCellChanged (wxGridEvent &aEvent) |
| void | onLabelDClick (wxGridEvent &aEvent) |
| Double-clicking a map column's header opens its rename dialog. | |
| void | applyColumnFootprint (int aCol, const wxString &aFootprintId) |
| Bind (or clear, when empty) the footprint entered in column aCol's footprint cell. | |
| void | rebuildGrid () |
| Rebuild the whole grid from the working model. | |
| void | adjustGridColumns () |
| Resize the pad columns to fill the available width. | |
| void | harvestGrid () |
| Read every pad cell back into the working pin maps. | |
| void | validateAllCells () |
| Re-evaluate the colour of every pad cell. | |
| wxString | makeUniqueMapName () const |
| const std::set< wxString > & | padNumbersFor (const wxString &aFootprintId) |
Private Attributes | |
| LIB_SYMBOL * | m_symbol |
| std::vector< wxString > | m_pinNumbers |
| PIN_MAP_SET | m_pinMaps |
| std::vector< ASSOCIATED_FOOTPRINT > | m_associations |
| std::unique_ptr< PIN_MAP_GRID_TRICKS > | m_gridTricks |
| std::map< wxString, std::set< wxString > > | m_footprintPads |
Composed widget that edits a symbol's named pin maps and the footprint each is bound to.
Each grid column is a named pin map. Row 0 binds a footprint to the map; the remaining rows are the symbol's logical pins, whose cells carry the pad each pin maps to. A cell left at its pin number is identity and is not stored. The leading columns (unit, number, name) are read-only.
Definition at line 44 of file panel_symbol_pin_map.h.
| PANEL_SYMBOL_PIN_MAP::PANEL_SYMBOL_PIN_MAP | ( | wxWindow * | aParent | ) |
Definition at line 134 of file panel_symbol_pin_map.cpp.
References _, FIXED_COLS, KiBitmapBundle(), PANEL_SYMBOL_PIN_MAP_BASE::m_addMapButton, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_gridTricks, PANEL_SYMBOL_PIN_MAP_BASE::m_removeMapButton, m_symbol, onCellChanged(), onLabelDClick(), PANEL_SYMBOL_PIN_MAP_BASE::PANEL_SYMBOL_PIN_MAP_BASE(), small_plus, and small_trash.
|
override |
Definition at line 160 of file panel_symbol_pin_map.cpp.
References PANEL_SYMBOL_PIN_MAP_BASE::m_grid.
|
private |
Resize the pad columns to fill the available width.
Definition at line 580 of file panel_symbol_pin_map.cpp.
References FIXED_COLS, and PANEL_SYMBOL_PIN_MAP_BASE::m_grid.
Referenced by OnSizeGrid(), and rebuildGrid().
|
private |
Bind (or clear, when empty) the footprint entered in column aCol's footprint cell.
Definition at line 511 of file panel_symbol_pin_map.cpp.
References _, GetColumnMapName(), LIB_ID::GetUniStringLibId(), m_associations, ASSOCIATED_FOOTPRINT::m_FootprintLibId, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, ASSOCIATED_FOOTPRINT::m_MapName, LIB_ID::Parse(), and ValidateCell().
Referenced by onCellChanged().
| void PANEL_SYMBOL_PIN_MAP::ApplyToSymbol | ( | LIB_SYMBOL * | aSymbol | ) |
Write the edited pin maps and associations into aSymbol.
Provided so the host dialog can target a symbol other than the one used to populate the panel. Equivalent to TransferDataFromWindow() when given the same symbol.
Definition at line 215 of file panel_symbol_pin_map.cpp.
References harvestGrid(), m_associations, m_pinMaps, LIB_SYMBOL::SetAssociatedFootprints(), and LIB_SYMBOL::SetPinMaps().
Referenced by TransferDataFromWindow().
| bool PANEL_SYMBOL_PIN_MAP::CommitPendingChanges | ( | ) |
Commit any in-progress grid cell edit;.
Definition at line 209 of file panel_symbol_pin_map.cpp.
References PANEL_SYMBOL_PIN_MAP_BASE::m_grid.
| void PANEL_SYMBOL_PIN_MAP::CopyColumn | ( | int | aSrcCol, |
| int | aDstCol ) |
Copy every pad value from column aSrcCol into column aDstCol.
Definition at line 448 of file panel_symbol_pin_map.cpp.
References PANEL_SYMBOL_PIN_MAP_BASE::m_grid, and ValidateCell().
| wxString PANEL_SYMBOL_PIN_MAP::GetColumnMapName | ( | int | aCol | ) | const |
Definition at line 421 of file panel_symbol_pin_map.cpp.
References FIXED_COLS, index, and m_pinMaps.
Referenced by applyColumnFootprint(), and RenameColumn().
|
private |
Read every pad cell back into the working pin maps.
Definition at line 605 of file panel_symbol_pin_map.cpp.
References PIN_MAP_SET::AddOrReplace(), FIXED_COLS, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_pinMaps, m_pinNumbers, pad, and PIN_MAP::SetEntry().
Referenced by ApplyToSymbol(), OnAddMap(), OnRemoveMap(), and RenameColumn().
|
private |
Definition at line 635 of file panel_symbol_pin_map.cpp.
References m_pinMaps.
Referenced by OnAddMap().
|
overrideprotectedvirtual |
Reimplemented from PANEL_SYMBOL_PIN_MAP_BASE.
Definition at line 676 of file panel_symbol_pin_map.cpp.
References harvestGrid(), PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_pinMaps, makeUniqueMapName(), and rebuildGrid().
|
private |
Definition at line 397 of file panel_symbol_pin_map.cpp.
References applyColumnFootprint(), FIXED_COLS, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, and ValidateCell().
Referenced by PANEL_SYMBOL_PIN_MAP().
|
private |
Double-clicking a map column's header opens its rename dialog.
Definition at line 412 of file panel_symbol_pin_map.cpp.
References FIXED_COLS, and RenameColumn().
Referenced by PANEL_SYMBOL_PIN_MAP().
|
overrideprotectedvirtual |
Reimplemented from PANEL_SYMBOL_PIN_MAP_BASE.
Definition at line 687 of file panel_symbol_pin_map.cpp.
References _, FIXED_COLS, harvestGrid(), index, IsOK(), m_associations, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_pinMaps, and rebuildGrid().
|
overrideprotectedvirtual |
Reimplemented from PANEL_SYMBOL_PIN_MAP_BASE.
Definition at line 745 of file panel_symbol_pin_map.cpp.
References adjustGridColumns().
|
private |
Definition at line 649 of file panel_symbol_pin_map.cpp.
References KIWAY::FACE_CVPCB, KIFACE_FOOTPRINT_PAD_NUMBERS, and m_footprintPads.
Referenced by ValidateCell().
|
private |
Rebuild the whole grid from the working model.
Definition at line 227 of file panel_symbol_pin_map.cpp.
References _, adjustGridColumns(), FIXED_COLS, m_associations, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_pinMaps, m_pinNumbers, PANEL_SYMBOL_PIN_MAP_BASE::m_removeMapButton, m_symbol, pad, and validateAllCells().
Referenced by OnAddMap(), OnRemoveMap(), RenameColumn(), and TransferDataToWindow().
| void PANEL_SYMBOL_PIN_MAP::RenameColumn | ( | int | aCol | ) |
Prompt for a new name for column aCol's map and update every reference to it.
Definition at line 469 of file panel_symbol_pin_map.cpp.
References _, GetColumnMapName(), harvestGrid(), m_associations, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_pinMaps, and rebuildGrid().
Referenced by onLabelDClick().
| void PANEL_SYMBOL_PIN_MAP::ResetColumnToIdentity | ( | int | aCol | ) |
Set every cell in pad column aCol back to its row's symbol pin number (1:1).
Definition at line 433 of file panel_symbol_pin_map.cpp.
References PANEL_SYMBOL_PIN_MAP_BASE::m_grid, and ValidateCell().
| void PANEL_SYMBOL_PIN_MAP::SetSymbol | ( | LIB_SYMBOL * | aSymbol | ) |
Load the editable state from aSymbol.
The symbol is not retained; only its pin list, pin maps and associated footprints are copied into the working model.
Definition at line 166 of file panel_symbol_pin_map.cpp.
References m_associations, m_pinMaps, m_pinNumbers, and m_symbol.
|
override |
Definition at line 197 of file panel_symbol_pin_map.cpp.
References ApplyToSymbol(), PANEL_SYMBOL_PIN_MAP_BASE::m_grid, and m_symbol.
|
override |
Definition at line 190 of file panel_symbol_pin_map.cpp.
References rebuildGrid().
|
private |
Re-evaluate the colour of every pad cell.
Definition at line 327 of file panel_symbol_pin_map.cpp.
References FIXED_COLS, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, and ValidateCell().
Referenced by rebuildGrid().
| void PANEL_SYMBOL_PIN_MAP::ValidateCell | ( | int | aRow, |
| int | aCol ) |
Re-evaluate the colour of pad cell (aRow, aCol) from its current contents.
Definition at line 337 of file panel_symbol_pin_map.cpp.
References ExpandStackedPinNotation(), FIXED_COLS, index, KIPLATFORM::UI::IsDarkTheme(), m_associations, PANEL_SYMBOL_PIN_MAP_BASE::m_grid, m_pinMaps, pad, and padNumbersFor().
Referenced by applyColumnFootprint(), CopyColumn(), onCellChanged(), ResetColumnToIdentity(), and validateAllCells().
|
staticconstexpr |
Number of fixed leading columns (unit, pin number, pin name).
Definition at line 75 of file panel_symbol_pin_map.h.
Referenced by adjustGridColumns(), GetColumnMapName(), harvestGrid(), onCellChanged(), onLabelDClick(), OnRemoveMap(), PANEL_SYMBOL_PIN_MAP(), rebuildGrid(), PIN_MAP_GRID_TRICKS::showPopupMenu(), validateAllCells(), and ValidateCell().
|
protectedinherited |
Definition at line 41 of file panel_symbol_pin_map_base.h.
Referenced by PANEL_SYMBOL_PIN_MAP::PANEL_SYMBOL_PIN_MAP(), PANEL_SYMBOL_PIN_MAP_BASE(), and ~PANEL_SYMBOL_PIN_MAP_BASE().
|
private |
Definition at line 127 of file panel_symbol_pin_map.h.
Referenced by applyColumnFootprint(), ApplyToSymbol(), OnRemoveMap(), rebuildGrid(), RenameColumn(), SetSymbol(), and ValidateCell().
|
private |
Definition at line 129 of file panel_symbol_pin_map.h.
Referenced by padNumbersFor().
|
protectedinherited |
Definition at line 40 of file panel_symbol_pin_map_base.h.
Referenced by PANEL_SYMBOL_PIN_MAP::adjustGridColumns(), PANEL_SYMBOL_PIN_MAP::applyColumnFootprint(), PANEL_SYMBOL_PIN_MAP::CommitPendingChanges(), PANEL_SYMBOL_PIN_MAP::CopyColumn(), PANEL_SYMBOL_PIN_MAP::harvestGrid(), PANEL_SYMBOL_PIN_MAP::OnAddMap(), PANEL_SYMBOL_PIN_MAP::onCellChanged(), PANEL_SYMBOL_PIN_MAP::OnRemoveMap(), PANEL_SYMBOL_PIN_MAP::PANEL_SYMBOL_PIN_MAP(), PANEL_SYMBOL_PIN_MAP_BASE(), PANEL_SYMBOL_PIN_MAP::rebuildGrid(), PANEL_SYMBOL_PIN_MAP::RenameColumn(), PANEL_SYMBOL_PIN_MAP::ResetColumnToIdentity(), PANEL_SYMBOL_PIN_MAP::TransferDataFromWindow(), PANEL_SYMBOL_PIN_MAP::validateAllCells(), PANEL_SYMBOL_PIN_MAP::ValidateCell(), PANEL_SYMBOL_PIN_MAP::~PANEL_SYMBOL_PIN_MAP(), and ~PANEL_SYMBOL_PIN_MAP_BASE().
|
private |
Definition at line 128 of file panel_symbol_pin_map.h.
Referenced by PANEL_SYMBOL_PIN_MAP().
|
private |
Definition at line 126 of file panel_symbol_pin_map.h.
Referenced by ApplyToSymbol(), GetColumnMapName(), harvestGrid(), makeUniqueMapName(), OnAddMap(), OnRemoveMap(), rebuildGrid(), RenameColumn(), SetSymbol(), and ValidateCell().
|
private |
Definition at line 125 of file panel_symbol_pin_map.h.
Referenced by harvestGrid(), rebuildGrid(), and SetSymbol().
|
protectedinherited |
Definition at line 42 of file panel_symbol_pin_map_base.h.
Referenced by PANEL_SYMBOL_PIN_MAP::PANEL_SYMBOL_PIN_MAP(), PANEL_SYMBOL_PIN_MAP_BASE(), PANEL_SYMBOL_PIN_MAP::rebuildGrid(), and ~PANEL_SYMBOL_PIN_MAP_BASE().
|
private |
Definition at line 124 of file panel_symbol_pin_map.h.
Referenced by PANEL_SYMBOL_PIN_MAP(), rebuildGrid(), SetSymbol(), and TransferDataFromWindow().