KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Static Public Member Functions

static bool IsTermShape (XNODE *aNode)
 

Public Attributes

TERMINAL_SHAPE_TYPE ShapeType
 
long Size = UNDEFINED_VALUE
 
long LeftLength = UNDEFINED_VALUE
 Might also be total length. More...
 
long RightLength = UNDEFINED_VALUE
 Could be blank. More...
 
long InternalFeature = UNDEFINED_VALUE
 
long OrientAngle = 0
 1/1000 of a Degree More...
 

Detailed Description

Definition at line 82 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ IsTermShape()

bool CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::IsTermShape ( XNODE aNode)
static

Definition at line 171 of file cadstar_sch_archive_parser.cpp.

172 {
173  return ParseTermShapeType( aNode->GetName() ) != TERMINAL_SHAPE_TYPE::UNDEFINED;
174 }
Only used for error checking (not a real shape)
static TERMINAL_SHAPE_TYPE ParseTermShapeType(const wxString &aShapeStr)

References CADSTAR_SCH_ARCHIVE_PARSER::ParseTermShapeType(), and CADSTAR_SCH_ARCHIVE_PARSER::UNDEFINED.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Parse().

◆ Parse()

void CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 177 of file cadstar_sch_archive_parser.cpp.

178 {
179  wxCHECK( IsTermShape( aNode ), );
180 
181  ShapeType = ParseTermShapeType( aNode->GetName() );
182  Size = GetXmlAttributeIDLong( aNode, 0 );
183 
184  switch( ShapeType )
185  {
192  break;
193 
197 
203  RightLength = GetXmlAttributeIDLong( aNode, 2, false ); // Optional
204  LeftLength = GetXmlAttributeIDLong( aNode, 1 );
205  break;
206 
211  //don't do anything
212  break;
213 
215  wxASSERT_MSG( false, "Unknown terminal shape type" );
216  break;
217  }
218 
219  if( aNode->GetChildren() )
220  {
221  if( aNode->GetChildren()->GetName() == wxT( "ORIENT" ) )
222  {
224  }
225  else
226  {
227  THROW_UNKNOWN_NODE_IO_ERROR( aNode->GetChildren()->GetName(), aNode->GetName() );
228  }
229 
230  CheckNoNextNodes( aNode->GetChildren() );
231  }
232 }
Only used for error checking (not a real shape)
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
static TERMINAL_SHAPE_TYPE ParseTermShapeType(const wxString &aShapeStr)
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_SCH_ARCHIVE_PARSER::ANNULUS, CADSTAR_SCH_ARCHIVE_PARSER::BOX, CADSTAR_SCH_ARCHIVE_PARSER::BULLET, CADSTAR_ARCHIVE_PARSER::CheckNoNextNodes(), CADSTAR_SCH_ARCHIVE_PARSER::CIRCLE, CADSTAR_SCH_ARCHIVE_PARSER::CROSS, CADSTAR_SCH_ARCHIVE_PARSER::DIAMOND, CADSTAR_SCH_ARCHIVE_PARSER::FINGER, XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), KI_FALLTHROUGH, CADSTAR_SCH_ARCHIVE_PARSER::OCTAGON, CADSTAR_SCH_ARCHIVE_PARSER::ParseTermShapeType(), CADSTAR_SCH_ARCHIVE_PARSER::PLUS, CADSTAR_SCH_ARCHIVE_PARSER::POINTER, CADSTAR_SCH_ARCHIVE_PARSER::RECTANGLE, CADSTAR_SCH_ARCHIVE_PARSER::ROUNDED_RECT, CADSTAR_SCH_ARCHIVE_PARSER::SQUARE, CADSTAR_SCH_ARCHIVE_PARSER::STAR, THROW_UNKNOWN_NODE_IO_ERROR, CADSTAR_SCH_ARCHIVE_PARSER::TRIANGLE, and CADSTAR_SCH_ARCHIVE_PARSER::UNDEFINED.

Member Data Documentation

◆ InternalFeature

long CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::InternalFeature = UNDEFINED_VALUE

Definition at line 91 of file cadstar_sch_archive_parser.h.

◆ LeftLength

long CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::LeftLength = UNDEFINED_VALUE

Might also be total length.

Definition at line 89 of file cadstar_sch_archive_parser.h.

◆ OrientAngle

long CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::OrientAngle = 0

1/1000 of a Degree

Definition at line 92 of file cadstar_sch_archive_parser.h.

◆ RightLength

long CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::RightLength = UNDEFINED_VALUE

Could be blank.

Definition at line 90 of file cadstar_sch_archive_parser.h.

◆ ShapeType

TERMINAL_SHAPE_TYPE CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::ShapeType

Definition at line 84 of file cadstar_sch_archive_parser.h.

◆ Size

long CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::Size = UNDEFINED_VALUE

Definition at line 85 of file cadstar_sch_archive_parser.h.


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