Eagle: Make pad drill optional to support some DipTrace-exported boards.
This commit is contained in:
@@ -815,11 +815,11 @@ EPAD::EPAD( wxXmlNode* aPad )
|
||||
>
|
||||
*/
|
||||
|
||||
// #REQUIRED says DTD, throw exception if not found
|
||||
drill = parseRequiredAttribute<ECOORD>( aPad, "drill" );
|
||||
// #REQUIRED says DTD, but DipTrace doesn't write it sometimes
|
||||
drill = parseOptionalAttribute<ECOORD>( aPad, "drill" );
|
||||
|
||||
// Optional attributes
|
||||
diameter = parseOptionalAttribute<ECOORD>( aPad, "diameter" );
|
||||
diameter = parseOptionalAttribute<ECOORD>( aPad, "diameter" );
|
||||
|
||||
opt_wxString s = parseOptionalAttribute<wxString>( aPad, "shape" );
|
||||
|
||||
|
||||
@@ -711,7 +711,7 @@ struct EPAD_COMMON
|
||||
/// Eagle thru hole pad
|
||||
struct EPAD : public EPAD_COMMON
|
||||
{
|
||||
ECOORD drill;
|
||||
opt_ecoord drill;
|
||||
opt_ecoord diameter;
|
||||
|
||||
// for shape: (square | round | octagon | long | offset)
|
||||
|
||||
@@ -1938,7 +1938,7 @@ void PCB_IO_EAGLE::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
|
||||
// this is thru hole technology here, no SMDs
|
||||
EPAD e( aTree );
|
||||
int shape = EPAD::UNDEF;
|
||||
int eagleDrillz = e.drill.ToPcbUnits();
|
||||
int eagleDrillz = e.drill ? e.drill->ToPcbUnits() : 0;
|
||||
|
||||
std::unique_ptr<PAD> pad = std::make_unique<PAD>( aFootprint );
|
||||
transferPad( e, pad.get() );
|
||||
@@ -2029,7 +2029,7 @@ void PCB_IO_EAGLE::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
|
||||
// Eagle spokes are always '+'
|
||||
pad->SetThermalSpokeAngle( ANGLE_0 );
|
||||
|
||||
if( pad->GetSizeX() > 0 && pad->GetSizeY() > 0 )
|
||||
if( pad->GetSizeX() > 0 && pad->GetSizeY() > 0 && pad->HasHole() )
|
||||
{
|
||||
aFootprint->Add( pad.release() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user