CADSTAR PCB: Fix regression when loading pads in footprints

Zero sized pads can be valid - e.g. a through hole pad
This commit is contained in:
Roberto Fernandez Bautista 2022-09-04 00:21:56 +02:00
parent 9abf3438b8
commit fa5dc23797
1 changed files with 6 additions and 13 deletions

View File

@ -836,12 +836,6 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen
shapePolys.Move( aFootprint->GetPosition() - anchorPos );
pad->AddPrimitivePoly( shapePolys, 0, true );
aFootprint->Add( pad.release(), ADD_MODE::APPEND ); // Append so that we get the correct behaviour
// when finding pads by PAD_ID. See loadNets()
m_librarycopperpads[aComponent.ID][anchorPad.ID].push_back( aFootprint->Pads().size() );
totalCopperPads++;
// Now renumber all the associated pads
COMPONENT_PAD associatedPad;
@ -850,6 +844,12 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen
PAD* assocPad = getPadReference( aFootprint, padID );
assocPad->SetNumber( pad->GetNumber() );
}
aFootprint->Add( pad.release(), ADD_MODE::APPEND ); // Append so that we get the correct behaviour
// when finding pads by PAD_ID. See loadNets()
m_librarycopperpads[aComponent.ID][anchorPad.ID].push_back( aFootprint->Pads().size() );
totalCopperPads++;
}
else
{
@ -925,13 +925,6 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
PADCODE csPadcode = getPadCode( aCadstarPad.PadCodeID );
wxString errorMSG;
if( csPadcode.Shape.Size <= 0)
{
wxLogError( _( "Invalid zero-sized pad ignored in\nfile: %s" ), m_board->GetFileName() );
return nullptr;
}
std::unique_ptr<PAD> pad = std::make_unique<PAD>( aParent );
LSET padLayerSet;