D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, PCB_PAD_T ) { m_NumPadName = 0; m_Size.x = m_Size.y = DMils2iu( 600 ); // Default pad size 60 mils. m_Drill.x = m_Drill.y = DMils2iu( 300 ); // Default drill size 30 mils. m_Orient = 0; // Pad rotation in 1/10 degrees. m_LengthPadToDie = 0; if( m_Parent && m_Parent->Type() == PCB_MODULE_T ) { m_Pos = GetParent()->GetPosition(); } SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_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_LocalClearance = 0; m_LocalSolderMaskMargin = 0; m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMarginRatio = 0.0; m_ZoneConnection = PAD_ZONE_CONN_INHERITED; // Use parent setting by default m_ThermalWidth = 0; // Use parent setting by default m_ThermalGap = 0; // Use parent setting by default // Set layers mask to default for a standard thru hole pad. m_layerMask = StandardMask(); SetSubRatsnest( 0 ); // used in ratsnest calculations m_boundingRadius = -1; }
void D_PAD::ImportSettingsFromMaster( const D_PAD& aMasterPad ) { SetShape( aMasterPad.GetShape() ); SetLayerSet( aMasterPad.GetLayerSet() ); SetAttribute( aMasterPad.GetAttribute() ); // The pad orientation, for historical reasons is the // pad rotation + parent rotation. // So we have to manage this parent rotation double pad_rot = aMasterPad.GetOrientation(); if( aMasterPad.GetParent() ) pad_rot -= aMasterPad.GetParent()->GetOrientation(); if( GetParent() ) pad_rot += GetParent()->GetOrientation(); SetOrientation( pad_rot ); SetSize( aMasterPad.GetSize() ); SetDelta( wxSize( 0, 0 ) ); SetOffset( aMasterPad.GetOffset() ); SetDrillSize( aMasterPad.GetDrillSize() ); SetDrillShape( aMasterPad.GetDrillShape() ); SetRoundRectRadiusRatio( aMasterPad.GetRoundRectRadiusRatio() ); switch( aMasterPad.GetShape() ) { case PAD_SHAPE_TRAPEZOID: SetDelta( aMasterPad.GetDelta() ); break; case PAD_SHAPE_CIRCLE: // ensure size.y == size.x SetSize( wxSize( GetSize().x, GetSize().x ) ); break; default: ; } switch( aMasterPad.GetAttribute() ) { case PAD_ATTRIB_SMD: case PAD_ATTRIB_CONN: // These pads do not have hole (they are expected to be only on one // external copper layer) SetDrillSize( wxSize( 0, 0 ) ); break; default: ; } // Add or remove custom pad shapes: SetPrimitives( aMasterPad.GetPrimitives() ); SetAnchorPadShape( aMasterPad.GetAnchorPadShape() ); MergePrimitivesAsPolygon(); }
D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, PCB_PAD_T ) { 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_Orient = 0; // Pad rotation in 1/10 degrees. m_LengthPadToDie = 0; if( m_Parent && m_Parent->Type() == PCB_MODULE_T ) { m_Pos = GetParent()->GetPosition(); } SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE. SetAnchorPadShape( PAD_SHAPE_CIRCLE ); // Default shape for custom shaped pads // is PAD_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_LocalClearance = 0; m_LocalSolderMaskMargin = 0; m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMarginRatio = 0.0; // Parameters for round rect only: m_padRoundRectRadiusScale = 0.25; // from IPC-7351C standard // Parameters for chamfered rect only: m_padChamferRectScale = 0.2; // Size of chamfer: ratio of smallest of X,Y size m_chamferPositions = RECT_NO_CHAMFER; // No chamfered corner m_ZoneConnection = PAD_ZONE_CONN_INHERITED; // Use parent setting by default m_ThermalWidth = 0; // Use parent setting by default m_ThermalGap = 0; // Use parent setting by default m_customShapeClearanceArea = CUST_PAD_SHAPE_IN_ZONE_OUTLINE; // Set layers mask to default for a standard thru hole pad. m_layerMask = StandardMask(); SetSubRatsnest( 0 ); // used in ratsnest calculations m_boundingRadius = -1; }