KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::PADCODE Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::PADCODE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

PADCODE_ID ID
 
wxString Name
 
CADSTAR_PAD_SHAPE Shape
 
long ReliefClearance = UNDEFINED_VALUE
 if undefined inherits from design More...
 
long ReliefWidth = UNDEFINED_VALUE
 if undefined inherits from design More...
 
bool Plated = true
 
long DrillDiameter = UNDEFINED_VALUE
 
long DrillOversize = UNDEFINED_VALUE
 
long SlotLength = UNDEFINED_VALUE
 
long SlotOrientation = 0
 
long DrillXoffset = 0
 
long DrillYoffset = 0
 
std::map< LAYER_ID, CADSTAR_PAD_SHAPEReassigns
 

Detailed Description

Definition at line 296 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 761 of file cadstar_pcb_archive_parser.cpp.

762 {
763  wxASSERT( aNode->GetName() == wxT( "PADCODE" ) );
764 
765  ID = GetXmlAttributeIDString( aNode, 0 );
766  Name = GetXmlAttributeIDString( aNode, 1 );
767 
768  XNODE* cNode = aNode->GetChildren();
769  wxString location = wxString::Format( wxT( "PADCODE -> %s" ), Name );
770 
771  for( ; cNode; cNode = cNode->GetNext() )
772  {
773  wxString cNodeName = cNode->GetName();
774 
775  if( CADSTAR_PAD_SHAPE::IsPadShape( cNode ) )
776  {
777  Shape.Parse( cNode, aContext );
778  }
779  else if( cNodeName == wxT( "CLEARANCE" ) )
780  {
782  }
783  else if( cNodeName == wxT( "RELIEFWIDTH" ) )
784  {
785  ReliefWidth = GetXmlAttributeIDLong( cNode, 0 );
786  }
787  else if( cNodeName == wxT( "DRILL" ) )
788  {
789  DrillDiameter = GetXmlAttributeIDLong( cNode, 0 );
790  XNODE* subNode = cNode->GetChildren();
791 
792  for( ; subNode; subNode = subNode->GetNext() )
793  {
794  wxString subNodeName = subNode->GetName();
795 
796  if( subNodeName == wxT( "NONPLATED" ) )
797  Plated = false;
798  else if( subNodeName == wxT( "OVERSIZE" ) )
799  DrillOversize = GetXmlAttributeIDLong( subNode, 0 );
800  else
801  THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), location );
802  }
803  }
804  else if( cNodeName == wxT( "DRILLLENGTH" ) )
805  {
806  SlotLength = GetXmlAttributeIDLong( cNode, 0 );
807  }
808  else if( cNodeName == wxT( "DRILLORIENTATION" ) )
809  {
811  }
812  else if( cNodeName == wxT( "DRILLXOFFSET" ) )
813  {
814  DrillXoffset = GetXmlAttributeIDLong( cNode, 0 );
815  }
816  else if( cNodeName == wxT( "DRILLYOFFSET" ) )
817  {
818  DrillYoffset = GetXmlAttributeIDLong( cNode, 0 );
819  }
820  else if( cNodeName == wxT( "PADREASSIGN" ) )
821  {
822  PADREASSIGN reassign;
823  reassign.Parse( cNode, aContext );
824  Reassigns.insert( std::make_pair( reassign.LayerID, reassign.Shape ) );
825  }
826  else
827  {
828  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
829  }
830  }
831 }
long ReliefWidth
if undefined inherits from design
std::map< LAYER_ID, CADSTAR_PAD_SHAPE > Reassigns
XNODE * GetChildren() const
Definition: xnode.h:62
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Hold an XML or S-expression element.
Definition: xnode.h:43
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
XNODE * GetNext() const
Definition: xnode.h:67
long ReliefClearance
if undefined inherits from design
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::IsPadShape(), CADSTAR_PCB_ARCHIVE_PARSER::PADREASSIGN::LayerID, CADSTAR_PCB_ARCHIVE_PARSER::PADREASSIGN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADREASSIGN::Shape, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::Parse().

Member Data Documentation

◆ DrillDiameter

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::DrillDiameter = UNDEFINED_VALUE

◆ DrillOversize

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::DrillOversize = UNDEFINED_VALUE

Definition at line 305 of file cadstar_pcb_archive_parser.h.

◆ DrillXoffset

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::DrillXoffset = 0

◆ DrillYoffset

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::DrillYoffset = 0

◆ ID

PADCODE_ID CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::ID

◆ Name

wxString CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Name

◆ Plated

bool CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Plated = true

◆ Reassigns

std::map<LAYER_ID, CADSTAR_PAD_SHAPE> CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Reassigns

◆ ReliefClearance

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::ReliefClearance = UNDEFINED_VALUE

if undefined inherits from design

Definition at line 301 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad().

◆ ReliefWidth

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::ReliefWidth = UNDEFINED_VALUE

if undefined inherits from design

Definition at line 302 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad().

◆ Shape

CADSTAR_PAD_SHAPE CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Shape

◆ SlotLength

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::SlotLength = UNDEFINED_VALUE

◆ SlotOrientation

long CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::SlotOrientation = 0

The documentation for this struct was generated from the following files: