From 5689c4b625ab76cae255758206439eb4eadb540b Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 30 Oct 2022 19:17:04 -0400 Subject: [PATCH] Include overridden drivers when checking bus membership Fixes https://gitlab.com/kicad/code/kicad/-/issues/10945 --- eeschema/connection_graph.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 777250d908..cf00f319d3 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -2709,7 +2709,11 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH bus_name = bus_wire->Connection( &sheet )->Name(); - wxString test_name = bus_entry->Connection( &sheet )->Name(); + std::set test_names; + wxString baseName = sheet.PathHumanReadable(); + + for( SCH_ITEM* driver : aSubgraph->m_drivers ) + test_names.insert( baseName + aSubgraph->GetNameForDriver( driver ) ); for( const auto& member : bus_wire->Connection( &sheet )->Members() ) { @@ -2717,11 +2721,11 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH { for( const auto& sub_member : member->Members() ) { - if( sub_member->Name() == test_name ) + if( test_names.count( sub_member->Name() ) ) conflict = false; } } - else if( member->Name() == test_name ) + else if( test_names.count( member->Name() ) ) { conflict = false; }