diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 0ab1984218..8ad0755711 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -1091,9 +1091,12 @@ void CONNECTION_GRAPH::buildConnectionGraph() if( sch_pin->IsPowerConnection() ) { - auto c = std::make_shared( possible_driver, - aSubgraph->m_sheet ); - c->SetName( static_cast( possible_driver )->GetName() ); + auto pin = static_cast( possible_driver ); + auto c = std::make_shared( pin, aSubgraph->m_sheet ); + c->ConfigureFromLabel( pin->GetName() ); + + if( c->Type() != aSubgraph->m_driver_connection->Type() ) + continue; if( c->Name( true ) == aSubgraph->m_driver_connection->Name( true ) ) continue; @@ -1111,9 +1114,12 @@ void CONNECTION_GRAPH::buildConnectionGraph() case SCH_HIER_LABEL_T: case SCH_LABEL_T: { - auto c = std::make_shared( possible_driver, - aSubgraph->m_sheet ); - c->SetName( static_cast( possible_driver )->GetShownText() ); + auto text = static_cast( possible_driver ); + auto c = std::make_shared( text, aSubgraph->m_sheet ); + c->ConfigureFromLabel( text->GetShownText() ); + + if( c->Type() != aSubgraph->m_driver_connection->Type() ) + continue; if( c->Name( true ) == aSubgraph->m_driver_connection->Name( true ) ) continue; @@ -1340,6 +1346,9 @@ void CONNECTION_GRAPH::buildConnectionGraph() for( CONNECTION_SUBGRAPH* parent : it.second ) { + if( parent->m_absorbed ) + parent = parent->m_absorbed_by; + SCH_CONNECTION* match = matchBusMember( parent->m_driver_connection, link_member ); if( !match ) diff --git a/eeschema/connection_graph.h b/eeschema/connection_graph.h index b0082521c0..7e00ef56ad 100644 --- a/eeschema/connection_graph.h +++ b/eeschema/connection_graph.h @@ -68,11 +68,11 @@ public: PRIORITY_GLOBAL }; - - CONNECTION_SUBGRAPH( SCH_EDIT_FRAME* aFrame ) : - m_dirty( false ), m_absorbed( false ), m_code( -1 ), m_multiple_drivers( false ), - m_strong_driver( false ), m_no_connect( nullptr ), m_bus_entry( nullptr ), - m_driver( nullptr ), m_frame( aFrame ), m_driver_connection( nullptr ) + explicit CONNECTION_SUBGRAPH( SCH_EDIT_FRAME* aFrame ) : + m_dirty( false ), m_absorbed( false ), m_absorbed_by( nullptr ), m_code( -1 ), + m_multiple_drivers( false ), m_strong_driver( false ), m_local_driver( false ), + m_no_connect( nullptr ), m_bus_entry( nullptr ), m_driver( nullptr ), m_frame( aFrame ), + m_driver_connection( nullptr ) {} /** * Determines which potential driver should drive the subgraph.