Connectivity: don't consider neighbor propagation when types don't match

Fixes: lp:1831608
* https://bugs.launchpad.net/kicad/+bug/1831608
This commit is contained in:
Jon Evans 2019-06-05 22:26:30 -04:00
parent 1142eb259b
commit 607650be22
2 changed files with 20 additions and 11 deletions

View File

@ -1091,9 +1091,12 @@ void CONNECTION_GRAPH::buildConnectionGraph()
if( sch_pin->IsPowerConnection() )
{
auto c = std::make_shared<SCH_CONNECTION>( possible_driver,
aSubgraph->m_sheet );
c->SetName( static_cast<SCH_PIN *>( possible_driver )->GetName() );
auto pin = static_cast<SCH_PIN *>( possible_driver );
auto c = std::make_shared<SCH_CONNECTION>( 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<SCH_CONNECTION>( possible_driver,
aSubgraph->m_sheet );
c->SetName( static_cast<SCH_TEXT*>( possible_driver )->GetShownText() );
auto text = static_cast<SCH_TEXT*>( possible_driver );
auto c = std::make_shared<SCH_CONNECTION>( 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 )

View File

@ -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.