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:
parent
9abf3438b8
commit
fa5dc23797
|
@ -836,12 +836,6 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen
|
||||||
shapePolys.Move( aFootprint->GetPosition() - anchorPos );
|
shapePolys.Move( aFootprint->GetPosition() - anchorPos );
|
||||||
pad->AddPrimitivePoly( shapePolys, 0, true );
|
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
|
// Now renumber all the associated pads
|
||||||
COMPONENT_PAD associatedPad;
|
COMPONENT_PAD associatedPad;
|
||||||
|
|
||||||
|
@ -850,6 +844,12 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen
|
||||||
PAD* assocPad = getPadReference( aFootprint, padID );
|
PAD* assocPad = getPadReference( aFootprint, padID );
|
||||||
assocPad->SetNumber( pad->GetNumber() );
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -925,13 +925,6 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
|
||||||
PADCODE csPadcode = getPadCode( aCadstarPad.PadCodeID );
|
PADCODE csPadcode = getPadCode( aCadstarPad.PadCodeID );
|
||||||
wxString errorMSG;
|
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 );
|
std::unique_ptr<PAD> pad = std::make_unique<PAD>( aParent );
|
||||||
LSET padLayerSet;
|
LSET padLayerSet;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue