KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Static Public Member Functions

static bool IsPadShape (XNODE *aNode)
 

Public Attributes

PAD_SHAPE_TYPE ShapeType
 
long Size = UNDEFINED_VALUE
 
long LeftLength = UNDEFINED_VALUE
 
long RightLength = UNDEFINED_VALUE
 
long InternalFeature = UNDEFINED_VALUE
 
long OrientAngle = 0
 1/1000 of a Degree More...
 

Detailed Description

Definition at line 273 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ IsPadShape()

bool CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::IsPadShape ( XNODE aNode)
static

Definition at line 657 of file cadstar_pcb_archive_parser.cpp.

658 {
659  wxString aNodeName = aNode->GetName();
660 
661  if( aNodeName == wxT( "ANNULUS" ) || aNodeName == wxT( "BULLET" ) || aNodeName == wxT( "ROUND" )
662  || aNodeName == wxT( "DIAMOND" ) || aNodeName == wxT( "FINGER" )
663  || aNodeName == wxT( "OCTAGON" ) || aNodeName == wxT( "RECTANGLE" )
664  || aNodeName == wxT( "ROUNDED" ) || aNodeName == wxT( "SQUARE" ) )
665  {
666  return true;
667  }
668  else
669  {
670  return false;
671  }
672 }

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::PADREASSIGN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIAREASSIGN::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::Parse().

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 675 of file cadstar_pcb_archive_parser.cpp.

676 {
677  wxASSERT( IsPadShape( aNode ) );
678 
679  wxString aNodeName = aNode->GetName();
680 
681  if( aNodeName == wxT( "ANNULUS" ) )
683  else if( aNodeName == wxT( "BULLET" ) )
685  else if( aNodeName == wxT( "ROUND" ) )
687  else if( aNodeName == wxT( "DIAMOND" ) )
689  else if( aNodeName == wxT( "FINGER" ) )
691  else if( aNodeName == wxT( "OCTAGON" ) )
693  else if( aNodeName == wxT( "RECTANGLE" ) )
695  else if( aNodeName == wxT( "ROUNDED" ) )
697  else if( aNodeName == wxT( "SQUARE" ) )
699  else
700  wxASSERT( true );
701 
702  switch( ShapeType )
703  {
705  Size = GetXmlAttributeIDLong( aNode, 0 );
707  break;
708 
712 
716  RightLength = GetXmlAttributeIDLong( aNode, 2 );
717  LeftLength = GetXmlAttributeIDLong( aNode, 1 );
719 
723 
724  if( aNode->GetChildren() )
725  {
726  if( aNode->GetChildren()->GetName() == wxT( "ORIENT" ) )
727  {
729  }
730  else
731  {
732  THROW_UNKNOWN_NODE_IO_ERROR( aNode->GetChildren()->GetName(), aNode->GetName() );
733  }
734 
735  CheckNoNextNodes( aNode->GetChildren() );
736  }
738 
740  Size = GetXmlAttributeIDLong( aNode, 0 );
741  break;
742  }
743 }
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
XNODE * GetChildren() const
Definition: xnode.h:62
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static void CheckNoNextNodes(XNODE *aNode)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)

References CADSTAR_PCB_ARCHIVE_PARSER::ANNULUS, CADSTAR_PCB_ARCHIVE_PARSER::BULLET, CADSTAR_ARCHIVE_PARSER::CheckNoNextNodes(), CADSTAR_PCB_ARCHIVE_PARSER::CIRCLE, CADSTAR_PCB_ARCHIVE_PARSER::DIAMOND, CADSTAR_PCB_ARCHIVE_PARSER::FINGER, XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), KI_FALLTHROUGH, CADSTAR_PCB_ARCHIVE_PARSER::OCTAGON, CADSTAR_PCB_ARCHIVE_PARSER::RECTANGLE, CADSTAR_PCB_ARCHIVE_PARSER::ROUNDED_RECT, CADSTAR_PCB_ARCHIVE_PARSER::SQUARE, and THROW_UNKNOWN_NODE_IO_ERROR.

Member Data Documentation

◆ InternalFeature

long CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::InternalFeature = UNDEFINED_VALUE

◆ LeftLength

long CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::LeftLength = UNDEFINED_VALUE

◆ OrientAngle

long CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::OrientAngle = 0

1/1000 of a Degree

Definition at line 280 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad().

◆ RightLength

long CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::RightLength = UNDEFINED_VALUE

◆ ShapeType

PAD_SHAPE_TYPE CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::ShapeType

◆ Size


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