52 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
58 const wxString& aActualConversion )
63 wxString propValue, str, emsg;
67 lNode =
FindNode( aNode, wxT(
"padNum" ) );
71 lNode->GetNodeContent().ToLong( &num );
75 lNode =
FindNode( aNode, wxT(
"padStyleRef" ) );
79 lNode->GetAttribute( wxT(
"Name" ), &propValue );
80 propValue.Trim(
false );
84 lNode =
FindNode( aNode, wxT(
"pt" ) );
92 lNode =
FindNode( aNode, wxT(
"rotation" ) );
96 str = lNode->GetNodeContent();
101 lNode =
FindNode( aNode, wxT(
"netNameRef" ) );
105 lNode->GetAttribute( wxT(
"Name" ), &propValue );
106 propValue.Trim(
false );
107 propValue.Trim(
true );
112 lNode =
FindNode( aNode, wxT(
"defaultPinDes" ) );
116 lNode->GetAttribute( wxT(
"Name" ), &propValue );
124 while( lNode && lNode->GetName() != wxT(
"www.lura.sk" ) )
127 lNode =
FindNode( lNode, wxT(
"library" ) );
132 lNode =
FindNode( lNode, wxT(
"padStyleDef" ) );
136 lNode->GetAttribute( wxT(
"Name" ), &propValue );
138 if( propValue.IsSameAs(
m_Name.text,
false) )
147 cNode =
FindNode( lNode, wxT(
"holeDiam" ) );
150 SetWidth( cNode->GetNodeContent(), aDefaultUnits, &
m_Hole, aActualConversion );
152 if(
FindNodeGetContent( lNode, wxT(
"isHolePlated" ) ).IsSameAs( wxT(
"False" ),
false ) )
155 cNode =
FindNode( lNode, wxT(
"padShape" ) );
159 if( cNode->GetName().IsSameAs( wxT(
"padShape" ),
false ) )
163 if(
FindNode( cNode, wxT(
"layerNumRef" ) ) )
166 padShape->
Parse( cNode, aDefaultUnits, aActualConversion );
185 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
191 bool aEncapsulatedPad )
194 wxString padShapeName = wxT(
"Ellipse" );
214 if(
m_Shapes.GetCount() &&
m_Shapes[0]->m_Shape.IsSameAs( wxT(
"MtHole" ),
false ) )
217 pad->SetLocalSolderMaskMargin( sm_margin );
218 pad->SetLocalClearance( sm_margin +
pcbIUScale.mmToIU( 0.254 ) );
228 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
237 padShapeName = padShape->
m_Shape;
252 if( width == 0 || height == 0 )
264 if( padShapeName.IsSameAs( wxT(
"Oval" ),
false )
265 || padShapeName.IsSameAs( wxT(
"Ellipse" ),
false )
266 || padShapeName.IsSameAs( wxT(
"MtHole" ),
false ) )
268 if( width != height )
273 else if( padShapeName.IsSameAs( wxT(
"Rect" ),
false ) )
277 else if( padShapeName.IsSameAs( wxT(
"RndRect" ),
false ) )
281 else if( padShapeName.IsSameAs( wxT(
"Polygon" ),
false ) )
294 pad->SetAttribute( padType );
299 if( netinfo ==
nullptr )
309 if( !aEncapsulatedPad )
330 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
347 if( width == 0 || height == 0 )
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit board.
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
virtual void Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion)
void AddToFootprint(FOOTPRINT *aFootprint, const EDA_ANGLE &aRotation, bool aEncapsulatedPad)
PCAD_PAD_SHAPES_ARRAY m_Shapes
PCAD_PAD(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
void AddToBoard(FOOTPRINT *aFootprint=nullptr) override
virtual void Flip() override
virtual void Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion)
PCAD_CALLBACKS * m_callbacks
int GetNetCode(const wxString &aNetName) const
PCAD_PCB_COMPONENT(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
PCB_LAYER_ID m_KiCadLayer
An extension of wxXmlNode that can format its contents as KiCad-style s-expressions.
XNODE * GetParent() const
static constexpr EDA_ANGLE ANGLE_0
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
int StrToInt1Units(const wxString &aStr)
void SetWidth(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aWidth, const wxString &aActualConversion)
XNODE * FindNode(XNODE *aChild, const wxString &aTag)
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
wxString FindNodeGetContent(XNODE *aChild, const wxString &aTag)
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I