Lowercasing private variables in class_pad

This commit is contained in:
Seth Hillbrand 2020-07-31 05:37:22 -07:00
parent 2c8d20207e
commit 370bc89d5a
3 changed files with 171 additions and 171 deletions

View File

@ -519,9 +519,9 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
// This minimal value is mainly for very small pads, like SM0402. // This minimal value is mainly for very small pads, like SM0402.
// Most of time pads are using the segment count given by aError value. // Most of time pads are using the segment count given by aError value.
const int pad_min_seg_per_circle_count = 16; const int pad_min_seg_per_circle_count = 16;
double angle = m_Orient; double angle = m_orient;
int dx = m_Size.x / 2; int dx = m_size.x / 2;
int dy = m_Size.y / 2; int dy = m_size.y / 2;
wxPoint padShapePos = ShapePos(); // Note: for pad having a shape offset, wxPoint padShapePos = ShapePos(); // Note: for pad having a shape offset,
// the pad position is NOT the shape position // the pad position is NOT the shape position
@ -550,8 +550,8 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
case PAD_SHAPE_TRAPEZOID: case PAD_SHAPE_TRAPEZOID:
case PAD_SHAPE_RECT: case PAD_SHAPE_RECT:
{ {
int ddx = GetShape() == PAD_SHAPE_TRAPEZOID ? m_DeltaSize.x / 2 : 0; int ddx = GetShape() == PAD_SHAPE_TRAPEZOID ? m_deltaSize.x / 2 : 0;
int ddy = GetShape() == PAD_SHAPE_TRAPEZOID ? m_DeltaSize.y / 2 : 0; int ddy = GetShape() == PAD_SHAPE_TRAPEZOID ? m_deltaSize.y / 2 : 0;
wxPoint corners[4]; wxPoint corners[4];
corners[0] = wxPoint( -dx - ddy, dy + ddx ); corners[0] = wxPoint( -dx - ddy, dy + ddx );
@ -593,7 +593,7 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
pad_min_seg_per_circle_count ); pad_min_seg_per_circle_count );
double correction = GetCircletoPolyCorrectionFactor( numSegs ); double correction = GetCircletoPolyCorrectionFactor( numSegs );
int clearance = KiROUND( aClearanceValue * correction ); int clearance = KiROUND( aClearanceValue * correction );
wxSize shapesize( m_Size ); wxSize shapesize( m_size );
radius = KiROUND( radius * correction ); radius = KiROUND( radius * correction );
shapesize.x += clearance * 2; shapesize.x += clearance * 2;
@ -613,8 +613,8 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
{ {
SHAPE_POLY_SET outline; SHAPE_POLY_SET outline;
MergePrimitivesAsPolygon( &outline ); MergePrimitivesAsPolygon( &outline );
outline.Rotate( -DECIDEG2RAD( m_Orient ) ); outline.Rotate( -DECIDEG2RAD( m_orient ) );
outline.Move( VECTOR2I( m_Pos ) ); outline.Move( VECTOR2I( m_pos ) );
// TODO: do we need the Simplify() & Fracture() if we're not inflating? // TODO: do we need the Simplify() & Fracture() if we're not inflating?
outline.Simplify( SHAPE_POLY_SET::PM_FAST ); outline.Simplify( SHAPE_POLY_SET::PM_FAST );

View File

@ -56,35 +56,35 @@
D_PAD::D_PAD( MODULE* parent ) : D_PAD::D_PAD( MODULE* parent ) :
BOARD_CONNECTED_ITEM( parent, PCB_PAD_T ) BOARD_CONNECTED_ITEM( parent, PCB_PAD_T )
{ {
m_Size.x = m_Size.y = Mils2iu( 60 ); // Default pad size 60 mils. m_size.x = m_size.y = Mils2iu( 60 ); // Default pad size 60 mils.
m_Drill.x = m_Drill.y = Mils2iu( 30 ); // Default drill size 30 mils. m_drill.x = m_drill.y = Mils2iu( 30 ); // Default drill size 30 mils.
m_Orient = 0; // Pad rotation in 1/10 degrees. m_orient = 0; // Pad rotation in 1/10 degrees.
m_LengthPadToDie = 0; m_lengthPadToDie = 0;
if( m_Parent && m_Parent->Type() == PCB_MODULE_T ) if( m_Parent && m_Parent->Type() == PCB_MODULE_T )
{ {
m_Pos = GetParent()->GetPosition(); m_pos = GetParent()->GetPosition();
} }
SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE. SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE.
SetAnchorPadShape( PAD_SHAPE_CIRCLE ); // Default shape for custom shaped pads SetAnchorPadShape( PAD_SHAPE_CIRCLE ); // Default shape for custom shaped pads
// is PAD_CIRCLE. // is PAD_CIRCLE.
SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle. SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle.
m_Attribute = PAD_ATTRIB_STANDARD; // Default pad type is NORMAL (thru hole) m_attribute = PAD_ATTRIB_STANDARD; // Default pad type is NORMAL (thru hole)
SetProperty( PAD_PROP_NONE ); // no special fabrication property SetProperty( PAD_PROP_NONE ); // no special fabrication property
m_LocalClearance = 0; m_localClearance = 0;
m_LocalSolderMaskMargin = 0; m_localSolderMaskMargin = 0;
m_LocalSolderPasteMargin = 0; m_localSolderPasteMargin = 0;
m_LocalSolderPasteMarginRatio = 0.0; m_localSolderPasteMarginRatio = 0.0;
// Parameters for round rect only: // Parameters for round rect only:
m_roundedCornerScale = 0.25; // from IPC-7351C standard m_roundedCornerScale = 0.25; // from IPC-7351C standard
// Parameters for chamfered rect only: // Parameters for chamfered rect only:
m_chamferScale = 0.2; // Size of chamfer: ratio of smallest of X,Y size m_chamferScale = 0.2; // Size of chamfer: ratio of smallest of X,Y size
m_chamferPositions = RECT_NO_CHAMFER; // No chamfered corner m_chamferPositions = RECT_NO_CHAMFER; // No chamfered corner
m_ZoneConnection = ZONE_CONNECTION::INHERITED; // Use parent setting by default m_zoneConnection = ZONE_CONNECTION::INHERITED; // Use parent setting by default
m_ThermalWidth = 0; // Use parent setting by default m_thermalWidth = 0; // Use parent setting by default
m_ThermalGap = 0; // Use parent setting by default m_thermalGap = 0; // Use parent setting by default
m_customShapeClearanceArea = CUST_PAD_SHAPE_IN_ZONE_OUTLINE; m_customShapeClearanceArea = CUST_PAD_SHAPE_IN_ZONE_OUTLINE;
@ -95,8 +95,8 @@ D_PAD::D_PAD( MODULE* parent ) :
m_shapesDirty = true; m_shapesDirty = true;
m_effectiveBoundingRadius = 0; m_effectiveBoundingRadius = 0;
m_RemoveUnconnectedLayer = false; m_removeUnconnectedLayer = false;
m_KeepTopBottomLayer = true; m_keepTopBottomLayer = true;
} }
@ -203,7 +203,7 @@ bool D_PAD::IsPadOnLayer( int aLayer ) const
if( GetProperty() == PAD_PROP_HEATSINK ) if( GetProperty() == PAD_PROP_HEATSINK )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) ); return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
if( !m_RemoveUnconnectedLayer ) if( !m_removeUnconnectedLayer )
return true; return true;
/// Plated through hole pads need copper on the top/bottom layers for proper soldering /// Plated through hole pads need copper on the top/bottom layers for proper soldering
@ -217,13 +217,13 @@ bool D_PAD::IsPadOnLayer( int aLayer ) const
int D_PAD::GetRoundRectCornerRadius() const int D_PAD::GetRoundRectCornerRadius() const
{ {
return KiROUND( std::min( m_Size.x, m_Size.y ) * m_roundedCornerScale ); return KiROUND( std::min( m_size.x, m_size.y ) * m_roundedCornerScale );
} }
void D_PAD::SetRoundRectCornerRadius( double aRadius ) void D_PAD::SetRoundRectCornerRadius( double aRadius )
{ {
int min_r = std::min( m_Size.x, m_Size.y ); int min_r = std::min( m_size.x, m_size.y );
if( min_r > 0 ) if( min_r > 0 )
SetRoundRectRadiusRatio( aRadius / min_r ); SetRoundRectRadiusRatio( aRadius / min_r );
@ -315,31 +315,31 @@ void D_PAD::BuildEffectiveShapes() const
switch( effectiveShape ) switch( effectiveShape )
{ {
case PAD_SHAPE_CIRCLE: case PAD_SHAPE_CIRCLE:
add( new SHAPE_CIRCLE( shapePos, m_Size.x / 2 ) ); add( new SHAPE_CIRCLE( shapePos, m_size.x / 2 ) );
break; break;
case PAD_SHAPE_OVAL: case PAD_SHAPE_OVAL:
if( m_Size.x == m_Size.y ) // the oval pad is in fact a circle if( m_size.x == m_size.y ) // the oval pad is in fact a circle
add( new SHAPE_CIRCLE( shapePos, m_Size.x / 2 ) ); add( new SHAPE_CIRCLE( shapePos, m_size.x / 2 ) );
else else
{ {
wxSize half_size = m_Size / 2; wxSize half_size = m_size / 2;
int half_width = std::min( half_size.x, half_size.y ); int half_width = std::min( half_size.x, half_size.y );
wxPoint half_len( half_size.x - half_width, half_size.y - half_width ); wxPoint half_len( half_size.x - half_width, half_size.y - half_width );
RotatePoint( &half_len, m_Orient ); RotatePoint( &half_len, m_orient );
add( new SHAPE_SEGMENT( shapePos - half_len, shapePos + half_len, half_width * 2 ) ); add( new SHAPE_SEGMENT( shapePos - half_len, shapePos + half_len, half_width * 2 ) );
} }
break; break;
case PAD_SHAPE_RECT: case PAD_SHAPE_RECT:
if( m_Orient == 0 || m_Orient == 1800 ) if( m_orient == 0 || m_orient == 1800 )
{ {
add( new SHAPE_RECT( shapePos - m_Size / 2, m_Size.x, m_Size.y ) ); add( new SHAPE_RECT( shapePos - m_size / 2, m_size.x, m_size.y ) );
break; break;
} }
else if( m_Orient == 900 || m_Orient == -900 ) else if( m_orient == 900 || m_orient == -900 )
{ {
wxSize rot_size( m_Size.y, m_Size.x ); wxSize rot_size( m_size.y, m_size.x );
add( new SHAPE_RECT( shapePos - rot_size / 2, rot_size.x, rot_size.y ) ); add( new SHAPE_RECT( shapePos - rot_size / 2, rot_size.x, rot_size.y ) );
break; break;
} }
@ -351,13 +351,13 @@ void D_PAD::BuildEffectiveShapes() const
case PAD_SHAPE_ROUNDRECT: case PAD_SHAPE_ROUNDRECT:
{ {
int r = GetRoundRectCornerRadius(); int r = GetRoundRectCornerRadius();
wxPoint half_size( m_Size.x / 2, m_Size.y / 2 ); wxPoint half_size( m_size.x / 2, m_size.y / 2 );
wxSize trap_delta( 0, 0 ); wxSize trap_delta( 0, 0 );
if( effectiveShape == PAD_SHAPE_ROUNDRECT ) if( effectiveShape == PAD_SHAPE_ROUNDRECT )
half_size -= wxPoint( r, r ); half_size -= wxPoint( r, r );
else if( effectiveShape == PAD_SHAPE_TRAPEZOID ) else if( effectiveShape == PAD_SHAPE_TRAPEZOID )
trap_delta = m_DeltaSize / 2; trap_delta = m_deltaSize / 2;
SHAPE_LINE_CHAIN corners; SHAPE_LINE_CHAIN corners;
@ -366,7 +366,7 @@ void D_PAD::BuildEffectiveShapes() const
corners.Append( half_size.x - trap_delta.y, -half_size.y + trap_delta.x ); corners.Append( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
corners.Append( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x ); corners.Append( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
corners.Rotate( -DECIDEG2RAD( m_Orient ) ); corners.Rotate( -DECIDEG2RAD( m_orient ) );
corners.Move( shapePos ); corners.Move( shapePos );
add( new SHAPE_SIMPLE( corners ) ); add( new SHAPE_SIMPLE( corners ) );
@ -390,7 +390,7 @@ void D_PAD::BuildEffectiveShapes() const
if( board ) if( board )
maxError = board->GetDesignSettings().m_MaxError; maxError = board->GetDesignSettings().m_MaxError;
TransformRoundChamferedRectToPolygon( outline, shapePos, GetSize(), m_Orient, TransformRoundChamferedRectToPolygon( outline, shapePos, GetSize(), m_orient,
GetRoundRectCornerRadius(), GetChamferRectRatio(), GetRoundRectCornerRadius(), GetChamferRectRatio(),
GetChamferPositions(), maxError ); GetChamferPositions(), maxError );
@ -410,7 +410,7 @@ void D_PAD::BuildEffectiveShapes() const
{ {
for( SHAPE* shape : primitive->MakeEffectiveShapes() ) for( SHAPE* shape : primitive->MakeEffectiveShapes() )
{ {
shape->Rotate( -DECIDEG2RAD( m_Orient ) ); shape->Rotate( -DECIDEG2RAD( m_orient ) );
shape->Move( shapePos ); shape->Move( shapePos );
add( shape ); add( shape );
} }
@ -432,7 +432,7 @@ void D_PAD::BuildEffectiveShapes() const
for( int ii = 0; ii < poly.PointCount(); ++ii ) for( int ii = 0; ii < poly.PointCount(); ++ii )
{ {
int dist = KiROUND( ( poly.CPoint( ii ) - m_Pos ).EuclideanNorm() ); int dist = KiROUND( ( poly.CPoint( ii ) - m_pos ).EuclideanNorm() );
m_effectiveBoundingRadius = std::max( m_effectiveBoundingRadius, dist ); m_effectiveBoundingRadius = std::max( m_effectiveBoundingRadius, dist );
} }
} }
@ -450,13 +450,13 @@ void D_PAD::BuildEffectiveShapes() const
} }
// Hole shape // Hole shape
// //
wxSize half_size = m_Drill / 2; wxSize half_size = m_drill / 2;
int half_width = std::min( half_size.x, half_size.y ); int half_width = std::min( half_size.x, half_size.y );
wxPoint half_len( half_size.x - half_width, half_size.y - half_width ); wxPoint half_len( half_size.x - half_width, half_size.y - half_width );
RotatePoint( &half_len, m_Orient ); RotatePoint( &half_len, m_orient );
m_effectiveHoleShape = std::make_shared<SHAPE_SEGMENT>( m_Pos - half_len, m_Pos + half_len, m_effectiveHoleShape = std::make_shared<SHAPE_SEGMENT>( m_pos - half_len, m_pos + half_len,
half_width * 2 ); half_width * 2 );
// All done // All done
@ -478,15 +478,15 @@ void D_PAD::SetDrawCoord()
{ {
MODULE* module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
m_Pos = m_Pos0; m_pos = m_pos0;
if( module == NULL ) if( module == NULL )
return; return;
double angle = module->GetOrientation(); double angle = module->GetOrientation();
RotatePoint( &m_Pos.x, &m_Pos.y, angle ); RotatePoint( &m_pos.x, &m_pos.y, angle );
m_Pos += module->GetPosition(); m_pos += module->GetPosition();
} }
@ -496,21 +496,21 @@ void D_PAD::SetLocalCoord()
if( module == NULL ) if( module == NULL )
{ {
m_Pos0 = m_Pos; m_pos0 = m_pos;
return; return;
} }
m_Pos0 = m_Pos - module->GetPosition(); m_pos0 = m_pos - module->GetPosition();
RotatePoint( &m_Pos0.x, &m_Pos0.y, -module->GetOrientation() ); RotatePoint( &m_pos0.x, &m_pos0.y, -module->GetOrientation() );
} }
void D_PAD::SetAttribute( PAD_ATTR_T aAttribute ) void D_PAD::SetAttribute( PAD_ATTR_T aAttribute )
{ {
m_Attribute = aAttribute; m_attribute = aAttribute;
if( aAttribute == PAD_ATTRIB_SMD ) if( aAttribute == PAD_ATTRIB_SMD )
m_Drill = wxSize( 0, 0 ); m_drill = wxSize( 0, 0 );
m_shapesDirty = true; m_shapesDirty = true;
} }
@ -518,7 +518,7 @@ void D_PAD::SetAttribute( PAD_ATTR_T aAttribute )
void D_PAD::SetProperty( PAD_PROP_T aProperty ) void D_PAD::SetProperty( PAD_PROP_T aProperty )
{ {
m_Property = aProperty; m_property = aProperty;
m_shapesDirty = true; m_shapesDirty = true;
} }
@ -527,7 +527,7 @@ void D_PAD::SetProperty( PAD_PROP_T aProperty )
void D_PAD::SetOrientation( double aAngle ) void D_PAD::SetOrientation( double aAngle )
{ {
NORMALIZE_ANGLE_POS( aAngle ); NORMALIZE_ANGLE_POS( aAngle );
m_Orient = aAngle; m_orient = aAngle;
m_shapesDirty = true; m_shapesDirty = true;
} }
@ -537,17 +537,17 @@ void D_PAD::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
if( aFlipLeftRight ) if( aFlipLeftRight )
{ {
MIRROR( m_Pos.x, aCentre.x ); MIRROR( m_pos.x, aCentre.x );
MIRROR( m_Pos0.x, 0 ); MIRROR( m_pos0.x, 0 );
MIRROR( m_Offset.x, 0 ); MIRROR( m_offset.x, 0 );
MIRROR( m_DeltaSize.x, 0 ); MIRROR( m_deltaSize.x, 0 );
} }
else else
{ {
MIRROR( m_Pos.y, aCentre.y ); MIRROR( m_pos.y, aCentre.y );
MIRROR( m_Pos0.y, 0 ); MIRROR( m_pos0.y, 0 );
MIRROR( m_Offset.y, 0 ); MIRROR( m_offset.y, 0 );
MIRROR( m_DeltaSize.y, 0 ); MIRROR( m_deltaSize.y, 0 );
} }
SetOrientation( -GetOrientation() ); SetOrientation( -GetOrientation() );
@ -604,14 +604,14 @@ void D_PAD::FlipPrimitives( bool aFlipLeftRight )
// Returns the position of the pad. // Returns the position of the pad.
wxPoint D_PAD::ShapePos() const wxPoint D_PAD::ShapePos() const
{ {
if( m_Offset.x == 0 && m_Offset.y == 0 ) if( m_offset.x == 0 && m_offset.y == 0 )
return m_Pos; return m_pos;
wxPoint loc_offset = m_Offset; wxPoint loc_offset = m_offset;
RotatePoint( &loc_offset, m_Orient ); RotatePoint( &loc_offset, m_orient );
wxPoint shape_pos = m_Pos + loc_offset; wxPoint shape_pos = m_pos + loc_offset;
return shape_pos; return shape_pos;
} }
@ -636,7 +636,7 @@ int D_PAD::GetLocalClearance( wxString* aSource ) const
if( aSource ) if( aSource )
*aSource = wxString::Format( _( "pad %s" ), GetName() ); *aSource = wxString::Format( _( "pad %s" ), GetName() );
return m_LocalClearance; return m_localClearance;
} }
@ -653,7 +653,7 @@ int D_PAD::GetSolderMaskMargin() const
if( !isOnCopperLayer ) if( !isOnCopperLayer )
return 0; return 0;
int margin = m_LocalSolderMaskMargin; int margin = m_localSolderMaskMargin;
MODULE* module = GetParent(); MODULE* module = GetParent();
@ -677,7 +677,7 @@ int D_PAD::GetSolderMaskMargin() const
// ensure mask have a size always >= 0 // ensure mask have a size always >= 0
if( margin < 0 ) if( margin < 0 )
{ {
int minsize = -std::min( m_Size.x, m_Size.y ) / 2; int minsize = -std::min( m_size.x, m_size.y ) / 2;
if( margin < minsize ) if( margin < minsize )
margin = minsize; margin = minsize;
@ -698,8 +698,8 @@ wxSize D_PAD::GetSolderPasteMargin() const
if( !isOnCopperLayer ) if( !isOnCopperLayer )
return wxSize( 0, 0 ); return wxSize( 0, 0 );
int margin = m_LocalSolderPasteMargin; int margin = m_localSolderPasteMargin;
double mratio = m_LocalSolderPasteMarginRatio; double mratio = m_localSolderPasteMarginRatio;
MODULE* module = GetParent(); MODULE* module = GetParent();
@ -725,15 +725,15 @@ wxSize D_PAD::GetSolderPasteMargin() const
} }
wxSize pad_margin; wxSize pad_margin;
pad_margin.x = margin + KiROUND( m_Size.x * mratio ); pad_margin.x = margin + KiROUND( m_size.x * mratio );
pad_margin.y = margin + KiROUND( m_Size.y * mratio ); pad_margin.y = margin + KiROUND( m_size.y * mratio );
// ensure mask have a size always >= 0 // ensure mask have a size always >= 0
if( pad_margin.x < -m_Size.x / 2 ) if( pad_margin.x < -m_size.x / 2 )
pad_margin.x = -m_Size.x / 2; pad_margin.x = -m_size.x / 2;
if( pad_margin.y < -m_Size.y / 2 ) if( pad_margin.y < -m_size.y / 2 )
pad_margin.y = -m_Size.y / 2; pad_margin.y = -m_size.y / 2;
return pad_margin; return pad_margin;
} }
@ -743,10 +743,10 @@ ZONE_CONNECTION D_PAD::GetEffectiveZoneConnection() const
{ {
MODULE* module = GetParent(); MODULE* module = GetParent();
if( m_ZoneConnection == ZONE_CONNECTION::INHERITED && module ) if( m_zoneConnection == ZONE_CONNECTION::INHERITED && module )
return module->GetZoneConnection(); return module->GetZoneConnection();
else else
return m_ZoneConnection; return m_zoneConnection;
} }
@ -754,10 +754,10 @@ int D_PAD::GetThermalWidth() const
{ {
MODULE* module = GetParent(); MODULE* module = GetParent();
if( m_ThermalWidth == 0 && module ) if( m_thermalWidth == 0 && module )
return module->GetThermalWidth(); return module->GetThermalWidth();
else else
return m_ThermalWidth; return m_thermalWidth;
} }
@ -765,10 +765,10 @@ int D_PAD::GetThermalGap() const
{ {
MODULE* module = GetParent(); MODULE* module = GetParent();
if( m_ThermalGap == 0 && module ) if( m_thermalGap == 0 && module )
return module->GetThermalGap(); return module->GetThermalGap();
else else
return m_ThermalGap; return m_thermalGap;
} }
@ -821,17 +821,17 @@ void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
aList.emplace_back( ShowPadShape(), props, DARKGREEN ); aList.emplace_back( ShowPadShape(), props, DARKGREEN );
if( (GetShape() == PAD_SHAPE_CIRCLE || GetShape() == PAD_SHAPE_OVAL ) if( (GetShape() == PAD_SHAPE_CIRCLE || GetShape() == PAD_SHAPE_OVAL )
&& m_Size.x == m_Size.y ) && m_size.x == m_size.y )
{ {
msg = MessageTextFromValue( units, m_Size.x, true ); msg = MessageTextFromValue( units, m_size.x, true );
aList.emplace_back( _( "Diameter" ), msg, RED ); aList.emplace_back( _( "Diameter" ), msg, RED );
} }
else else
{ {
msg = MessageTextFromValue( units, m_Size.x, true ); msg = MessageTextFromValue( units, m_size.x, true );
aList.emplace_back( _( "Width" ), msg, RED ); aList.emplace_back( _( "Width" ), msg, RED );
msg = MessageTextFromValue( units, m_Size.y, true ); msg = MessageTextFromValue( units, m_size.y, true );
aList.emplace_back( _( "Height" ), msg, RED ); aList.emplace_back( _( "Height" ), msg, RED );
} }
@ -852,7 +852,7 @@ void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
aList.emplace_back( _( "Length in Package" ), msg, CYAN ); aList.emplace_back( _( "Length in Package" ), msg, CYAN );
} }
msg = MessageTextFromValue( units, m_Drill.x, true ); msg = MessageTextFromValue( units, m_drill.x, true );
if( GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE ) if( GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )
{ {
@ -860,9 +860,9 @@ void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
} }
else else
{ {
msg = MessageTextFromValue( units, m_Drill.x, true ) msg = MessageTextFromValue( units, m_drill.x, true )
+ wxT( "/" ) + wxT( "/" )
+ MessageTextFromValue( units, m_Drill.y, true ); + MessageTextFromValue( units, m_drill.y, true );
aList.emplace_back( _( "Drill X / Y" ), msg, RED ); aList.emplace_back( _( "Drill X / Y" ), msg, RED );
} }
@ -955,28 +955,28 @@ int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
if( ( diff = padref->GetDrillShape() - padcmp->GetDrillShape() ) != 0) if( ( diff = padref->GetDrillShape() - padcmp->GetDrillShape() ) != 0)
return diff; return diff;
if( ( diff = padref->m_Drill.x - padcmp->m_Drill.x ) != 0 ) if( ( diff = padref->m_drill.x - padcmp->m_drill.x ) != 0 )
return diff; return diff;
if( ( diff = padref->m_Drill.y - padcmp->m_Drill.y ) != 0 ) if( ( diff = padref->m_drill.y - padcmp->m_drill.y ) != 0 )
return diff; return diff;
if( ( diff = padref->m_Size.x - padcmp->m_Size.x ) != 0 ) if( ( diff = padref->m_size.x - padcmp->m_size.x ) != 0 )
return diff; return diff;
if( ( diff = padref->m_Size.y - padcmp->m_Size.y ) != 0 ) if( ( diff = padref->m_size.y - padcmp->m_size.y ) != 0 )
return diff; return diff;
if( ( diff = padref->m_Offset.x - padcmp->m_Offset.x ) != 0 ) if( ( diff = padref->m_offset.x - padcmp->m_offset.x ) != 0 )
return diff; return diff;
if( ( diff = padref->m_Offset.y - padcmp->m_Offset.y ) != 0 ) if( ( diff = padref->m_offset.y - padcmp->m_offset.y ) != 0 )
return diff; return diff;
if( ( diff = padref->m_DeltaSize.x - padcmp->m_DeltaSize.x ) != 0 ) if( ( diff = padref->m_deltaSize.x - padcmp->m_deltaSize.x ) != 0 )
return diff; return diff;
if( ( diff = padref->m_DeltaSize.y - padcmp->m_DeltaSize.y ) != 0 ) if( ( diff = padref->m_deltaSize.y - padcmp->m_deltaSize.y ) != 0 )
return diff; return diff;
// TODO: test custom shapes // TODO: test custom shapes
@ -1003,9 +1003,9 @@ int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
void D_PAD::Rotate( const wxPoint& aRotCentre, double aAngle ) void D_PAD::Rotate( const wxPoint& aRotCentre, double aAngle )
{ {
RotatePoint( &m_Pos, aRotCentre, aAngle ); RotatePoint( &m_pos, aRotCentre, aAngle );
m_Orient = NormalizeAngle360Min( m_Orient + aAngle ); m_orient = NormalizeAngle360Min( m_orient + aAngle );
SetLocalCoord(); SetLocalCoord();
@ -1074,8 +1074,8 @@ EDA_ITEM* D_PAD::Clone() const
bool D_PAD::PadShouldBeNPTH() const bool D_PAD::PadShouldBeNPTH() const
{ {
return( m_Attribute == PAD_ATTRIB_STANDARD return( m_attribute == PAD_ATTRIB_STANDARD
&& m_Drill.x >= m_Size.x && m_Drill.y >= m_Size.y ); && m_drill.x >= m_size.x && m_drill.y >= m_size.y );
} }
@ -1084,10 +1084,10 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
aCount = 0; aCount = 0;
// These 2 types of pads contain a hole // These 2 types of pads contain a hole
if( m_Attribute == PAD_ATTRIB_STANDARD ) if( m_attribute == PAD_ATTRIB_STANDARD )
aLayers[aCount++] = LAYER_PADS_PLATEDHOLES; aLayers[aCount++] = LAYER_PADS_PLATEDHOLES;
if( m_Attribute == PAD_ATTRIB_HOLE_NOT_PLATED ) if( m_attribute == PAD_ATTRIB_HOLE_NOT_PLATED )
aLayers[aCount++] = LAYER_NON_PLATEDHOLES; aLayers[aCount++] = LAYER_NON_PLATEDHOLES;
if( IsOnLayer( F_Cu ) && IsOnLayer( B_Cu ) ) if( IsOnLayer( F_Cu ) && IsOnLayer( B_Cu ) )
@ -1102,7 +1102,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
// Is this a PTH pad that has only front copper? If so, we need to also display the // Is this a PTH pad that has only front copper? If so, we need to also display the
// net name on the PTH netname layer so that it isn't blocked by the drill hole. // net name on the PTH netname layer so that it isn't blocked by the drill hole.
if( m_Attribute == PAD_ATTRIB_STANDARD ) if( m_attribute == PAD_ATTRIB_STANDARD )
aLayers[aCount++] = LAYER_PADS_NETNAMES; aLayers[aCount++] = LAYER_PADS_NETNAMES;
else else
aLayers[aCount++] = LAYER_PAD_FR_NETNAMES; aLayers[aCount++] = LAYER_PAD_FR_NETNAMES;
@ -1113,7 +1113,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
// Is this a PTH pad that has only back copper? If so, we need to also display the // Is this a PTH pad that has only back copper? If so, we need to also display the
// net name on the PTH netname layer so that it isn't blocked by the drill hole. // net name on the PTH netname layer so that it isn't blocked by the drill hole.
if( m_Attribute == PAD_ATTRIB_STANDARD ) if( m_attribute == PAD_ATTRIB_STANDARD )
aLayers[aCount++] = LAYER_PADS_NETNAMES; aLayers[aCount++] = LAYER_PADS_NETNAMES;
else else
aLayers[aCount++] = LAYER_PAD_BK_NETNAMES; aLayers[aCount++] = LAYER_PAD_BK_NETNAMES;

View File

@ -94,13 +94,13 @@ public:
for( const KICAD_T* p = aScanTypes; *p != EOT; ++p ) for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
{ {
if( m_Drill.x > 0 && m_Drill.y > 0 ) if( m_drill.x > 0 && m_drill.y > 0 )
{ {
if( *p == PCB_LOCATE_HOLE_T ) if( *p == PCB_LOCATE_HOLE_T )
return true; return true;
else if( *p == PCB_LOCATE_PTH_T && m_Attribute != PAD_ATTRIB_HOLE_NOT_PLATED ) else if( *p == PCB_LOCATE_PTH_T && m_attribute != PAD_ATTRIB_HOLE_NOT_PLATED )
return true; return true;
else if( *p == PCB_LOCATE_NPTH_T && m_Attribute == PAD_ATTRIB_HOLE_NOT_PLATED ) else if( *p == PCB_LOCATE_NPTH_T && m_attribute == PAD_ATTRIB_HOLE_NOT_PLATED )
return true; return true;
} }
} }
@ -158,11 +158,11 @@ public:
void SetPosition( const wxPoint& aPos ) override void SetPosition( const wxPoint& aPos ) override
{ {
m_Pos = aPos; m_pos = aPos;
m_shapesDirty = true; m_shapesDirty = true;
} }
wxPoint GetPosition() const override { return m_Pos; } wxPoint GetPosition() const override { return m_pos; }
/** /**
* Function GetAnchorPadShape * Function GetAnchorPadShape
@ -211,26 +211,26 @@ public:
return ( GetLayerSet() & LSET::AllCuMask() ) != 0; return ( GetLayerSet() & LSET::AllCuMask() ) != 0;
} }
void SetY( int y ) { m_Pos.y = y; m_shapesDirty = true; } void SetY( int y ) { m_pos.y = y; m_shapesDirty = true; }
void SetX( int x ) { m_Pos.x = x; m_shapesDirty = true; } void SetX( int x ) { m_pos.x = x; m_shapesDirty = true; }
void SetPos0( const wxPoint& aPos ) { m_Pos0 = aPos; } void SetPos0( const wxPoint& aPos ) { m_pos0 = aPos; }
const wxPoint& GetPos0() const { return m_Pos0; } const wxPoint& GetPos0() const { return m_pos0; }
void SetY0( int y ) { m_Pos0.y = y; } void SetY0( int y ) { m_pos0.y = y; }
void SetX0( int x ) { m_Pos0.x = x; } void SetX0( int x ) { m_pos0.x = x; }
void SetSize( const wxSize& aSize ) { m_Size = aSize; m_shapesDirty = true; } void SetSize( const wxSize& aSize ) { m_size = aSize; m_shapesDirty = true; }
const wxSize& GetSize() const { return m_Size; } const wxSize& GetSize() const { return m_size; }
void SetDelta( const wxSize& aSize ) { m_DeltaSize = aSize; m_shapesDirty = true; } void SetDelta( const wxSize& aSize ) { m_deltaSize = aSize; m_shapesDirty = true; }
const wxSize& GetDelta() const { return m_DeltaSize; } const wxSize& GetDelta() const { return m_deltaSize; }
void SetDrillSize( const wxSize& aSize ) { m_Drill = aSize; m_shapesDirty = true; } void SetDrillSize( const wxSize& aSize ) { m_drill = aSize; m_shapesDirty = true; }
const wxSize& GetDrillSize() const { return m_Drill; } const wxSize& GetDrillSize() const { return m_drill; }
void SetOffset( const wxPoint& aOffset ) { m_Offset = aOffset; m_shapesDirty = true; } void SetOffset( const wxPoint& aOffset ) { m_offset = aOffset; m_shapesDirty = true; }
const wxPoint& GetOffset() const { return m_Offset; } const wxPoint& GetOffset() const { return m_offset; }
/** /**
* Has meaning only for custom shape pads. * Has meaning only for custom shape pads.
@ -322,9 +322,9 @@ public:
* Function GetOrientation * Function GetOrientation
* returns the rotation angle of the pad in tenths of degrees, but soon degrees. * returns the rotation angle of the pad in tenths of degrees, but soon degrees.
*/ */
double GetOrientation() const { return m_Orient; } double GetOrientation() const { return m_orient; }
double GetOrientationDegrees() const { return m_Orient/10.0; } double GetOrientationDegrees() const { return m_orient/10.0; }
double GetOrientationRadians() const { return m_Orient*M_PI/1800; } double GetOrientationRadians() const { return m_orient*M_PI/1800; }
void SetDrillShape( PAD_DRILL_SHAPE_T aShape ) { m_drillShape = aShape; m_shapesDirty = true; } void SetDrillShape( PAD_DRILL_SHAPE_T aShape ) { m_drillShape = aShape; m_shapesDirty = true; }
PAD_DRILL_SHAPE_T GetDrillShape() const { return m_drillShape; } PAD_DRILL_SHAPE_T GetDrillShape() const { return m_drillShape; }
@ -335,29 +335,29 @@ public:
LSET GetLayerSet() const override { return m_layerMask; } LSET GetLayerSet() const override { return m_layerMask; }
void SetAttribute( PAD_ATTR_T aAttribute ); void SetAttribute( PAD_ATTR_T aAttribute );
PAD_ATTR_T GetAttribute() const { return m_Attribute; } PAD_ATTR_T GetAttribute() const { return m_attribute; }
void SetProperty( PAD_PROP_T aProperty ); void SetProperty( PAD_PROP_T aProperty );
PAD_PROP_T GetProperty() const { return m_Property; } PAD_PROP_T GetProperty() const { return m_property; }
// We don't currently have an attribute for APERTURE, and adding one will change the file // We don't currently have an attribute for APERTURE, and adding one will change the file
// format, so for now just infer a copper-less pad to be an APERTURE pad. // format, so for now just infer a copper-less pad to be an APERTURE pad.
bool IsAperturePad() const { return ( m_layerMask & LSET::AllCuMask() ).none(); } bool IsAperturePad() const { return ( m_layerMask & LSET::AllCuMask() ).none(); }
void SetPadToDieLength( int aLength ) { m_LengthPadToDie = aLength; } void SetPadToDieLength( int aLength ) { m_lengthPadToDie = aLength; }
int GetPadToDieLength() const { return m_LengthPadToDie; } int GetPadToDieLength() const { return m_lengthPadToDie; }
int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; } int GetLocalSolderMaskMargin() const { return m_localSolderMaskMargin; }
void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; } void SetLocalSolderMaskMargin( int aMargin ) { m_localSolderMaskMargin = aMargin; }
int GetLocalClearance( wxString* aSource = nullptr ) const override; int GetLocalClearance( wxString* aSource = nullptr ) const override;
void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; } void SetLocalClearance( int aClearance ) { m_localClearance = aClearance; }
int GetLocalSolderPasteMargin() const { return m_LocalSolderPasteMargin; } int GetLocalSolderPasteMargin() const { return m_localSolderPasteMargin; }
void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; } void SetLocalSolderPasteMargin( int aMargin ) { m_localSolderPasteMargin = aMargin; }
double GetLocalSolderPasteMarginRatio() const { return m_LocalSolderPasteMarginRatio; } double GetLocalSolderPasteMarginRatio() const { return m_localSolderPasteMarginRatio; }
void SetLocalSolderPasteMarginRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; } void SetLocalSolderPasteMarginRatio( double aRatio ) { m_localSolderPasteMarginRatio = aRatio; }
/** /**
* Function TransformShapeWithClearanceToPolygon * Function TransformShapeWithClearanceToPolygon
@ -441,8 +441,8 @@ public:
*/ */
wxSize GetSolderPasteMargin() const; wxSize GetSolderPasteMargin() const;
void SetZoneConnection( ZONE_CONNECTION aType ) { m_ZoneConnection = aType; } void SetZoneConnection( ZONE_CONNECTION aType ) { m_zoneConnection = aType; }
ZONE_CONNECTION GetZoneConnection() const { return m_ZoneConnection; } ZONE_CONNECTION GetZoneConnection() const { return m_zoneConnection; }
/** /**
* Return the zone connection in effect (either locally overridden or overridden in the * Return the zone connection in effect (either locally overridden or overridden in the
@ -455,10 +455,10 @@ public:
* override similar settings in the parent footprint and zone. * override similar settings in the parent footprint and zone.
* @param aWidth * @param aWidth
*/ */
void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; } void SetThermalWidth( int aWidth ) { m_thermalWidth = aWidth; }
int GetThermalWidth() const; int GetThermalWidth() const;
void SetThermalGap( int aGap ) { m_ThermalGap = aGap; } void SetThermalGap( int aGap ) { m_thermalGap = aGap; }
int GetThermalGap() const; int GetThermalGap() const;
/** /**
@ -499,22 +499,22 @@ public:
* Function GetSubRatsnest * Function GetSubRatsnest
* @return int - the netcode * @return int - the netcode
*/ */
int GetSubRatsnest() const { return m_SubRatsnest; } int GetSubRatsnest() const { return m_subRatsnest; }
void SetSubRatsnest( int aSubRatsnest ) { m_SubRatsnest = aSubRatsnest; } void SetSubRatsnest( int aSubRatsnest ) { m_subRatsnest = aSubRatsnest; }
/** /**
* Sets the unconnected removal property. If true, the copper is removed on zone fill * Sets the unconnected removal property. If true, the copper is removed on zone fill
* or when specifically requested when the pad is not connected on a layer. This requires * or when specifically requested when the pad is not connected on a layer. This requires
* that there be a through hole. * that there be a through hole.
*/ */
void SetRemoveUnconnected( bool aSet ) { m_RemoveUnconnectedLayer = aSet; } void SetRemoveUnconnected( bool aSet ) { m_removeUnconnectedLayer = aSet; }
bool GetRemoveUnconnected() const { return m_RemoveUnconnectedLayer; } bool GetRemoveUnconnected() const { return m_removeUnconnectedLayer; }
/** /**
* Sets whether we keep the top and bottom connections even if they are not connected * Sets whether we keep the top and bottom connections even if they are not connected
*/ */
void SetKeepTopBottom( bool aSet ) { m_KeepTopBottomLayer = aSet; } void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; }
bool GetKeepTopBottom() const { return m_KeepTopBottomLayer; } bool GetKeepTopBottom() const { return m_keepTopBottomLayer; }
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override; void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
@ -559,7 +559,7 @@ public:
void Move( const wxPoint& aMoveVector ) override void Move( const wxPoint& aMoveVector ) override
{ {
m_Pos += aMoveVector; m_pos += aMoveVector;
SetLocalCoord(); SetLocalCoord();
m_shapesDirty = true; m_shapesDirty = true;
} }
@ -626,7 +626,7 @@ private:
wxString m_name; // Pad name (pin number in schematic) wxString m_name; // Pad name (pin number in schematic)
wxString m_pinFunction; // Pin function in schematic wxString m_pinFunction; // Pin function in schematic
wxPoint m_Pos; // Pad Position on board wxPoint m_pos; // Pad Position on board
PAD_SHAPE_T m_padShape; // Shape: PAD_SHAPE_CIRCLE, PAD_SHAPE_RECT, PAD_SHAPE_T m_padShape; // Shape: PAD_SHAPE_CIRCLE, PAD_SHAPE_RECT,
// PAD_SHAPE_OVAL, PAD_SHAPE_TRAPEZOID, // PAD_SHAPE_OVAL, PAD_SHAPE_TRAPEZOID,
@ -651,11 +651,11 @@ private:
*/ */
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea; CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea;
int m_SubRatsnest; // Variable used to handle subnet (block) number in int m_subRatsnest; // Variable used to handle subnet (block) number in
// ratsnest computations // ratsnest computations
wxSize m_Drill; // Drill diameter (x == y) or slot dimensions (x != y) wxSize m_drill; // Drill diameter (x == y) or slot dimensions (x != y)
wxSize m_Size; // X and Y size (relative to orient 0) wxSize m_size; // X and Y size (relative to orient 0)
PAD_DRILL_SHAPE_T m_drillShape; // PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG PAD_DRILL_SHAPE_T m_drillShape; // PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG
@ -675,28 +675,28 @@ private:
* of the pad shape (ie: the copper area around the hole). * of the pad shape (ie: the copper area around the hole).
* ShapePos() returns the board shape position according to the offset and the pad rotation. * ShapePos() returns the board shape position according to the offset and the pad rotation.
*/ */
wxPoint m_Offset; wxPoint m_offset;
LSET m_layerMask; // Bitwise layer: 1 = copper layer, 15 = cmp, LSET m_layerMask; // Bitwise layer: 1 = copper layer, 15 = cmp,
// 2..14 = internal layers, 16..31 = technical layers // 2..14 = internal layers, 16..31 = technical layers
wxSize m_DeltaSize; // Delta for PAD_SHAPE_TRAPEZOID; half the delta squeezes wxSize m_deltaSize; // Delta for PAD_SHAPE_TRAPEZOID; half the delta squeezes
// one end and half expands the other. It is only valid // one end and half expands the other. It is only valid
// to have a single axis be non-0. // to have a single axis be non-0.
wxPoint m_Pos0; // Initial Pad position (i.e. pad position relative to the wxPoint m_pos0; // Initial Pad position (i.e. pad position relative to the
// module anchor, orientation 0) // module anchor, orientation 0)
PAD_ATTR_T m_Attribute; // PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN, PAD_ATTR_T m_attribute; // PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN,
// PAD_ATTRIB_HOLE_NOT_PLATED // PAD_ATTRIB_HOLE_NOT_PLATED
PAD_PROP_T m_Property; // Property in fab files (BGA, FIDUCIAL, TESTPOINT, etc.) PAD_PROP_T m_property; // Property in fab files (BGA, FIDUCIAL, TESTPOINT, etc.)
double m_Orient; // in 1/10 degrees double m_orient; // in 1/10 degrees
int m_LengthPadToDie; // Length net from pad to die, inside the package int m_lengthPadToDie; // Length net from pad to die, inside the package
bool m_RemoveUnconnectedLayer; // If true, the pad copper is removed for layers that are not connected bool m_removeUnconnectedLayer; // If true, the pad copper is removed for layers that are not connected
bool m_KeepTopBottomLayer; // When removing unconnected pads, keep the top and bottom pads bool m_keepTopBottomLayer; // When removing unconnected pads, keep the top and bottom pads
/* /*
* Pad clearances, margins, etc. exist in a hiearchy. If a given level is specified then * Pad clearances, margins, etc. exist in a hiearchy. If a given level is specified then
@ -708,15 +708,15 @@ private:
* *
* These are the LEVEL 1 settings for a pad. * These are the LEVEL 1 settings for a pad.
*/ */
int m_LocalClearance; int m_localClearance;
int m_LocalSolderMaskMargin; // Local solder mask margin int m_localSolderMaskMargin; // Local solder mask margin
int m_LocalSolderPasteMargin; // Local solder paste margin absolute value int m_localSolderPasteMargin; // Local solder paste margin absolute value
double m_LocalSolderPasteMarginRatio; // Local solder mask margin ratio of pad size double m_localSolderPasteMarginRatio; // Local solder mask margin ratio of pad size
// The final margin is the sum of these 2 values // The final margin is the sum of these 2 values
ZONE_CONNECTION m_ZoneConnection; // No connection, thermal relief, etc. ZONE_CONNECTION m_zoneConnection; // No connection, thermal relief, etc.
int m_ThermalWidth; // Thermal spoke width. int m_thermalWidth; // Thermal spoke width.
int m_ThermalGap; int m_thermalGap;
}; };
#endif // PAD_H_ #endif // PAD_H_