Commit 330b8bff authored by Wayne Stambaugh's avatar Wayne Stambaugh

Fix bug caused by setting default drill size in D_PAD (fixes lp:1123392).

* Add check for pad type and force drill size to zero if pad is surface
  mount in PCB_PARSER.
* Modify the D_PAD SetAttribute method to clear drill size if pad type is
  set to surface mount.
parent e1addadb
...@@ -135,6 +135,15 @@ EDA_RECT D_PAD::GetBoundingBox() const ...@@ -135,6 +135,15 @@ EDA_RECT D_PAD::GetBoundingBox() const
} }
void D_PAD::SetAttribute( PAD_ATTR_T aAttribute )
{
m_Attribute = aAttribute;
if( aAttribute == PAD_SMD )
m_Drill = wxSize( 0, 0 );
}
void D_PAD::SetOrientation( double aAngle ) void D_PAD::SetOrientation( double aAngle )
{ {
NORMALIZE_ANGLE_POS( aAngle ); NORMALIZE_ANGLE_POS( aAngle );
......
...@@ -189,7 +189,7 @@ public: ...@@ -189,7 +189,7 @@ public:
void SetLayerMask( int aLayerMask ) { m_layerMask = aLayerMask; } void SetLayerMask( int aLayerMask ) { m_layerMask = aLayerMask; }
int GetLayerMask() const { return m_layerMask; } int GetLayerMask() const { return m_layerMask; }
void SetAttribute( PAD_ATTR_T aAttribute ) { m_Attribute = aAttribute; } void SetAttribute( PAD_ATTR_T aAttribute );
PAD_ATTR_T GetAttribute() const { return m_Attribute; } PAD_ATTR_T GetAttribute() const { return m_Attribute; }
void SetPadToDieLength( int aLength ) { m_LengthPadToDie = aLength; } void SetPadToDieLength( int aLength ) { m_LengthPadToDie = aLength; }
......
...@@ -2002,6 +2002,9 @@ D_PAD* PCB_PARSER::parseD_PAD() throw( IO_ERROR, PARSE_ERROR ) ...@@ -2002,6 +2002,9 @@ D_PAD* PCB_PARSER::parseD_PAD() throw( IO_ERROR, PARSE_ERROR )
case T_smd: case T_smd:
pad->SetAttribute( PAD_SMD ); pad->SetAttribute( PAD_SMD );
// Default D_PAD object is thru hole with drill.
pad->SetDrillSize( wxSize( 0, 0 ) );
break; break;
case T_connect: case T_connect:
...@@ -2130,7 +2133,15 @@ D_PAD* PCB_PARSER::parseD_PAD() throw( IO_ERROR, PARSE_ERROR ) ...@@ -2130,7 +2133,15 @@ D_PAD* PCB_PARSER::parseD_PAD() throw( IO_ERROR, PARSE_ERROR )
} }
} }
pad->SetDrillSize( drillSize ); // This fixes a bug caused by setting the default D_PAD drill size to a value
// other than 0 used to fix a bunch of debug assertions even though it is defined
// as a through hole pad. Wouldn't a though hole pad with no drill be a surface
// mount pad?
if( pad->GetAttribute() != PAD_SMD )
pad->SetDrillSize( drillSize );
else
pad->SetDrillSize( wxSize( 0, 0 ) );
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment