38 std::map<SCH_SYMBOL*, std::set<wxString>> targets;
55 auto footprint = ref.EndsWith( wxS(
"?" ) ) ? aFootprintsByRef.end() : aFootprintsByRef.find( ref );
56 wxString target = footprint == aFootprintsByRef.end() ? wxString() : footprint->second;
58 if( !current.IsEmpty() )
67 if( target.IsEmpty() || currentId.
Parse( current ) >= 0 || targetId.
Parse( target ) >= 0
70 targets[symbol].insert( wxString() );
75 targets[symbol].insert( target );
79 for(
const auto& [symbol, footprints] : targets )
81 if( footprints.size() != 1 || footprints.begin()->IsEmpty() )
87 symbol->SetFootprintFieldText( *footprints.begin() );
93 aReporter.
Report( wxString::Format(
_(
"Linked %d symbol(s) to the footprint with the same reference.\n" ),
EE_TYPE OfType(KICAD_T aType) const
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Holds all the data relating to one schematic.
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".