Push nets to free pads when they're used.
Fixes https://gitlab.com/kicad/code/kicad/issues/13516 Fixes https://gitlab.com/kicad/code/kicad/issues/13517
This commit is contained in:
parent
1d223d1439
commit
3cc960a872
|
@ -553,19 +553,14 @@ void CN_CONNECTIVITY_ALGO::LocalBuild( const std::vector<BOARD_ITEM*>& aItems )
|
|||
|
||||
void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGATE_MODE aMode )
|
||||
{
|
||||
bool skipConflicts = ( aMode == PROPAGATE_MODE::SKIP_CONFLICTS );
|
||||
bool resolveConflicts = ( aMode != PROPAGATE_MODE::SKIP_CONFLICTS );
|
||||
|
||||
wxLogTrace( wxT( "CN" ), wxT( "propagateConnections: propagate skip conflicts? %d" ),
|
||||
skipConflicts );
|
||||
wxLogTrace( wxT( "CN" ), wxT( "propagateConnections: resolve conflicts? %d" ),
|
||||
resolveConflicts );
|
||||
|
||||
for( const std::shared_ptr<CN_CLUSTER>& cluster : m_connClusters )
|
||||
{
|
||||
if( skipConflicts && cluster->IsConflicting() )
|
||||
{
|
||||
wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; skipping update" ),
|
||||
cluster.get() );
|
||||
}
|
||||
else if( cluster->IsOrphaned() )
|
||||
if( cluster->IsOrphaned() )
|
||||
{
|
||||
wxLogTrace( wxT( "CN" ), wxT( "Skipping orphaned cluster %p [net: %s]" ),
|
||||
cluster.get(),
|
||||
|
@ -575,10 +570,18 @@ void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGAT
|
|||
{
|
||||
if( cluster->IsConflicting() )
|
||||
{
|
||||
wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; chose %d (%s)" ),
|
||||
cluster.get(),
|
||||
cluster->OriginNet(),
|
||||
cluster->OriginNetName() );
|
||||
if( resolveConflicts )
|
||||
{
|
||||
wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; chose %d (%s)" ),
|
||||
cluster.get(),
|
||||
cluster->OriginNet(),
|
||||
cluster->OriginNetName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; skipping update" ),
|
||||
cluster.get() );
|
||||
}
|
||||
}
|
||||
|
||||
// normal cluster: just propagate from the pads
|
||||
|
@ -586,7 +589,10 @@ void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGAT
|
|||
|
||||
for( CN_ITEM* item : *cluster )
|
||||
{
|
||||
if( item->CanChangeNet() )
|
||||
bool isFreePad = item->Parent()->Type() == PCB_PAD_T
|
||||
&& static_cast<PAD*>( item->Parent() )->IsFreePad();
|
||||
|
||||
if( ( resolveConflicts && item->CanChangeNet() ) || isFreePad )
|
||||
{
|
||||
if( item->Valid() && item->Parent()->GetNetCode() != cluster->OriginNet() )
|
||||
{
|
||||
|
|
|
@ -416,7 +416,7 @@ void CN_CLUSTER::Add( CN_ITEM* item )
|
|||
if( m_originNet <= 0 )
|
||||
m_originNet = netCode;
|
||||
|
||||
if( item->Parent()->Type() == PCB_PAD_T )
|
||||
if( item->Parent()->Type() == PCB_PAD_T && !static_cast<PAD*>( item->Parent() )->IsFreePad() )
|
||||
{
|
||||
if( m_netRanks.count( netCode ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue