KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD:

Public Member Functions

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

Public Attributes

BOARD_ID ID
 
LINECODE_ID LineCodeID
 
SHAPE Shape
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 
bool Fixed = false
 If not empty, this CADSTAR_BOARD is part of a group. More...
 
GROUP_ID GroupID = wxEmptyString
 Normally CADSTAR_BOARD cannot be part of a reuseblock, but included for completeness. More...
 
REUSEBLOCKREF ReuseBlockRef
 

Detailed Description

Definition at line 796 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
override

Definition at line 1630 of file cadstar_pcb_archive_parser.cpp.

1631 {
1632  wxASSERT( aNode->GetName() == wxT( "BOARD" ) );
1633 
1634  ID = GetXmlAttributeIDString( aNode, 0 );
1635  LineCodeID = GetXmlAttributeIDString( aNode, 1 );
1636 
1637  XNODE* cNode = aNode->GetChildren();
1638  bool shapeIsInitialised = false; // Stop more than one Shape Object
1639  wxString location = wxString::Format( wxT( "BOARD %s" ), ID );
1640 
1641  if( !cNode )
1642  THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );
1643 
1644  for( ; cNode; cNode = cNode->GetNext() )
1645  {
1646  wxString cNodeName = cNode->GetName();
1647 
1648  if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1649  {
1650  Shape.Parse( cNode, aContext );
1651  shapeIsInitialised = true;
1652  }
1653  else if( cNodeName == wxT( "ATTR" ) )
1654  {
1655  ATTRIBUTE_VALUE attr;
1656  attr.Parse( cNode, aContext );
1657  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
1658  }
1659  else if( cNodeName == wxT( "FIX" ) )
1660  {
1661  Fixed = true;
1662  }
1663  else if( cNodeName == wxT( "GROUPREF" ) )
1664  {
1665  GroupID = GetXmlAttributeIDString( cNode, 0 );
1666  }
1667  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
1668  {
1669  ReuseBlockRef.Parse( cNode, aContext );
1670  }
1671  else
1672  {
1673  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1674  }
1675  }
1676 }
bool Fixed
If not empty, this CADSTAR_BOARD is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetChildren() const
Definition: xnode.h:62
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
GROUP_ID GroupID
Normally CADSTAR_BOARD cannot be part of a reuseblock, but included for completeness.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
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
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), THROW_MISSING_NODE_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Parse().

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::AttributeValues

Definition at line 801 of file cadstar_pcb_archive_parser.h.

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Fixed = false

If not empty, this CADSTAR_BOARD is part of a group.

Definition at line 802 of file cadstar_pcb_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::GroupID = wxEmptyString

Normally CADSTAR_BOARD cannot be part of a reuseblock, but included for completeness.

Definition at line 805 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadBoards().

◆ ID

BOARD_ID CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::ID

◆ LineCodeID

LINECODE_ID CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::LineCodeID

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::ReuseBlockRef

Definition at line 808 of file cadstar_pcb_archive_parser.h.

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Shape

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