56 std::vector<std::unique_ptr<FOOTPRINT>> owners;
68 for(
const wxString&
name : names )
70 std::unique_ptr<FOOTPRINT> owner = io.
FootprintLoad( aPrettyPath,
name,
false,
nullptr );
74 wxLogTrace(
traceDiffMerge, wxT(
"FP_LIB_DIFFER: '%s' returned null on load" ),
name );
78 map[
name] = owner.get();
79 owners.push_back( std::move( owner ) );
82 return { std::move( owners ), std::move( map ) };
96 return !( *aA == *aB );
117 auto fields = [](
const FOOTPRINT* aFootprint )
119 std::map<wxString, const EDA_ITEM*> out;
123 for(
const PCB_FIELD* field : aFootprint->GetFields() )
124 out[field->GetName()] = field;
130 auto others = [](
const FOOTPRINT* aFootprint )
132 std::vector<const EDA_ITEM*> out;
136 out.insert( out.end(), aFootprint->Pads().begin(), aFootprint->Pads().end() );
137 out.insert( out.end(), aFootprint->GraphicalItems().begin(), aFootprint->GraphicalItems().end() );
138 out.insert( out.end(), aFootprint->Zones().begin(), aFootprint->Zones().end() );
144 std::vector<LIB_ELEMENT> out;
148 out, others( aBefore ), others( aAfter ),
158 return static_cast<const PAD&
>( *aA ) ==
static_cast<const PAD&
>( *aB );
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual wxString GetFriendlyName() const
static std::pair< std::vector< std::unique_ptr< FOOTPRINT > >, FOOTPRINT_MAP > LoadLibrary(const wxString &aPrettyPath)
Load a .pretty directory into a FOOTPRINT_MAP.
const FOOTPRINT_MAP & m_before
FP_LIB_DIFFER(const FOOTPRINT_MAP &aBefore, const FOOTPRINT_MAP &aAfter, const wxString &aPath=wxEmptyString)
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
~FP_LIB_DIFFER() override
const FOOTPRINT_MAP & m_after
std::map< wxString, const FOOTPRINT * > FOOTPRINT_MAP
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
std::unique_ptr< FOOTPRINT > FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
const wxChar *const traceDiffMerge
Flag to enable diff/merge engine and renderer debugging output.
void DiffKeyedElements(std::vector< LIB_ELEMENT > &aOut, const wxString &aTypeName, const std::map< wxString, const EDA_ITEM * > &aBefore, const std::map< wxString, const EDA_ITEM * > &aAfter)
Elements that are matched by a key, such as pins by number or fields by name.
std::vector< LIB_ELEMENT > DiffFootprintElements(const FOOTPRINT *aBefore, const FOOTPRINT *aAfter)
Compare the elements of two library footprints.
DOCUMENT_DIFF DiffLibraryByName(const MAP &aBefore, const MAP &aAfter, const wxString &aPath, const wxString &aDocType, const wxString &aTypeName, const KICAD_DIFFER::OPTIONS &aOptions, BBoxFn aBBox, ChangedFn aChanged)
Shared name-keyed library diff used by FP_LIB_DIFFER and SYM_LIB_DIFFER.
void AppendElementChanges(ITEM_CHANGE &aChange, const std::vector< LIB_ELEMENT > &aElements)
Add each element to aChange as a child change, which is how a library item reports its elements.
void DiffUnkeyedElements(std::vector< LIB_ELEMENT > &aOut, const std::vector< const EDA_ITEM * > &aBefore, const std::vector< const EDA_ITEM * > &aAfter, const std::function< wxString(const EDA_ITEM *)> &aTypeName, const std::function< bool(const EDA_ITEM *, const EDA_ITEM *)> &aSameGeometry)
Elements with no key.
The full set of changes between two parsed documents of one type.
One change record on a single item.
std::optional< wxString > refdes
wxString result
Test unit parsing edge cases and error handling.
wxLogTrace helper definitions.
@ PCB_PAD_T
class PAD, a pad in a footprint