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. | |
void | SetReporter (REPORTER *aReporter) |
Enable dry run mode (just report, no changes to PCB). | |
void | SetIsDryRun (bool aEnabled) |
void | SetReplaceFootprints (bool aEnabled) |
void | SetTransferGroups (bool aEnabled) |
void | SetOverrideLocks (bool aOverride) |
void | SetDeleteUnusedFootprints (bool aEnabled) |
void | SetLookupByTimestamp (bool aEnabled) |
void | SetUpdateFields (bool aEnabled) |
void | SetRemoveExtraFields (bool aEnabled) |
std::vector< FOOTPRINT * > | GetAddedFootprints () 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) |
VECTOR2I | estimateFootprintInsertionPosition () |
FOOTPRINT * | addNewFootprint (COMPONENT *aComponent) |
FOOTPRINT * | replaceFootprint (NETLIST &aNetlist, FOOTPRINT *aFootprint, COMPONENT *aNewComponent) |
bool | updateFootprintParameters (FOOTPRINT *aPcbFootprint, COMPONENT *aNetlistComponent) |
bool | updateFootprintGroup (FOOTPRINT *aPcbFootprint, COMPONENT *aNetlistComponent) |
bool | updateComponentPadConnections (FOOTPRINT *aFootprint, COMPONENT *aNewComponent) |
void | updateComponentClass (FOOTPRINT *aFootprint, COMPONENT *aNewComponent) |
void | cacheCopperZoneConnections () |
bool | updateCopperZoneNets (NETLIST &aNetlist) |
bool | updateGroups (NETLIST &aNetlist) |
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_addedFootprints |
std::map< wxString, NETINFO_ITEM * > | m_addedNets |
bool | m_deleteUnusedFootprints |
bool | m_isDryRun |
bool | m_replaceFootprints |
bool | m_transferGroups |
bool | m_lookupByTimestamp |
bool | m_overrideLocks |
bool | m_updateFields |
bool | m_removeExtraFields |
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 65 of file board_netlist_updater.h.
BOARD_NETLIST_UPDATER::BOARD_NETLIST_UPDATER | ( | PCB_EDIT_FRAME * | aFrame, |
BOARD * | aBoard ) |
Definition at line 53 of file board_netlist_updater.cpp.
References NULL_REPORTER::GetInstance(), m_board, m_commit, m_deleteUnusedFootprints, m_errorCount, m_frame, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_overrideLocks, m_removeExtraFields, m_replaceFootprints, m_reporter, m_transferGroups, m_updateFields, and m_warningCount.
BOARD_NETLIST_UPDATER::~BOARD_NETLIST_UPDATER | ( | ) |
Definition at line 75 of file board_netlist_updater.cpp.
Definition at line 141 of file board_netlist_updater.cpp.
References _, LIB_ID::empty(), EscapeHTML(), estimateFootprintInsertionPosition(), LIB_ID::Format(), FP_JUST_ADDED, FOOTPRINT::GetAttributes(), COMPONENT::GetFPID(), COMPONENT::GetReference(), m_addedFootprints, m_board, m_commit, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_reporter, pad, FOOTPRINT::Pads(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, FOOTPRINT::SetAttributes(), EDA_ITEM::SetParent(), FOOTPRINT::SetPosition(), FOOTPRINT::SetStaticComponentClass(), and UTF8::wx_str().
Referenced by UpdateNetlist().
|
private |
Definition at line 1169 of file board_netlist_updater.cpp.
References m_board, and m_zoneConnectionsCache.
Referenced by UpdateNetlist().
|
private |
Definition at line 83 of file board_netlist_updater.cpp.
References m_padNets.
Referenced by updateComponentPadConnections().
|
private |
Definition at line 98 of file board_netlist_updater.cpp.
References m_padPinFunctions.
Referenced by updateComponentPadConnections().
|
private |
Definition at line 113 of file board_netlist_updater.cpp.
References BOX2< Vec >::Centre(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), m_board, pcbIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by addNewFootprint().
|
inline |
Definition at line 100 of file board_netlist_updater.h.
References m_addedFootprints.
Referenced by PCB_EDIT_FRAME::OnNetlistChanged().
|
private |
Definition at line 89 of file board_netlist_updater.cpp.
References BOARD_CONNECTED_ITEM::GetNetname(), m_isDryRun, and m_padNets.
Referenced by updateCopperZoneNets().
|
private |
Definition at line 104 of file board_netlist_updater.cpp.
References PAD::GetPinFunction(), m_isDryRun, and m_padPinFunctions.
|
private |
Definition at line 291 of file board_netlist_updater.cpp.
References _, LIB_ID::empty(), EscapeHTML(), LIB_ID::Format(), COMPONENT::GetFPID(), FOOTPRINT::GetFPID(), COMPONENT::GetReference(), FOOTPRINT::GetReference(), FOOTPRINT::IsLocked(), m_commit, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_overrideLocks, m_reporter, m_warningCount, RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and UTF8::wx_str().
Referenced by UpdateNetlist().
|
inline |
Definition at line 92 of file board_netlist_updater.h.
References m_deleteUnusedFootprints.
Referenced by PCB_EDIT_FRAME::KiwayMailIn(), DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 84 of file board_netlist_updater.h.
References m_isDryRun.
Referenced by DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 94 of file board_netlist_updater.h.
References m_lookupByTimestamp.
Referenced by PCB_EDIT_FRAME::KiwayMailIn(), DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 90 of file board_netlist_updater.h.
References m_overrideLocks.
Referenced by DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 98 of file board_netlist_updater.h.
References m_removeExtraFields.
Referenced by DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 86 of file board_netlist_updater.h.
References m_replaceFootprints.
Referenced by PCB_EDIT_FRAME::KiwayMailIn(), DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Enable dry run mode (just report, no changes to PCB).
Definition at line 81 of file board_netlist_updater.h.
References m_reporter.
Referenced by DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 88 of file board_netlist_updater.h.
References m_transferGroups.
Referenced by PCB_EDIT_FRAME::KiwayMailIn(), DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
inline |
Definition at line 96 of file board_netlist_updater.h.
References m_updateFields.
Referenced by DIALOG_UPDATE_PCB::PerformUpdate().
|
private |
Definition at line 1434 of file board_netlist_updater.cpp.
References _, EscapeHTML(), FOOTPRINT::FindPadByNumber(), LIB_ID::Format(), NETLIST::GetComponent(), NETLIST::GetCount(), FOOTPRINT::GetFPID(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetPinName(), COMPONENT::GetReference(), m_errorCount, m_reporter, RPT_SEVERITY_ERROR, and UTF8::wx_str().
Referenced by UpdateNetlist().
|
private |
Definition at line 212 of file board_netlist_updater.cpp.
References _, EscapeHTML(), COMPONENT::GetComponentClassNames(), COMPONENT_CLASS_MANAGER::GetFullClassNameForConstituents(), COMPONENT_CLASS::GetName(), FOOTPRINT::GetReference(), FOOTPRINT::GetStaticComponentClass(), m_board, m_isDryRun, m_reporter, RPT_SEVERITY_ACTION, and FOOTPRINT::SetStaticComponentClass().
Referenced by UpdateNetlist().
|
private |
Definition at line 939 of file board_netlist_updater.cpp.
References _, cacheNetname(), cachePinFunction(), FOOTPRINT::Clone(), copy, EscapeHTML(), COMPONENT::GetNet(), COMPONENT_NET::GetNetName(), COMPONENT_NET::GetPinFunction(), COMPONENT_NET::GetPinType(), COMPONENT::GetReference(), FOOTPRINT::GetReference(), COMPONENT_NET::IsValid(), m_addedNets, m_board, m_commit, m_isDryRun, m_oldToNewNets, m_reporter, m_warningCount, pad, FOOTPRINT::Pads(), RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, NETINFO_ITEM::SetIsCurrent(), NETINFO_LIST::UNCONNECTED, and UnescapeString().
Referenced by UpdateNetlist().
|
private |
Definition at line 1181 of file board_netlist_updater.cpp.
References _, EscapeHTML(), NETLIST::GetComponent(), NETLIST::GetCount(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetNetName(), getNetname(), m_addedNets, m_board, m_commit, m_frame, m_isDryRun, m_oldToNewNets, m_reporter, m_warningCount, m_zoneConnectionsCache, EDA_UNIT_UTILS::UI::MessageTextFromValue(), MM, pad, PCB_VIA_T, pcbIUScale, RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, UnescapeString(), via, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by UpdateNetlist().
|
private |
Definition at line 826 of file board_netlist_updater.cpp.
References _, EDA_GROUP::AddItem(), PCB_GROUP::AsEdaItem(), FOOTPRINT::Clone(), copy, EscapeHTML(), COMPONENT::GetGroup(), EDA_GROUP::GetName(), EDA_ITEM::GetParentGroup(), FOOTPRINT::GetReference(), group, m_board, m_commit, m_isDryRun, m_reporter, m_transferGroups, EDA_ITEM::m_Uuid, NETLIST_GROUP::name, NO_RECURSE, EDA_GROUP::RemoveItem(), RPT_SEVERITY_ACTION, EDA_GROUP::SetName(), and NETLIST_GROUP::uuid.
Referenced by UpdateNetlist().
|
private |
Definition at line 371 of file board_netlist_updater.cpp.
References _, FOOTPRINT::Add(), KIID_PATH::AsString(), B_Fab, FOOTPRINT::Clone(), copy, EscapeHTML(), F_Cu, F_Fab, FOOTPRINT, FP_DNP, FP_EXCLUDE_FROM_BOM, FOOTPRINT::GetAttributes(), GetCanonicalFieldName(), COMPONENT::GetDuplicatePadNumbersAreJumpers(), FOOTPRINT::GetDuplicatePadNumbersAreJumpers(), FOOTPRINT::GetField(), COMPONENT::GetFields(), FOOTPRINT::GetFields(), FOOTPRINT::GetFilters(), COMPONENT::GetHumanReadablePath(), COMPONENT::GetKIIDs(), FOOTPRINT::GetLayer(), FOOTPRINT::GetOrientation(), COMPONENT::GetPath(), FOOTPRINT::GetPath(), FOOTPRINT::GetPosition(), COMPONENT::GetProperties(), COMPONENT::GetReference(), FOOTPRINT::GetReference(), FOOTPRINT::GetSheetfile(), FOOTPRINT::GetSheetname(), COMPONENT::GetValue(), FOOTPRINT::GetValue(), FOOTPRINT::HasField(), COMPONENT::JumperPadGroups(), FOOTPRINT::JumperPadGroups(), m_commit, m_frame, m_isDryRun, m_removeExtraFields, m_reporter, m_updateFields, name, REFERENCE, FOOTPRINT::Remove(), PCB_TEXT::Rotate(), RPT_SEVERITY_ACTION, FOOTPRINT::SetAttributes(), FOOTPRINT::SetDuplicatePadNumbersAreJumpers(), FOOTPRINT::SetFilters(), BOARD_ITEM::SetLayer(), PCB_FIELD::SetName(), FOOTPRINT::SetPath(), PCB_TEXT::SetPosition(), FOOTPRINT::SetReference(), FOOTPRINT::SetSheetfile(), FOOTPRINT::SetSheetname(), EDA_TEXT::SetText(), FOOTPRINT::SetValue(), EDA_TEXT::SetVisible(), PCB_TEXT::StyleFromSettings(), USER, and VALUE.
Referenced by UpdateNetlist().
|
private |
Definition at line 1379 of file board_netlist_updater.cpp.
References _, EscapeHTML(), NETLIST::GetGroupByUuid(), LIB_ID::GetUniStringLibId(), NETLIST_GROUP::libId, m_board, m_commit, m_isDryRun, m_reporter, m_transferGroups, NETLIST_GROUP::name, NO_RECURSE, and RPT_SEVERITY_ACTION.
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 1483 of file board_netlist_updater.cpp.
References _, addNewFootprint(), cacheCopperZoneConnections(), EscapeHTML(), LIB_ID::Format(), FP_BOARD_ONLY, NETLIST::GetComponent(), NETLIST::GetComponentByPath(), NETLIST::GetComponentByReference(), NETLIST::GetCount(), COMPONENT::GetFPID(), COMPONENT::GetKIIDs(), COMPONENT::GetPath(), COMPONENT::GetProperties(), COMPONENT::GetReference(), FOOTPRINT::GetSheetname(), m_addedNets, m_board, m_commit, m_deleteUnusedFootprints, m_errorCount, m_frame, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_overrideLocks, m_replaceFootprints, m_reporter, m_warningCount, pad, replaceFootprint(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, testConnectivity(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintGroup(), updateFootprintParameters(), updateGroups(), UTF8::wx_str(), and ZONE_FILL_OP.
Referenced by PCB_EDIT_FRAME::KiwayMailIn(), DIALOG_IMPORT_NETLIST::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().
|
private |
Definition at line 141 of file board_netlist_updater.h.
Referenced by addNewFootprint(), and GetAddedFootprints().
|
private |
Definition at line 142 of file board_netlist_updater.h.
Referenced by updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
|
private |
Definition at line 134 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), cacheCopperZoneConnections(), estimateFootprintInsertionPosition(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintGroup(), updateGroups(), and UpdateNetlist().
|
private |
Definition at line 133 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintGroup(), updateFootprintParameters(), updateGroups(), and UpdateNetlist().
|
private |
Definition at line 144 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetDeleteUnusedFootprints(), and UpdateNetlist().
|
private |
Definition at line 154 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), testConnectivity(), and UpdateNetlist().
|
private |
Definition at line 132 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 145 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), getNetname(), getPinFunction(), replaceFootprint(), SetIsDryRun(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintGroup(), updateFootprintParameters(), updateGroups(), and UpdateNetlist().
|
private |
Definition at line 148 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetLookupByTimestamp(), and UpdateNetlist().
|
private |
Definition at line 155 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), and UpdateNetlist().
|
private |
Definition at line 138 of file board_netlist_updater.h.
Referenced by updateComponentPadConnections(), and updateCopperZoneNets().
|
private |
Definition at line 149 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), replaceFootprint(), SetOverrideLocks(), and UpdateNetlist().
|
private |
Definition at line 139 of file board_netlist_updater.h.
Referenced by cacheNetname(), and getNetname().
|
private |
Definition at line 140 of file board_netlist_updater.h.
Referenced by cachePinFunction(), and getPinFunction().
|
private |
Definition at line 151 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetRemoveExtraFields(), and updateFootprintParameters().
|
private |
Definition at line 146 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetReplaceFootprints(), and UpdateNetlist().
|
private |
Definition at line 135 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), SetReporter(), testConnectivity(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintGroup(), updateFootprintParameters(), updateGroups(), and UpdateNetlist().
|
private |
Definition at line 147 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetTransferGroups(), updateFootprintGroup(), and updateGroups().
|
private |
Definition at line 150 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetUpdateFields(), and updateFootprintParameters().
|
private |
Definition at line 153 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), replaceFootprint(), updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
Definition at line 137 of file board_netlist_updater.h.
Referenced by cacheCopperZoneConnections(), and updateCopperZoneNets().