|
KiCad PCB EDA Suite
|
Container for NETINFO_ITEM elements, which are the nets. More...
#include <netinfo.h>
Classes | |
| class | iterator |
| Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString, NETINFO_ITEM*> More... | |
Public Member Functions | |
| NETINFO_LIST (BOARD *aParent) | |
| ~NETINFO_LIST () | |
| NETINFO_ITEM * | GetNetItem (int aNetCode) const |
| NETINFO_ITEM * | GetNetItem (const wxString &aNetName) const |
| unsigned | GetNetCount () const |
| const NETNAMES_MAP & | NetsByName () const |
| Return the name map, at least for python. | |
| const NETCODES_MAP & | NetsByNetcode () const |
| Return the netcode map, at least for python. | |
| void | RebuildDisplayNetnames () const |
| bool | RenameNets (const std::map< wxString, wxString > &aNewNames, REPORTER &aReporter) |
| Rename nets in place, keeping the name lookup in sync. | |
| iterator | begin () const |
| iterator | end () const |
| BOARD * | GetParent () const |
Static Public Member Functions | |
| static NETINFO_ITEM * | OrphanedItem () |
| NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net list available. | |
Public Attributes | |
| bool | m_DisplayNetnamesDirty |
Static Public Attributes | |
| static const int | UNCONNECTED = 0 |
| Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are actually not connected items. | |
| static const int | ORPHANED = -1 |
| Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) when calling SetNetCode on board connected items. | |
Protected Member Functions | |
| void | AppendNet (NETINFO_ITEM *aNewElement) |
| Add aNewElement to the end of the net list. | |
| void | RemoveNet (NETINFO_ITEM *aNet) |
| Remove a net from the net list. | |
| void | RemoveUnusedNets (BOARD_COMMIT *aCommit) |
Private Member Functions | |
| void | clear () |
| Delete the list of nets (and free memory). | |
| void | detachAll () |
| Drop all entries from the lookup maps without freeing the items. | |
| void | buildListOfNets () |
| Rebuild the list of NETINFO_ITEMs. | |
| int | getFreeNetCode () |
| Return the first available net code that is not used by any other net. | |
Private Attributes | |
| BOARD * | m_parent |
| NETNAMES_MAP | m_netNames |
| map of <wxString, NETINFO_ITEM*>, is NETINFO_ITEM owner | |
| NETCODES_MAP | m_netCodes |
| map of <int, NETINFO_ITEM*> is NOT owner | |
| int | m_newNetCode |
| possible value for new net code assignment | |
Friends | |
| class | BOARD |
Container for NETINFO_ITEM elements, which are the nets.
| NETINFO_LIST::NETINFO_LIST | ( | BOARD * | aParent | ) |
Definition at line 39 of file netinfo_list.cpp.
References AppendNet(), BOARD, m_newNetCode, and m_parent.
| NETINFO_LIST::~NETINFO_LIST | ( | ) |
Definition at line 48 of file netinfo_list.cpp.
References clear().
|
protected |
Add aNewElement to the end of the net list.
Negative net code means it is going to be auto-assigned.
Definition at line 154 of file netinfo_list.cpp.
References getFreeNetCode(), NETINFO_ITEM::GetNetCode(), GetNetItem(), NETINFO_ITEM::GetNetname(), m_DisplayNetnamesDirty, NETINFO_ITEM::m_netCode, m_netCodes, and m_netNames.
Referenced by NETINFO_LIST().
|
inline |
Definition at line 350 of file netinfo.h.
References m_netNames.
Referenced by DSN::SPECCTRA_DB::FromBOARD().
|
private |
Rebuild the list of NETINFO_ITEMs.
The list is sorted by names.
Definition at line 184 of file netinfo_list.cpp.
References NETINFO_ITEM::Clear(), NETINFO_ITEM::GetNetChain(), NETINFO_ITEM::GetNetCode(), GetNetCount(), NETINFO_ITEM::GetTerminalPadUuid(), m_parent, NETINFO_ITEM::SetNetChain(), and NETINFO_ITEM::SetTerminalPadUuid().
|
private |
Delete the list of nets (and free memory).
Definition at line 54 of file netinfo_list.cpp.
References detachAll(), and m_netNames.
Referenced by ~NETINFO_LIST().
|
private |
Drop all entries from the lookup maps without freeing the items.
Used when ownership of the contained NETINFO_ITEMs is being transferred to a caller that will free them after some intermediate operation (for example, after dispatching listener notifications that need live pointers).
Definition at line 65 of file netinfo_list.cpp.
References m_netCodes, m_netNames, and m_newNetCode.
Referenced by clear().
|
inline |
Definition at line 355 of file netinfo.h.
References m_netNames.
Referenced by DSN::SPECCTRA_DB::FromBOARD().
|
private |
Return the first available net code that is not used by any other net.
Definition at line 305 of file netinfo_list.cpp.
References m_netCodes, and m_newNetCode.
Referenced by AppendNet().
|
inline |
Definition at line 254 of file netinfo.h.
References m_netNames.
Referenced by buildListOfNets(), FABMASTER::loadZones(), and BOARD::operator==().
| NETINFO_ITEM * NETINFO_LIST::GetNetItem | ( | const wxString & | aNetName | ) | const |
| aNetName | net name to identify a given NETINFO_ITEM. |
Definition at line 84 of file netinfo_list.cpp.
References m_netNames, and result.
| NETINFO_ITEM * NETINFO_LIST::GetNetItem | ( | int | aNetCode | ) | const |
| aNetCode | netcode to identify a given NETINFO_ITEM. |
Definition at line 73 of file netinfo_list.cpp.
References m_netCodes, and result.
Referenced by AppendNet(), BOARD_EDITOR_CONTROL::AssignNetclass(), DRAWING_TOOL::DrawVia(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetNetClassForNets(), PCB_EDIT_FRAME::LoadProjectSettings(), RenameNets(), PCB_EDIT_FRAME::SaveProjectLocalSettings(), and PCB_EDIT_FRAME::saveProjectSettings().
|
inline |
|
inline |
Return the name map, at least for python.
Definition at line 257 of file netinfo.h.
References m_netNames.
Referenced by FABMASTER::loadEtch(), FABMASTER::loadFootprints(), FABMASTER::loadVias(), FABMASTER::loadZone(), BOARD::operator==(), NET_GRID_TABLE::Rebuild(), and FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard().
|
inline |
Return the netcode map, at least for python.
Definition at line 260 of file netinfo.h.
References m_netCodes.
Referenced by PCB_PROPERTIES_PANEL::updateLists().
|
inlinestatic |
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net list available.
Definition at line 288 of file netinfo.h.
References UNCONNECTED.
Referenced by BOOST_AUTO_TEST_CASE(), PNS_KICAD_IFACE::createBoardItem(), BOARD::FindNet(), PNS_KICAD_IFACE_BASE::GetOrphanedNetHandle(), PCB_IO_GEDA::parseLayer(), PCB_IO_GEDA::parseVia(), PCB_CONTROL::Paste(), and BOARD_CONNECTED_ITEM::SetNetCode().
| void NETINFO_LIST::RebuildDisplayNetnames | ( | ) | const |
Definition at line 229 of file netinfo_list.cpp.
References NETINFO_ITEM::m_displayNetname, m_DisplayNetnamesDirty, NETINFO_ITEM::m_netname, NETINFO_ITEM::m_shortNetname, and UnescapeString().
|
protected |
Remove a net from the net list.
Definition at line 95 of file netinfo_list.cpp.
References m_DisplayNetnamesDirty, NETINFO_ITEM::m_netCode, m_netCodes, m_netNames, and m_newNetCode.
|
protected |
Definition at line 128 of file netinfo_list.cpp.
References m_DisplayNetnamesDirty, m_netCodes, m_netNames, and COMMIT::Removed().
| bool NETINFO_LIST::RenameNets | ( | const std::map< wxString, wxString > & | aNewNames, |
| REPORTER & | aReporter ) |
Rename nets in place, keeping the name lookup in sync.
Net codes, item connectivity and net ownership are untouched, so renaming never moves copper between nets. Source names that no net carries are ignored. The whole batch is rejected, leaving every net unchanged, if a target name is empty, names the unconnected net, or collides with another net.
| aNewNames | maps each existing net name to the name it should carry. |
| aReporter | receives the reason a rejected batch was rejected. |
Definition at line 317 of file netinfo_list.cpp.
References _, NETINFO_ITEM::GetNetCode(), GetNetItem(), m_DisplayNetnamesDirty, m_netNames, REPORTER::Report(), RPT_SEVERITY_ERROR, and traceImportNetNames.
|
friend |
Definition at line 232 of file netinfo.h.
References BOARD.
Referenced by BOARD, GetParent(), and NETINFO_LIST().
|
mutable |
Definition at line 407 of file netinfo.h.
Referenced by AppendNet(), RebuildDisplayNetnames(), RemoveNet(), RemoveUnusedNets(), and RenameNets().
|
private |
map of <int, NETINFO_ITEM*> is NOT owner
Definition at line 413 of file netinfo.h.
Referenced by AppendNet(), detachAll(), getFreeNetCode(), GetNetItem(), NetsByNetcode(), RemoveNet(), and RemoveUnusedNets().
|
private |
map of <wxString, NETINFO_ITEM*>, is NETINFO_ITEM owner
Definition at line 412 of file netinfo.h.
Referenced by AppendNet(), begin(), clear(), detachAll(), end(), GetNetCount(), GetNetItem(), NetsByName(), RemoveNet(), RemoveUnusedNets(), and RenameNets().
|
private |
possible value for new net code assignment
Definition at line 415 of file netinfo.h.
Referenced by detachAll(), getFreeNetCode(), NETINFO_LIST(), and RemoveNet().
|
private |
Definition at line 410 of file netinfo.h.
Referenced by buildListOfNets(), GetParent(), and NETINFO_LIST().
|
static |
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) when calling SetNetCode on board connected items.
Definition at line 284 of file netinfo.h.
Referenced by FOOTPRINT::ClearAllNets(), DRAWING_TOOL::DrawVia(), PCB_IO_KICAD_SEXPR_PARSER::parsePAD(), BOARD::SanitizeNetcodes(), and PANEL_SETUP_ZONES::TransferDataFromWindow().
|
static |
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are actually not connected items.
Definition at line 280 of file netinfo.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), IPC356D_WRITER::build_pad_testpoints(), ALLEGRO::BOARD_BUILDER::buildFootprint(), ALLEGRO::BOARD_BUILDER::buildZone(), ALTIUM_PCB_IMPORT_FIXTURE::convertConnectedArc(), TEARDROP_MANAGER::copperNetcode(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), BOARD::ExchangeFootprint(), BOARD::FindNet(), ALTIUM_PCB::GetNetCode(), graphicNetCode(), GENERAL_COLLECTOR::Inspect(), PCB_IO_EAGLE::loadPlain(), PCB_IO_KICAD_LEGACY::loadZONE_CONTAINER(), ROUTER_TOOL::onViaStackCommand(), OrphanedItem(), PCB_IO_GEDA::parseLayer(), PCB_IO_KICAD_SEXPR_PARSER::parseNETINFO_ITEM(), PCB_IO_KICAD_SEXPR_PARSER::parseZONE(), BOARD::Remove(), PCB_SELECTION_CONDITIONS::sameNetFunc(), BOARD::SetAreasNetCodesFromNetNames(), PAD::SetAttribute(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), BOARD_NETLIST_UPDATER::updateComponentPadConnections(), PCB_CONTROL::UpdateMessagePanel(), and PCB_TRACK::ViewGetLOD().