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

635 {
636  wxString aNodeName = aNode->GetName();
637 
638  if( aNodeName == wxT( "ANNULUS" ) || aNodeName == wxT( "BULLET" ) || aNodeName == wxT( "ROUND" )
639  || aNodeName == wxT( "DIAMOND" ) || aNodeName == wxT( "FINGER" )
640  || aNodeName == wxT( "OCTAGON" ) || aNodeName == wxT( "RECTANGLE" )
641  || aNodeName == wxT( "ROUNDED" ) || aNodeName == wxT( "SQUARE" ) )
642  {
643  return true;
644  }
645  else
646  {
647  return false;
648  }
649 }

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

653 {
654  wxASSERT( IsPadShape( aNode ) );
655 
656  wxString aNodeName = aNode->GetName();
657 
658  if( aNodeName == wxT( "ANNULUS" ) )
660  else if( aNodeName == wxT( "BULLET" ) )
662  else if( aNodeName == wxT( "ROUND" ) )
664  else if( aNodeName == wxT( "DIAMOND" ) )
666  else if( aNodeName == wxT( "FINGER" ) )
668  else if( aNodeName == wxT( "OCTAGON" ) )
670  else if( aNodeName == wxT( "RECTANGLE" ) )
672  else if( aNodeName == wxT( "ROUNDED" ) )
674  else if( aNodeName == wxT( "SQUARE" ) )
676  else
677  wxASSERT( true );
678 
679  switch( ShapeType )
680  {
682  Size = GetXmlAttributeIDLong( aNode, 0 );
684  break;
685 
689 
693  RightLength = GetXmlAttributeIDLong( aNode, 2 );
694  LeftLength = GetXmlAttributeIDLong( aNode, 1 );
696 
700 
701  if( aNode->GetChildren() )
702  {
703  if( aNode->GetChildren()->GetName() == wxT( "ORIENT" ) )
704  {
706  }
707  else
708  {
709  THROW_UNKNOWN_NODE_IO_ERROR( aNode->GetChildren()->GetName(), aNode->GetName() );
710  }
711 
712  CheckNoNextNodes( aNode->GetChildren() );
713  }
715 
717  Size = GetXmlAttributeIDLong( aNode, 0 );
718  break;
719  }
720 }
#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: