Eagle: Fix stacked NC pin import

Since Eagle does not connect stacked NC pins but KiCad will if the pins
are coincident, we choose to only import the first of the stacked NC
pins.  While this creates symbols that are slightly different in pin
count from the Eagle version, it keeps the schematic and netlist
functionally correct relative to the Eagle version.

Fixes: lp:1821319
* https://bugs.launchpad.net/kicad/+bug/1821319
This commit is contained in:
Seth Hillbrand 2019-06-09 17:00:09 -07:00
parent 3b3165ad51
commit 370109b868
1 changed files with 7 additions and 0 deletions

View File

@ -1451,14 +1451,21 @@ bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_P
pin->SetNumberTextSize( 0 );
}
// Eagle does not connect multiple NC pins together when they are stacked.
// KiCad will do this for pins that are coincident. We opt here for correct
// schematic netlist and leave out the multiple NC pins when stacked.
for( unsigned i = 0; i < pads.GetCount(); i++)
{
if( pin->GetType() == PIN_NC && i > 0)
break;
LIB_PIN* apin = new LIB_PIN( *pin );
wxString padname( pads[i] );
apin->SetNumber( padname );
aPart->AddDrawItem( apin );
}
break;
}
}