![]() |
KiCad PCB EDA Suite
|
Update the BOARD with a new netlist. More...
#include <board_netlist_updater.h>
Public Member Functions | |
BOARD_NETLIST_UPDATER (PCB_EDIT_FRAME *aFrame, BOARD *aBoard) | |
~BOARD_NETLIST_UPDATER () | |
bool | UpdateNetlist (NETLIST &aNetlist) |
Update the board's components according to the new netlist. More... | |
void | SetReporter (REPORTER *aReporter) |
Enable "delete single pad nets" option. More... | |
void | SetDeleteSinglePadNets (bool aEnabled) |
Enable warning option if a connectable pad is not found in netlist connectable = pad with a name and on a copper layer. More... | |
void | SetWarnPadNoNetInNetlist (bool aEnabled) |
Enable dry run mode (just report, no changes to PCB). More... | |
void | SetIsDryRun (bool aEnabled) |
Enable replacing footprints with new ones. More... | |
void | SetReplaceFootprints (bool aEnabled) |
Enable removing unused components. More... | |
void | SetDeleteUnusedComponents (bool aEnabled) |
Enable component lookup by timestamp instead of reference. More... | |
void | SetLookupByTimestamp (bool aEnabled) |
std::vector< FOOTPRINT * > | GetAddedComponents () const |
Private Member Functions | |
void | cacheNetname (PAD *aPad, const wxString &aNetname) |
wxString | getNetname (PAD *aPad) |
void | cachePinFunction (PAD *aPad, const wxString &aPinFunction) |
wxString | getPinFunction (PAD *aPad) |
wxPoint | estimateComponentInsertionPosition () |
FOOTPRINT * | addNewComponent (COMPONENT *aComponent) |
FOOTPRINT * | replaceComponent (NETLIST &aNetlist, FOOTPRINT *aPcbComponent, COMPONENT *aNewComponent) |
bool | updateFootprintParameters (FOOTPRINT *aPcbFootprint, COMPONENT *aNetlistComponent) |
bool | updateComponentPadConnections (FOOTPRINT *aFootprint, COMPONENT *aNewComponent) |
void | cacheCopperZoneConnections () |
bool | updateCopperZoneNets (NETLIST &aNetlist) |
bool | deleteUnusedComponents (NETLIST &aNetlist) |
bool | deleteSinglePadNets () |
bool | testConnectivity (NETLIST &aNetlist, std::map< COMPONENT *, FOOTPRINT * > &aFootprintMap) |
Private Attributes | |
PCB_EDIT_FRAME * | m_frame |
BOARD_COMMIT | m_commit |
BOARD * | m_board |
REPORTER * | m_reporter |
std::map< ZONE *, std::vector< PAD * > > | m_zoneConnectionsCache |
std::map< wxString, wxString > | m_oldToNewNets |
std::map< PAD *, wxString > | m_padNets |
std::map< PAD *, wxString > | m_padPinFunctions |
std::vector< FOOTPRINT * > | m_addedComponents |
std::map< wxString, NETINFO_ITEM * > | m_addedNets |
bool | m_deleteSinglePadNets |
bool | m_deleteUnusedComponents |
bool | m_isDryRun |
bool | m_replaceFootprints |
bool | m_lookupByTimestamp |
bool | m_warnForNoNetPads |
int | m_warningCount |
int | m_errorCount |
int | m_newFootprintsCount |
Update the BOARD with a new netlist.
The changes are made to the board are as follows they are not disabled in the status settings in the NETLIST:
Definition at line 71 of file board_netlist_updater.h.
BOARD_NETLIST_UPDATER::BOARD_NETLIST_UPDATER | ( | PCB_EDIT_FRAME * | aFrame, |
BOARD * | aBoard | ||
) |
Definition at line 48 of file board_netlist_updater.cpp.
References NULL_REPORTER::GetInstance(), m_deleteSinglePadNets, m_deleteUnusedComponents, m_errorCount, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_replaceFootprints, m_reporter, m_warnForNoNetPads, and m_warningCount.
BOARD_NETLIST_UPDATER::~BOARD_NETLIST_UPDATER | ( | ) |
Definition at line 68 of file board_netlist_updater.cpp.
Definition at line 134 of file board_netlist_updater.cpp.
References _, COMMIT::Add(), LIB_ID::empty(), estimateComponentInsertionPosition(), LIB_ID::Format(), PCB_BASE_FRAME::GetDisplayOptions(), COMPONENT::GetFPID(), COMPONENT::GetReference(), PCB_BASE_FRAME::LoadFootprint(), m_addedComponents, m_board, m_commit, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_reporter, PCB_DISPLAY_OPTIONS::m_ShowGlobalRatsnest, pad, FOOTPRINT::Pads(), REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, EDA_ITEM::SetParent(), FOOTPRINT::SetPosition(), and UTF8::wx_str().
Referenced by UpdateNetlist().
|
private |
Definition at line 582 of file board_netlist_updater.cpp.
References BOARD::GetConnectivity(), m_board, m_zoneConnectionsCache, and BOARD::Zones().
Referenced by UpdateNetlist().
|
private |
Definition at line 76 of file board_netlist_updater.cpp.
References m_padNets.
Referenced by deleteSinglePadNets(), and updateComponentPadConnections().
|
private |
Definition at line 91 of file board_netlist_updater.cpp.
References m_padPinFunctions.
Referenced by updateComponentPadConnections().
|
private |
Definition at line 772 of file board_netlist_updater.cpp.
References _, BOARD::BuildListOfNets(), cacheNetname(), getNetname(), BOARD::GetPads(), m_board, m_isDryRun, m_reporter, NULL, pad, REPORTER::Report(), RPT_SEVERITY_ACTION, BOARD_CONNECTED_ITEM::SetNetCode(), NETINFO_LIST::UNCONNECTED, UnescapeString(), and BOARD::Zones().
Referenced by UpdateNetlist().
|
private |
|
private |
Definition at line 106 of file board_netlist_updater.cpp.
References EDA_RECT::Centre(), BOARD::GetBoardEdgesBoundingBox(), EDA_RECT::GetBottom(), EDA_RECT::GetHeight(), BOARD::GetPageSettings(), EDA_RECT::GetWidth(), BOARD::IsEmpty(), m_board, and Millimeter2iu().
Referenced by addNewComponent().
|
inline |
Definition at line 130 of file board_netlist_updater.h.
References m_addedComponents.
Referenced by PCB_EDIT_FRAME::OnNetlistChanged().
|
private |
Definition at line 82 of file board_netlist_updater.cpp.
References BOARD_CONNECTED_ITEM::GetNetname(), m_isDryRun, and m_padNets.
Referenced by deleteSinglePadNets(), and updateCopperZoneNets().
|
private |
Definition at line 97 of file board_netlist_updater.cpp.
References PAD::GetPinFunction(), m_isDryRun, and m_padPinFunctions.
|
private |
Definition at line 197 of file board_netlist_updater.cpp.
References _, LIB_ID::empty(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_ID::Format(), COMPONENT::GetFPID(), FOOTPRINT::GetFPID(), COMPONENT::GetReference(), FOOTPRINT::GetReference(), PCB_BASE_FRAME::LoadFootprint(), m_commit, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_reporter, REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, and UTF8::wx_str().
Referenced by UpdateNetlist().
|
inline |
Enable warning option if a connectable pad is not found in netlist connectable = pad with a name and on a copper layer.
Definition at line 94 of file board_netlist_updater.h.
References m_deleteSinglePadNets.
Referenced by PCB_EDIT_FRAME::KiwayMailIn().
|
inline |
Enable component lookup by timestamp instead of reference.
Definition at line 119 of file board_netlist_updater.h.
References m_deleteUnusedComponents.
Referenced by PCB_EDIT_FRAME::KiwayMailIn().
|
inline |
Enable replacing footprints with new ones.
Definition at line 107 of file board_netlist_updater.h.
References m_isDryRun.
|
inline |
Definition at line 125 of file board_netlist_updater.h.
References m_lookupByTimestamp.
Referenced by PCB_EDIT_FRAME::KiwayMailIn().
|
inline |
Enable removing unused components.
Definition at line 113 of file board_netlist_updater.h.
References m_replaceFootprints.
Referenced by PCB_EDIT_FRAME::KiwayMailIn().
|
inline |
Enable "delete single pad nets" option.
Definition at line 88 of file board_netlist_updater.h.
References m_reporter.
Referenced by DIALOG_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Enable dry run mode (just report, no changes to PCB).
Definition at line 101 of file board_netlist_updater.h.
References m_warnForNoNetPads.
Referenced by PCB_EDIT_FRAME::KiwayMailIn().
|
private |
Definition at line 862 of file board_netlist_updater.cpp.
References _, FOOTPRINT::FindPadByName(), LIB_ID::Format(), NETLIST::GetComponent(), NETLIST::GetCount(), FOOTPRINT::GetFPID(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetPinName(), COMPONENT::GetReference(), m_errorCount, m_reporter, REPORTER::Report(), RPT_SEVERITY_ERROR, and UTF8::wx_str().
Referenced by UpdateNetlist().
|
private |
Definition at line 401 of file board_netlist_updater.cpp.
References _, COMMIT::Add(), cacheNetname(), cachePinFunction(), FOOTPRINT::Clone(), copy, BOARD::FindNet(), COMPONENT::GetNet(), COMPONENT_NET::GetNetName(), COMPONENT_NET::GetPinFunction(), COMPONENT_NET::GetPinType(), FOOTPRINT::GetReference(), COMMIT::GetStatus(), COMPONENT_NET::IsValid(), m_addedNets, m_board, m_commit, m_isDryRun, m_oldToNewNets, m_reporter, m_warnForNoNetPads, COMMIT::Modified(), pad, FOOTPRINT::Pads(), REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, NETINFO_ITEM::SetIsCurrent(), NETINFO_LIST::UNCONNECTED, and UnescapeString().
Referenced by UpdateNetlist().
|
private |
Definition at line 594 of file board_netlist_updater.cpp.
References _, BOARD::FindNet(), NETLIST::GetComponent(), NETLIST::GetCount(), BOARD::GetLayerName(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetNetName(), getNetname(), EDA_BASE_FRAME::GetUserUnits(), m_addedNets, m_board, m_commit, m_frame, m_isDryRun, m_oldToNewNets, m_reporter, m_warningCount, m_zoneConnectionsCache, MessageTextFromValue(), COMMIT::Modify(), pad, PCB_VIA_T, REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, BOARD::Tracks(), UnescapeString(), via, and BOARD::Zones().
Referenced by UpdateNetlist().
|
private |
Definition at line 250 of file board_netlist_updater.cpp.
References _, KIID_PATH::AsString(), FOOTPRINT::Clone(), copy, FP_EXCLUDE_FROM_BOM, FOOTPRINT::GetAttributes(), COMPONENT::GetKIIDs(), COMPONENT::GetPath(), FOOTPRINT::GetPath(), COMPONENT::GetProperties(), FOOTPRINT::GetProperties(), COMPONENT::GetReference(), FOOTPRINT::GetReference(), COMMIT::GetStatus(), COMPONENT::GetValue(), FOOTPRINT::GetValue(), m_commit, m_isDryRun, m_reporter, COMMIT::Modified(), REPORTER::Report(), RPT_SEVERITY_ACTION, FOOTPRINT::SetAttributes(), FOOTPRINT::SetPath(), FOOTPRINT::SetProperties(), FOOTPRINT::SetReference(), and FOOTPRINT::SetValue().
Referenced by UpdateNetlist().
bool BOARD_NETLIST_UPDATER::UpdateNetlist | ( | NETLIST & | aNetlist | ) |
Update the board's components according to the new netlist.
See BOARD_NETLIST_UPDATER class description for the details of the process.
aNetlist | the new netlist |
Definition at line 902 of file board_netlist_updater.cpp.
References _, addNewComponent(), cacheCopperZoneConnections(), deleteSinglePadNets(), BOARD::Footprints(), LIB_ID::Format(), FP_BOARD_ONLY, NETLIST::GetComponent(), NETLIST::GetComponentByPath(), NETLIST::GetComponentByReference(), BOARD::GetConnectivity(), NETLIST::GetCount(), COMPONENT::GetFPID(), COMPONENT::GetKIIDs(), BOARD::GetNetInfo(), COMPONENT::GetPath(), COMPONENT::GetProperties(), COMPONENT::GetReference(), m_addedNets, m_board, m_commit, m_deleteSinglePadNets, m_deleteUnusedComponents, m_errorCount, m_frame, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_replaceFootprints, m_reporter, m_warningCount, pad, BOARD_COMMIT::Push(), COMMIT::Remove(), COMMIT::Removed(), NETINFO_LIST::RemoveUnusedNets(), replaceComponent(), REPORTER::Report(), REPORTER::ReportTail(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, PCB_EDIT_FRAME::SaveProjectSettings(), BOARD_COMMIT::SetResolveNetConflicts(), EDA_ITEM::SetStatus(), BOARD::SynchronizeNetsAndNetClasses(), testConnectivity(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UTF8::wx_str().
Referenced by PCB_EDIT_FRAME::KiwayMailIn().
|
private |
Definition at line 172 of file board_netlist_updater.h.
Referenced by addNewComponent(), and GetAddedComponents().
|
private |
Definition at line 173 of file board_netlist_updater.h.
Referenced by updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
|
private |
Definition at line 165 of file board_netlist_updater.h.
Referenced by addNewComponent(), cacheCopperZoneConnections(), deleteSinglePadNets(), estimateComponentInsertionPosition(), updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
|
private |
Definition at line 164 of file board_netlist_updater.h.
Referenced by addNewComponent(), replaceComponent(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 175 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetDeleteSinglePadNets(), and UpdateNetlist().
|
private |
Definition at line 176 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetDeleteUnusedComponents(), and UpdateNetlist().
|
private |
Definition at line 183 of file board_netlist_updater.h.
Referenced by addNewComponent(), BOARD_NETLIST_UPDATER(), replaceComponent(), testConnectivity(), and UpdateNetlist().
|
private |
Definition at line 163 of file board_netlist_updater.h.
Referenced by addNewComponent(), replaceComponent(), updateCopperZoneNets(), and UpdateNetlist().
|
private |
Definition at line 177 of file board_netlist_updater.h.
Referenced by addNewComponent(), BOARD_NETLIST_UPDATER(), deleteSinglePadNets(), getNetname(), getPinFunction(), replaceComponent(), SetIsDryRun(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 179 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetLookupByTimestamp(), and UpdateNetlist().
|
private |
Definition at line 184 of file board_netlist_updater.h.
Referenced by addNewComponent(), BOARD_NETLIST_UPDATER(), replaceComponent(), and UpdateNetlist().
|
private |
Definition at line 169 of file board_netlist_updater.h.
Referenced by updateComponentPadConnections(), and updateCopperZoneNets().
|
private |
Definition at line 170 of file board_netlist_updater.h.
Referenced by cacheNetname(), and getNetname().
|
private |
Definition at line 171 of file board_netlist_updater.h.
Referenced by cachePinFunction(), and getPinFunction().
|
private |
Definition at line 178 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetReplaceFootprints(), and UpdateNetlist().
|
private |
Definition at line 166 of file board_netlist_updater.h.
Referenced by addNewComponent(), BOARD_NETLIST_UPDATER(), deleteSinglePadNets(), replaceComponent(), SetReporter(), testConnectivity(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 180 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetWarnPadNoNetInNetlist(), and updateComponentPadConnections().
|
private |
Definition at line 182 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), updateCopperZoneNets(), and UpdateNetlist().
Definition at line 168 of file board_netlist_updater.h.
Referenced by cacheCopperZoneConnections(), and updateCopperZoneNets().