KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

TERMINAL_ID ID
 
TERMINALCODE_ID TerminalCodeID
 
POINT Position
 Pad position within the component's coordinate frame. More...
 
long OrientAngle = 0
 

Detailed Description

Definition at line 130 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 328 of file cadstar_sch_archive_parser.cpp.

329 {
330  wxCHECK( aNode->GetName() == wxT( "TERMINAL" ), );
331 
332  ID = GetXmlAttributeIDLong( aNode, 0 );
334 
335  XNODE* cNode = aNode->GetChildren();
336  wxString location = wxString::Format( "TERMINAL %ld", ID );
337 
338  if( !cNode )
339  THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location );
340 
341  for( ; cNode; cNode = cNode->GetNext() )
342  {
343  wxString cNodeName = cNode->GetName();
344 
345  if( cNodeName == wxT( "ORIENT" ) )
346  OrientAngle = GetXmlAttributeIDLong( cNode, 0 );
347  else if( cNodeName == wxT( "PT" ) )
348  Position.Parse( cNode, aContext );
349  else
350  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
351  }
352 }
XNODE * GetChildren() const
Definition: xnode.h:62
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
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
POINT Position
Pad position within the component's coordinate frame.
#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(), THROW_MISSING_NODE_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM::Parse(), and CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::Parse().

Member Data Documentation

◆ ID

◆ OrientAngle

long CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::OrientAngle = 0

◆ Position

POINT CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Position

◆ TerminalCodeID

TERMINALCODE_ID CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::TerminalCodeID

Definition at line 133 of file cadstar_sch_archive_parser.h.


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