30#include <unordered_map>
67 COMPONENT(
const wxString& aRef,
FOOTPRINT* aParentFp, std::optional<VECTOR2I> aRaOffset = std::optional<VECTOR2I>() );
180 std::unordered_map<COMPONENT*, COMPONENT*>
m_locked;
197 std::vector<TOPOLOGY_MISMATCH_REASON>& aFailureDetails,
219 const std::vector<COMPONENT*>& aStructuralMatches,
221 std::vector<TOPOLOGY_MISMATCH_REASON>& aFailureDetails,
222 const std::atomic<bool>* aCancelled =
nullptr );
friend class CONNECTION_GRAPH
const std::unordered_map< COMPONENT *, COMPONENT * > & GetMatchingComponentPairs() const
std::unordered_map< COMPONENT *, COMPONENT * > m_locked
std::vector< COMPONENT * > m_matches
BACKTRACK_STAGE(const BACKTRACK_STAGE &other)
static bool prefixesShareCommonBase(const wxString &aPrefixA, const wxString &aPrefixB)
Check if two prefixes share a common starting sequence.
friend class CONNECTION_GRAPH
bool IsSameKind(const COMPONENT &b) const
const VECTOR2I GetRAOffset() const
COMPONENT(const wxString &aRef, FOOTPRINT *aParentFp, std::optional< VECTOR2I > aRaOffset=std::optional< VECTOR2I >())
FOOTPRINT * m_parentFootprint
std::optional< VECTOR2I > m_raOffset
bool MatchesWith(COMPONENT *b, TOPOLOGY_MISMATCH_REASON &aDetail)
std::vector< PIN * > & Pins()
static bool isChannelSuffix(const wxString &aSuffix)
Check if a suffix looks like a channel identifier.
std::vector< PIN * > m_pins
FOOTPRINT * GetParent() const
bool FindIsomorphism(CONNECTION_GRAPH *target, COMPONENT_MATCHES &result, std::vector< TOPOLOGY_MISMATCH_REASON > &aFailureDetails, const ISOMORPHISM_PARAMS &aParams={})
std::vector< COMPONENT * > & Components()
std::vector< COMPONENT * > findMatchingComponents(COMPONENT *ref, const std::vector< COMPONENT * > &aStructuralMatches, const BACKTRACK_STAGE &partialMatches, std::vector< TOPOLOGY_MISMATCH_REASON > &aFailureDetails, const std::atomic< bool > *aCancelled=nullptr)
std::vector< COMPONENT * > m_components
void AddFootprint(FOOTPRINT *aFp, const VECTOR2I &aOffset)
bool breakTieBySymbolUuid(COMPONENT *aRef, std::vector< COMPONENT * > &aMatches) const
The most useful tie breaker is based on symbol/sheet instances, since multiple channels in a design a...
static std::unique_ptr< CONNECTION_GRAPH > BuildFromFootprintSet(const std::set< FOOTPRINT * > &aFps)
void breakTie(COMPONENT *aRef, std::vector< COMPONENT * > &aMatches) const
Many times components are electrically/topologically identical, e.g.
std::vector< PIN * > m_conns
friend class CONNECTION_GRAPH
void SetParent(COMPONENT *parent)
bool IsTopologicallySimilar(const PIN &b) const
const wxString & GetReference() const
bool IsIsomorphic(const PIN &b, TOPOLOGY_MISMATCH_REASON &aDetail) const
void AddConnection(PIN *pin)
COMPONENT * GetParent() const
const wxString Format() const
std::map< FOOTPRINT *, FOOTPRINT * > COMPONENT_MATCHES
std::atomic< bool > * m_cancelled
std::atomic< int > * m_matchedComponents
std::atomic< int > * m_totalComponents
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< int32_t > VECTOR2I