Pcbnew: fix issue when creating new tracks: sometimes a ratsnest remains active although a track exists.

This commit is contained in:
jean-pierre charras 2011-12-14 12:31:49 +01:00
parent d5a1736346
commit 02bb2111e2
1 changed files with 9 additions and 5 deletions

View File

@ -107,8 +107,9 @@ public:
* when not tracks there are a cluster per pad * when not tracks there are a cluster per pad
* @param aFirstTrack = first track of the given net * @param aFirstTrack = first track of the given net
* @param aLastTrack = last track of the given net * @param aLastTrack = last track of the given net
* @param aNetcode = the netcode of the given net
*/ */
void Build_CurrNet_SubNets_Connections( TRACK* aFirstTrack, TRACK* aLastTrack ); void Build_CurrNet_SubNets_Connections( TRACK* aFirstTrack, TRACK* aLastTrack, int aNetcode );
/** /**
* Function BuildTracksCandidatesList * Function BuildTracksCandidatesList
@ -500,7 +501,7 @@ int CONNECTIONS::searchEntryPoint( const wxPoint & aPoint)
* Connections to pads are assumed to be already initialized. * Connections to pads are assumed to be already initialized.
* and are not recalculated * and are not recalculated
*/ */
void CONNECTIONS::Build_CurrNet_SubNets_Connections( TRACK* aFirstTrack, TRACK* aLastTrack ) void CONNECTIONS::Build_CurrNet_SubNets_Connections( TRACK* aFirstTrack, TRACK* aLastTrack, int aNetcode )
{ {
m_firstTrack = aFirstTrack; // The first track used to build m_Candidates m_firstTrack = aFirstTrack; // The first track used to build m_Candidates
@ -525,8 +526,11 @@ void CONNECTIONS::Build_CurrNet_SubNets_Connections( TRACK* aFirstTrack, TRACK*
break; break;
} }
// Creates sub nets (clusters) for the current net: // Update connections between tracks and pads
BuildPadsList( aNetcode );
SearchTracksConnectedToPads();
// Creates sub nets (clusters) for the current net:
Propagate_SubNets(); Propagate_SubNets();
} }
@ -703,7 +707,7 @@ void PCB_BASE_FRAME::TestConnections()
TRACK* lastTrack = track->GetEndNetCode( current_net_code ); TRACK* lastTrack = track->GetEndNetCode( current_net_code );
if( current_net_code ) // do not spend time if net code = 0 ( dummy net ) if( current_net_code ) // do not spend time if net code = 0 ( dummy net )
connections.Build_CurrNet_SubNets_Connections( track, lastTrack ); connections.Build_CurrNet_SubNets_Connections( track, lastTrack, current_net_code );
track = lastTrack->Next(); // this is now the first track of the next net track = lastTrack->Next(); // this is now the first track of the next net
} }
@ -754,7 +758,7 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode )
if( firstTrack && lastTrack ) // i.e. if there are segments if( firstTrack && lastTrack ) // i.e. if there are segments
{ {
connections.Build_CurrNet_SubNets_Connections( firstTrack, lastTrack ); connections.Build_CurrNet_SubNets_Connections( firstTrack, lastTrack, firstTrack->GetNet() );
} }
} }