KiCad PCB EDA Suite
|
Back annotation algorithm class used to receive, check, and apply a NETLIST from Pcbnew. More...
#include <backannotate.h>
Classes | |
struct | PCB_FP_DATA |
Container for Pcbnew footprint data.Map to hold NETLIST footprints data. More... | |
Public Types | |
using | PCB_FOOTPRINTS_MAP = std::map< wxString, std::shared_ptr< PCB_FP_DATA > > |
using | CHANGELIST_ITEM = std::pair< SCH_REFERENCE, std::shared_ptr< PCB_FP_DATA > > |
Public Member Functions | |
BACK_ANNOTATE (SCH_EDIT_FRAME *aFrame, REPORTER &aReporter, bool aRelinkFootprints, bool aProcessFootprints, bool aProcessValues, bool aProcessReferences, bool aProcessNetNames, bool aProcessAttributes, bool aProcessOtherFields, bool aDryRun) | |
~BACK_ANNOTATE () | |
bool | FetchNetlistFromPCB (std::string &aNetlist) |
Get netlist from the Pcbnew. | |
void | PushNewLinksToPCB () |
bool | BackAnnotateSymbols (const std::string &aNetlist) |
Run back annotation algorithm. | |
Private Member Functions | |
void | getPcbModulesFromString (const std::string &aPayload) |
Parse netlist sent over KiWay express mail interface and fill m_pcbModules. | |
void | getChangeList () |
void | checkForUnusedSymbols () |
Check if some symbols are not represented in PCB footprints and vice versa. | |
void | applyChangelist () |
Apply changelist to the schematic. | |
void | processNetNameChange (SCH_COMMIT *aCommit, const wxString &aRef, SCH_PIN *aPin, const SCH_CONNECTION *aConnection, const wxString &aOldName, const wxString &aNewName) |
Private Attributes | |
REPORTER & | m_reporter |
bool | m_matchByReference |
bool | m_processFootprints |
bool | m_processValues |
bool | m_processReferences |
bool | m_processNetNames |
bool | m_processAttributes |
bool | m_processOtherFields |
bool | m_dryRun |
PCB_FOOTPRINTS_MAP | m_pcbFootprints |
SCH_REFERENCE_LIST | m_refs |
SCH_MULTI_UNIT_REFERENCE_MAP | m_multiUnitsRefs |
std::deque< CHANGELIST_ITEM > | m_changelist |
SCH_EDIT_FRAME * | m_frame |
int | m_changesCount |
Back annotation algorithm class used to receive, check, and apply a NETLIST from Pcbnew.
The following checks are made:
Definition at line 55 of file backannotate.h.
using BACK_ANNOTATE::CHANGELIST_ITEM = std::pair<SCH_REFERENCE, std::shared_ptr<PCB_FP_DATA> > |
Definition at line 88 of file backannotate.h.
using BACK_ANNOTATE::PCB_FOOTPRINTS_MAP = std::map<wxString, std::shared_ptr<PCB_FP_DATA> > |
Definition at line 86 of file backannotate.h.
BACK_ANNOTATE::BACK_ANNOTATE | ( | SCH_EDIT_FRAME * | aFrame, |
REPORTER & | aReporter, | ||
bool | aRelinkFootprints, | ||
bool | aProcessFootprints, | ||
bool | aProcessValues, | ||
bool | aProcessReferences, | ||
bool | aProcessNetNames, | ||
bool | aProcessAttributes, | ||
bool | aProcessOtherFields, | ||
bool | aDryRun | ||
) |
Definition at line 44 of file backannotate.cpp.
BACK_ANNOTATE::~BACK_ANNOTATE | ( | ) |
Definition at line 64 of file backannotate.cpp.
|
private |
Apply changelist to the schematic.
Definition at line 361 of file backannotate.cpp.
References _, SCH_SYMBOL::AddField(), EscapeHTML(), SCH_SYMBOL::FindField(), FOOTPRINT_FIELD, GetCanonicalFieldName(), SCH_FIELD::GetCanonicalName(), SYMBOL::GetDNP(), SYMBOL::GetExcludedFromBOM(), SCH_SYMBOL::GetFieldCount(), SCH_SYMBOL::GetFields(), EDA_ITEM::GetFlags(), SCH_REFERENCE::GetFootprint(), SCH_SYMBOL::GetPin(), SCH_REFERENCE::GetRef(), SCH_REFERENCE::GetSheetPath(), SCH_FIELD::GetShownText(), SCH_REFERENCE::GetSymbol(), SCH_REFERENCE::GetValue(), SCH_SHEET_PATH::LastScreen(), m_changelist, m_changesCount, BACK_ANNOTATE::PCB_FP_DATA::m_DNP, m_dryRun, BACK_ANNOTATE::PCB_FP_DATA::m_excludeFromBOM, BACK_ANNOTATE::PCB_FP_DATA::m_fieldsMap, BACK_ANNOTATE::PCB_FP_DATA::m_footprint, m_frame, BACK_ANNOTATE::PCB_FP_DATA::m_pinMap, m_processAttributes, m_processFootprints, m_processNetNames, m_processOtherFields, m_processReferences, m_processValues, BACK_ANNOTATE::PCB_FP_DATA::m_ref, m_reporter, BACK_ANNOTATE::PCB_FP_DATA::m_value, COMMIT::Modify(), SCH_CONNECTION::Name(), NO_CLEANUP, pin, processNetNameChange(), SCH_COMMIT::Push(), SCH_EDIT_FRAME::RecalculateConnections(), REFERENCE_FIELD, SCH_SYMBOL::RemoveField(), REPORTER::ReportHead(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, SYMBOL::SetDNP(), SYMBOL::SetExcludedFromBOM(), SCH_SYMBOL::SetFootprintFieldText(), SCH_SYMBOL::SetRef(), SCH_FIELD::SetText(), SCH_SYMBOL::SetValueFieldText(), SKIP_STRUCT, SCH_EDIT_FRAME::UpdateNetHighlightStatus(), and VALUE_FIELD.
Referenced by BackAnnotateSymbols().
bool BACK_ANNOTATE::BackAnnotateSymbols | ( | const std::string & | aNetlist | ) |
Run back annotation algorithm.
If any errors, back annotation doesn't run.
aNetlist | is the netlist to use for back annotation. |
Definition at line 69 of file backannotate.cpp.
References _, applyChangelist(), checkForUnusedSymbols(), getChangeList(), SCH_SHEET_LIST::GetMultiUnitSymbols(), getPcbModulesFromString(), SCH_SHEET_LIST::GetSymbols(), SCHEMATIC::Hierarchy(), m_changesCount, m_frame, m_matchByReference, m_multiUnitsRefs, m_processAttributes, m_processFootprints, m_processNetNames, m_processReferences, m_processValues, m_refs, m_reporter, REPORTER::ReportTail(), RPT_SEVERITY_ERROR, and SCH_EDIT_FRAME::Schematic().
Referenced by DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), and DIALOG_UPDATE_FROM_PCB::updateData().
|
private |
Check if some symbols are not represented in PCB footprints and vice versa.
m_refs must be sorted by path.
Definition at line 318 of file backannotate.cpp.
References _, SCH_REFERENCE_LIST::GetCount(), SYMBOL::GetExcludedFromBoard(), SCH_REFERENCE::GetSymbol(), m_changelist, m_frame, m_matchByReference, m_refs, m_reporter, SCH_EDIT_FRAME::ReadyToNetlist(), REPORTER::ReportTail(), RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and SCH_REFERENCE_LIST::SortByTimeStamp().
Referenced by BackAnnotateSymbols().
bool BACK_ANNOTATE::FetchNetlistFromPCB | ( | std::string & | aNetlist | ) |
Get netlist from the Pcbnew.
aNetlist | is the netlist for the board editor. |
Definition at line 96 of file backannotate.cpp.
References _, DisplayErrorMessage(), KIWAY::ExpressMail(), FRAME_PCB_EDITOR, PROJECT::GetProjectFullName(), Kiface(), KIWAY_HOLDER::Kiway(), m_frame, MAIL_PCB_GET_NETLIST, KIWAY_PLAYER::OpenProjectFiles(), KIWAY::Player(), and KIWAY_HOLDER::Prj().
Referenced by DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), and DIALOG_UPDATE_FROM_PCB::updateData().
|
private |
Definition at line 261 of file backannotate.cpp.
References _, SCH_REFERENCE_LIST::FindRef(), SCH_REFERENCE_LIST::FindRefByFullPath(), SCH_REFERENCE_LIST::GetCount(), m_changelist, m_matchByReference, m_multiUnitsRefs, m_pcbFootprints, m_refs, m_reporter, REPORTER::ReportTail(), RPT_SEVERITY_ERROR, and SKIP_STRUCT.
Referenced by BackAnnotateSymbols().
|
private |
Parse netlist sent over KiWay express mail interface and fill m_pcbModules.
aPayload | is the netlist from Pcbnew. |
Definition at line 131 of file backannotate.cpp.
References _, From_UTF8(), m_matchByReference, m_pcbFootprints, m_reporter, name, path, REPORTER::ReportHead(), RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and Scan().
Referenced by BackAnnotateSymbols().
|
private |
Definition at line 680 of file backannotate.cpp.
References _, COMMIT::Add(), addConnections(), EscapeHTML(), CONNECTION_SUBGRAPH::GetDriverPriority(), EDA_ITEM::GetPosition(), SCH_PIN::GetShownNumber(), IS_NEW, SCH_PIN::IsGlobalPower(), SCH_SHEET_PATH::LastScreen(), m_changesCount, SCHEMATIC_SETTINGS::m_DefaultTextSize, m_dryRun, m_frame, m_reporter, COMMIT::Modify(), CONNECTION_SUBGRAPH::NONE, orientLabel(), REPORTER::ReportHead(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_EDIT_FRAME::Schematic(), EDA_ITEM::SetFlags(), EDA_ITEM::SetParent(), SCH_LABEL_BASE::SetSpinStyle(), EDA_TEXT::SetTextSize(), SCHEMATIC::Settings(), SCH_CONNECTION::Sheet(), and EDA_ITEM::Type().
Referenced by applyChangelist().
void BACK_ANNOTATE::PushNewLinksToPCB | ( | ) |
Definition at line 123 of file backannotate.cpp.
References KIWAY::ExpressMail(), FRAME_PCB_EDITOR, KIWAY_HOLDER::Kiway(), m_frame, and MAIL_PCB_UPDATE_LINKS.
Referenced by DIALOG_UPDATE_FROM_PCB::OnUpdateClick().
|
private |
Definition at line 156 of file backannotate.h.
Referenced by applyChangelist(), checkForUnusedSymbols(), and getChangeList().
|
private |
Definition at line 159 of file backannotate.h.
Referenced by applyChangelist(), BackAnnotateSymbols(), and processNetNameChange().
|
private |
Definition at line 151 of file backannotate.h.
Referenced by applyChangelist(), and processNetNameChange().
|
private |
Definition at line 157 of file backannotate.h.
Referenced by applyChangelist(), BackAnnotateSymbols(), checkForUnusedSymbols(), FetchNetlistFromPCB(), processNetNameChange(), and PushNewLinksToPCB().
|
private |
Definition at line 144 of file backannotate.h.
Referenced by BackAnnotateSymbols(), checkForUnusedSymbols(), getChangeList(), and getPcbModulesFromString().
|
private |
Definition at line 155 of file backannotate.h.
Referenced by BackAnnotateSymbols(), and getChangeList().
|
private |
Definition at line 153 of file backannotate.h.
Referenced by getChangeList(), and getPcbModulesFromString().
|
private |
Definition at line 149 of file backannotate.h.
Referenced by applyChangelist(), and BackAnnotateSymbols().
|
private |
Definition at line 145 of file backannotate.h.
Referenced by applyChangelist(), and BackAnnotateSymbols().
|
private |
Definition at line 148 of file backannotate.h.
Referenced by applyChangelist(), and BackAnnotateSymbols().
|
private |
Definition at line 150 of file backannotate.h.
Referenced by applyChangelist().
|
private |
Definition at line 147 of file backannotate.h.
Referenced by applyChangelist(), and BackAnnotateSymbols().
|
private |
Definition at line 146 of file backannotate.h.
Referenced by applyChangelist(), and BackAnnotateSymbols().
|
private |
Definition at line 154 of file backannotate.h.
Referenced by BackAnnotateSymbols(), checkForUnusedSymbols(), and getChangeList().
|
private |
Definition at line 142 of file backannotate.h.
Referenced by applyChangelist(), BackAnnotateSymbols(), checkForUnusedSymbols(), getChangeList(), getPcbModulesFromString(), and processNetNameChange().