Make sure fixes to netlist stuff are done on both sides.
This fixes the CmpNoCase() == 0 bug on one side, and the footprint == null bug on the other side; both of which were previously fixed on only one side. Fixes: lp:1795561 * https://bugs.launchpad.net/kicad/+bug/1795561
This commit is contained in:
parent
afd518d1e8
commit
536451138d
|
@ -632,6 +632,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
|
||||||
{
|
{
|
||||||
COMPONENT* component = aNetlist.GetComponent( i );
|
COMPONENT* component = aNetlist.GetComponent( i );
|
||||||
int matchCount = 0;
|
int matchCount = 0;
|
||||||
|
MODULE* tmp;
|
||||||
|
|
||||||
msg.Printf( _( "Processing component \"%s:%s:%s\"." ),
|
msg.Printf( _( "Processing component \"%s:%s:%s\"." ),
|
||||||
component->GetReference(),
|
component->GetReference(),
|
||||||
|
@ -639,12 +640,9 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
|
||||||
component->GetFPID().Format().wx_str() );
|
component->GetFPID().Format().wx_str() );
|
||||||
m_reporter->Report( msg, REPORTER::RPT_INFO );
|
m_reporter->Report( msg, REPORTER::RPT_INFO );
|
||||||
|
|
||||||
// This loop must be executed at least once to add new footprints even
|
for( MODULE* footprint = m_board->m_Modules; footprint; footprint = footprint->Next() )
|
||||||
// if the board has no existing footprints:
|
|
||||||
for( MODULE* footprint = m_board->m_Modules; ; footprint = footprint->Next() )
|
|
||||||
{
|
{
|
||||||
bool match = false;
|
bool match = false;
|
||||||
MODULE* tmp;
|
|
||||||
|
|
||||||
if( footprint )
|
if( footprint )
|
||||||
{
|
{
|
||||||
|
@ -672,25 +670,22 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
|
||||||
|
|
||||||
if( footprint == lastPreexistingFootprint )
|
if( footprint == lastPreexistingFootprint )
|
||||||
{
|
{
|
||||||
if( matchCount == 0 )
|
|
||||||
{
|
|
||||||
tmp = addNewComponent( component );
|
|
||||||
|
|
||||||
if( tmp )
|
|
||||||
{
|
|
||||||
updateComponentParameters( tmp, component );
|
|
||||||
updateComponentPadConnections( tmp, component );
|
|
||||||
}
|
|
||||||
|
|
||||||
matchCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No sense going through the newly-created footprints: end of loop
|
// No sense going through the newly-created footprints: end of loop
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( matchCount > 1 )
|
if( matchCount == 0 )
|
||||||
|
{
|
||||||
|
tmp = addNewComponent( component );
|
||||||
|
|
||||||
|
if( tmp )
|
||||||
|
{
|
||||||
|
updateComponentParameters( tmp, component );
|
||||||
|
updateComponentPadConnections( tmp, component );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( matchCount > 1 )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Multiple footprints found for \"%s\"." ),
|
msg.Printf( _( "Multiple footprints found for \"%s\"." ),
|
||||||
component->GetReference() );
|
component->GetReference() );
|
||||||
|
|
|
@ -2575,7 +2575,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
||||||
if( aNetlist.IsFindByTimeStamp() )
|
if( aNetlist.IsFindByTimeStamp() )
|
||||||
match = footprint->GetPath() == component->GetTimeStamp();
|
match = footprint->GetPath() == component->GetTimeStamp();
|
||||||
else
|
else
|
||||||
match = footprint->GetReference().CmpNoCase( component->GetReference() );
|
match = footprint->GetReference().CmpNoCase( component->GetReference() ) == 0;
|
||||||
|
|
||||||
if( match )
|
if( match )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue