56 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
62 const wxString& aActualConversion )
67 wxString propValue, str, emsg;
71 lNode =
FindNode( aNode, wxT(
"padNum" ) );
75 lNode->GetNodeContent().ToLong( &num );
79 lNode =
FindNode( aNode, wxT(
"padStyleRef" ) );
83 lNode->GetAttribute( wxT(
"Name" ), &propValue );
84 propValue.Trim(
false );
88 lNode =
FindNode( aNode, wxT(
"pt" ) );
96 lNode =
FindNode( aNode, wxT(
"rotation" ) );
100 str = lNode->GetNodeContent();
105 lNode =
FindNode( aNode, wxT(
"netNameRef" ) );
109 lNode->GetAttribute( wxT(
"Name" ), &propValue );
110 propValue.Trim(
false );
111 propValue.Trim(
true );
116 lNode =
FindNode( aNode, wxT(
"defaultPinDes" ) );
120 lNode->GetAttribute( wxT(
"Name" ), &propValue );
128 while( lNode && lNode->GetName() != wxT(
"www.lura.sk" ) )
131 lNode =
FindNode( lNode, wxT(
"library" ) );
136 lNode =
FindNode( lNode, wxT(
"padStyleDef" ) );
140 lNode->GetAttribute( wxT(
"Name" ), &propValue );
142 if( propValue.IsSameAs(
m_Name.text,
false) )
151 cNode =
FindNode( lNode, wxT(
"holeDiam" ) );
154 SetWidth( cNode->GetNodeContent(), aDefaultUnits, &
m_Hole, aActualConversion );
156 if(
FindNodeGetContent( lNode, wxT(
"isHolePlated" ) ).IsSameAs( wxT(
"False" ),
false ) )
159 cNode =
FindNode( lNode, wxT(
"padShape" ) );
163 if( cNode->GetName().IsSameAs( wxT(
"padShape" ),
false ) )
167 if(
FindNode( cNode, wxT(
"layerNumRef" ) ) )
170 padShape->
Parse( cNode, aDefaultUnits, aActualConversion );
189 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
195 bool aEncapsulatedPad )
198 wxString padShapeName = wxT(
"Ellipse" );
218 if(
m_Shapes.GetCount() &&
m_Shapes[0]->m_Shape.IsSameAs( wxT(
"MtHole" ),
false ) )
221 pad->SetLocalSolderMaskMargin( sm_margin );
222 pad->SetLocalClearance( sm_margin +
pcbIUScale.mmToIU( 0.254 ) );
232 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
241 padShapeName = padShape->
m_Shape;
256 if( width == 0 || height == 0 )
268 if( padShapeName.IsSameAs( wxT(
"Oval" ),
false )
269 || padShapeName.IsSameAs( wxT(
"Ellipse" ),
false )
270 || padShapeName.IsSameAs( wxT(
"MtHole" ),
false ) )
272 if( width != height )
277 else if( padShapeName.IsSameAs( wxT(
"Rect" ),
false ) )
281 else if( padShapeName.IsSameAs( wxT(
"RndRect" ),
false ) )
285 else if( padShapeName.IsSameAs( wxT(
"Polygon" ),
false ) )
298 pad->SetAttribute( padType );
303 if( netinfo ==
nullptr )
313 if( !aEncapsulatedPad )
334 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
351 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
Hold an XML or S-expression element.
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