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 738 of file cadstar_pcb_archive_parser.cpp.

739 {
740  wxASSERT( aNode->GetName() == wxT( "PADCODE" ) );
741 
742  ID = GetXmlAttributeIDString( aNode, 0 );
743  Name = GetXmlAttributeIDString( aNode, 1 );
744 
745  XNODE* cNode = aNode->GetChildren();
746  wxString location = wxString::Format( "PADCODE -> %s", Name );
747 
748  for( ; cNode; cNode = cNode->GetNext() )
749  {
750  wxString cNodeName = cNode->GetName();
751 
752  if( CADSTAR_PAD_SHAPE::IsPadShape( cNode ) )
753  {
754  Shape.Parse( cNode, aContext );
755  }
756  else if( cNodeName == wxT( "CLEARANCE" ) )
757  {
759  }
760  else if( cNodeName == wxT( "RELIEFWIDTH" ) )
761  {
762  ReliefWidth = GetXmlAttributeIDLong( cNode, 0 );
763  }
764  else if( cNodeName == wxT( "DRILL" ) )
765  {
766  DrillDiameter = GetXmlAttributeIDLong( cNode, 0 );
767  XNODE* subNode = cNode->GetChildren();
768 
769  for( ; subNode; subNode = subNode->GetNext() )
770  {
771  wxString subNodeName = subNode->GetName();
772 
773  if( subNodeName == wxT( "NONPLATED" ) )
774  Plated = false;
775  else if( subNodeName == wxT( "OVERSIZE" ) )
776  DrillOversize = GetXmlAttributeIDLong( subNode, 0 );
777  else
778  THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), location );
779  }
780  }
781  else if( cNodeName == wxT( "DRILLLENGTH" ) )
782  {
783  SlotLength = GetXmlAttributeIDLong( cNode, 0 );
784  }
785  else if( cNodeName == wxT( "DRILLORIENTATION" ) )
786  {
788  }
789  else if( cNodeName == wxT( "DRILLXOFFSET" ) )
790  {
791  DrillXoffset = GetXmlAttributeIDLong( cNode, 0 );
792  }
793  else if( cNodeName == wxT( "DRILLYOFFSET" ) )
794  {
795  DrillYoffset = GetXmlAttributeIDLong( cNode, 0 );
796  }
797  else if( cNodeName == wxT( "PADREASSIGN" ) )
798  {
799  PADREASSIGN reassign;
800  reassign.Parse( cNode, aContext );
801  Reassigns.insert( std::make_pair( reassign.LayerID, reassign.Shape ) );
802  }
803  else
804  {
805  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
806  }
807  }
808 }
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: