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 | SetOverrideLocks (bool aOverride) |
void | SetDeleteUnusedFootprints (bool aEnabled) |
void | SetLookupByTimestamp (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 | updateComponentPadConnections (FOOTPRINT *aFootprint, COMPONENT *aNewComponent) |
void | updateComponentClass (FOOTPRINT *aFootprint, COMPONENT *aNewComponent) |
void | cacheCopperZoneConnections () |
bool | updateCopperZoneNets (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_lookupByTimestamp |
bool | m_overrideLocks |
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 50 of file board_netlist_updater.cpp.
References NULL_REPORTER::GetInstance(), m_deleteUnusedFootprints, m_errorCount, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_overrideLocks, m_replaceFootprints, m_reporter, and m_warningCount.
BOARD_NETLIST_UPDATER::~BOARD_NETLIST_UPDATER | ( | ) |
Definition at line 69 of file board_netlist_updater.cpp.
Definition at line 135 of file board_netlist_updater.cpp.
References _, COMMIT::Add(), LIB_ID::empty(), EscapeHTML(), estimateFootprintInsertionPosition(), LIB_ID::Format(), FP_JUST_ADDED, FOOTPRINT::GetAttributes(), BOARD::GetComponentClassManager(), COMPONENT::GetFPID(), COMPONENT_CLASS_MANAGER::GetNoneComponentClass(), PCB_BASE_FRAME::GetPcbNewSettings(), COMPONENT::GetReference(), PCB_BASE_FRAME::LoadFootprint(), m_addedFootprints, m_board, m_commit, PCBNEW_SETTINGS::m_Display, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_reporter, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_ShowGlobalRatsnest, pad, FOOTPRINT::Pads(), REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, FOOTPRINT::SetAttributes(), FOOTPRINT::SetComponentClass(), EDA_ITEM::SetParent(), FOOTPRINT::SetPosition(), and UTF8::wx_str().
Referenced by UpdateNetlist().
|
private |
Definition at line 971 of file board_netlist_updater.cpp.
References BOARD::GetConnectivity(), m_board, m_zoneConnectionsCache, and BOARD::Zones().
Referenced by UpdateNetlist().
|
private |
Definition at line 77 of file board_netlist_updater.cpp.
References m_padNets.
Referenced by updateComponentPadConnections().
|
private |
Definition at line 92 of file board_netlist_updater.cpp.
References m_padPinFunctions.
Referenced by updateComponentPadConnections().
|
private |
Definition at line 107 of file board_netlist_updater.cpp.
References BOX2< Vec >::Centre(), BOARD::GetBoardEdgesBoundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetHeight(), BOARD::GetPageSettings(), PAGE_INFO::GetSizeIU(), BOX2< Vec >::GetWidth(), BOARD::IsEmpty(), EDA_IU_SCALE::IU_PER_MILS, m_board, EDA_IU_SCALE::mmToIU(), pcbIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by addNewFootprint().
|
inline |
Definition at line 94 of file board_netlist_updater.h.
References m_addedFootprints.
Referenced by PCB_EDIT_FRAME::OnNetlistChanged().
|
private |
Definition at line 83 of file board_netlist_updater.cpp.
References BOARD_CONNECTED_ITEM::GetNetname(), m_isDryRun, and m_padNets.
Referenced by updateCopperZoneNets().
|
private |
Definition at line 98 of file board_netlist_updater.cpp.
References PAD::GetPinFunction(), m_isDryRun, and m_padPinFunctions.
|
private |
Definition at line 284 of file board_netlist_updater.cpp.
References _, LIB_ID::empty(), EscapeHTML(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_ID::Format(), FOOTPRINT::GetFPID(), COMPONENT::GetFPID(), FOOTPRINT::GetReference(), COMPONENT::GetReference(), FOOTPRINT::IsLocked(), PCB_BASE_FRAME::LoadFootprint(), m_commit, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_overrideLocks, m_reporter, m_warningCount, REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and UTF8::wx_str().
Referenced by UpdateNetlist().
|
inline |
Definition at line 90 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 92 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 88 of file board_netlist_updater.h.
References m_overrideLocks.
Referenced by DIALOG_IMPORT_NETLIST::loadNetlist(), and 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().
|
private |
Definition at line 1179 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, REPORTER::Report(), RPT_SEVERITY_ERROR, and UTF8::wx_str().
Referenced by UpdateNetlist().
|
private |
Definition at line 205 of file board_netlist_updater.cpp.
References _, EscapeHTML(), FOOTPRINT::GetComponentClass(), BOARD::GetComponentClassManager(), COMPONENT::GetComponentClassNames(), COMPONENT_CLASS_MANAGER::GetEffectiveComponentClass(), COMPONENT_CLASS_MANAGER::GetFullClassNameForConstituents(), COMPONENT_CLASS::GetFullName(), FOOTPRINT::GetReference(), m_board, m_isDryRun, m_reporter, REPORTER::Report(), RPT_SEVERITY_ACTION, and FOOTPRINT::SetComponentClass().
Referenced by UpdateNetlist().
|
private |
Definition at line 755 of file board_netlist_updater.cpp.
References _, COMMIT::Add(), cacheNetname(), cachePinFunction(), FOOTPRINT::Clone(), copy, EscapeHTML(), 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_warningCount, 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 983 of file board_netlist_updater.cpp.
References _, EscapeHTML(), BOARD::FindNet(), NETLIST::GetComponent(), NETLIST::GetCount(), BOARD::GetLayerName(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetNetName(), getNetname(), PCB_BASE_FRAME::GetPcbNewSettings(), m_addedNets, m_board, m_commit, PCBNEW_SETTINGS::m_Display, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayInvertXAxis, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayInvertYAxis, m_frame, m_isDryRun, m_oldToNewNets, m_reporter, m_warningCount, m_zoneConnectionsCache, UNITS_PROVIDER::MessageTextFromValue(), COMMIT::Modify(), pad, PCB_VIA_T, REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, BOARD::Tracks(), UnescapeString(), via, VECTOR2< T >::x, VECTOR2< T >::y, and BOARD::Zones().
Referenced by UpdateNetlist().
|
private |
Definition at line 364 of file board_netlist_updater.cpp.
References _, FOOTPRINT::AddField(), KIID_PATH::AsString(), B_Fab, FOOTPRINT::Clone(), copy, EscapeHTML(), F_Cu, F_Fab, FOOTPRINT::Footprint(), FOOTPRINT_FIELD, FP_DNP, FP_EXCLUDE_FROM_BOM, FP_JUST_ADDED, FOOTPRINT::GetAttributes(), GetCanonicalFieldName(), PCB_BASE_FRAME::GetCanvas(), PCB_BASE_FRAME::GetDesignSettings(), FOOTPRINT::GetFieldByName(), FOOTPRINT::GetFieldCount(), COMPONENT::GetFields(), FOOTPRINT::GetFields(), FOOTPRINT::GetFilters(), COMPONENT::GetHumanReadablePath(), COMPONENT::GetKIIDs(), FOOTPRINT::GetLayer(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPath(), COMPONENT::GetPath(), FOOTPRINT::GetPosition(), COMPONENT::GetProperties(), FOOTPRINT::GetReference(), COMPONENT::GetReference(), FOOTPRINT::GetSheetfile(), FOOTPRINT::GetSheetname(), COMMIT::GetStatus(), FOOTPRINT::GetValue(), COMPONENT::GetValue(), PCB_DRAW_PANEL_GAL::GetView(), FOOTPRINT::HasFieldByName(), m_commit, m_frame, m_isDryRun, m_replaceFootprints, m_reporter, COMMIT::Modified(), name, REFERENCE_FIELD, KIGFX::PCB_VIEW::Remove(), FOOTPRINT::RemoveField(), REPORTER::Report(), PCB_TEXT::Rotate(), RPT_SEVERITY_ACTION, FOOTPRINT::SetAttributes(), 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(), and VALUE_FIELD.
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 1228 of file board_netlist_updater.cpp.
References _, addNewFootprint(), BOARD::BuildConnectivity(), cacheCopperZoneConnections(), CHT_UNGROUP, EscapeHTML(), COMPONENT_CLASS_MANAGER::FinishNetlistUpdate(), BOARD::Footprints(), LIB_ID::Format(), FP_BOARD_ONLY, NETLIST::GetComponent(), NETLIST::GetComponentByPath(), NETLIST::GetComponentByReference(), BOARD::GetComponentClassManager(), BOARD::GetConnectivity(), NETLIST::GetCount(), COMPONENT::GetFPID(), COMPONENT::GetKIIDs(), BOARD::GetNetInfo(), COMPONENT::GetPath(), COMPONENT::GetProperties(), COMPONENT::GetReference(), COMPONENT_CLASS_MANAGER::InitNetlistUpdate(), 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, PCB_EDIT_FRAME::OnModify(), pad, BOARD_COMMIT::Push(), COMMIT::Remove(), BOARD::RemoveUnusedNets(), replaceFootprint(), REPORTER::Report(), REPORTER::ReportTail(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, BOARD_COMMIT::Stage(), BOARD::SynchronizeNetsAndNetClasses(), testConnectivity(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), 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 131 of file board_netlist_updater.h.
Referenced by addNewFootprint(), and GetAddedFootprints().
|
private |
Definition at line 132 of file board_netlist_updater.h.
Referenced by updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
|
private |
Definition at line 124 of file board_netlist_updater.h.
Referenced by addNewFootprint(), cacheCopperZoneConnections(), estimateFootprintInsertionPosition(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
|
private |
Definition at line 123 of file board_netlist_updater.h.
Referenced by addNewFootprint(), replaceFootprint(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 134 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetDeleteUnusedFootprints(), and UpdateNetlist().
|
private |
Definition at line 141 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), testConnectivity(), and UpdateNetlist().
|
private |
Definition at line 122 of file board_netlist_updater.h.
Referenced by addNewFootprint(), replaceFootprint(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 135 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), getNetname(), getPinFunction(), replaceFootprint(), SetIsDryRun(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 137 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetLookupByTimestamp(), and UpdateNetlist().
|
private |
Definition at line 142 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), and UpdateNetlist().
|
private |
Definition at line 128 of file board_netlist_updater.h.
Referenced by updateComponentPadConnections(), and updateCopperZoneNets().
|
private |
Definition at line 138 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), replaceFootprint(), SetOverrideLocks(), and UpdateNetlist().
|
private |
Definition at line 129 of file board_netlist_updater.h.
Referenced by cacheNetname(), and getNetname().
|
private |
Definition at line 130 of file board_netlist_updater.h.
Referenced by cachePinFunction(), and getPinFunction().
|
private |
Definition at line 136 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), SetReplaceFootprints(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 125 of file board_netlist_updater.h.
Referenced by addNewFootprint(), BOARD_NETLIST_UPDATER(), replaceFootprint(), SetReporter(), testConnectivity(), updateComponentClass(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UpdateNetlist().
|
private |
Definition at line 140 of file board_netlist_updater.h.
Referenced by BOARD_NETLIST_UPDATER(), replaceFootprint(), updateComponentPadConnections(), updateCopperZoneNets(), and UpdateNetlist().
Definition at line 127 of file board_netlist_updater.h.
Referenced by cacheCopperZoneConnections(), and updateCopperZoneNets().