KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::COPPER Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::COPPER:
CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  NETREF
 

Public Member Functions

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

Public Attributes

COPPER_ID ID
 
COPPERCODE_ID CopperCodeID
 
LAYER_ID LayerID
 
NETREF NetRef
 
SHAPE Shape
 
TEMPLATE_ID PouredTemplateID = wxEmptyString
 If not empty, it means this COPPER is part of a poured template. More...
 
bool Fixed = false
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this COPPER is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
 

Detailed Description

Definition at line 1116 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2364 of file cadstar_pcb_archive_parser.cpp.

2365 {
2366  wxASSERT( aNode->GetName() == wxT( "COPPER" ) );
2367 
2368  ID = GetXmlAttributeIDString( aNode, 0 );
2369  CopperCodeID = GetXmlAttributeIDString( aNode, 1 );
2370  LayerID = GetXmlAttributeIDString( aNode, 2 );
2371 
2372  XNODE* cNode = aNode->GetChildren();
2373  bool shapeParsed = false;
2374  bool netRefParsed = false;
2375 
2376  for( ; cNode; cNode = cNode->GetNext() )
2377  {
2378  wxString cNodeName = cNode->GetName();
2379 
2380  if( !shapeParsed && SHAPE::IsShape( cNode ) )
2381  {
2382  Shape.Parse( cNode, aContext );
2383  shapeParsed = true;
2384  }
2385  else if( !netRefParsed && cNodeName == wxT( "NETREF" ) )
2386  {
2387  NetRef.Parse( cNode, aContext );
2388  netRefParsed = true;
2389  }
2390  else if( cNodeName == wxT( "FIX" ) )
2391  {
2392  Fixed = true;
2393  }
2394  else if( cNodeName == wxT( "GROUPREF" ) )
2395  {
2396  GroupID = GetXmlAttributeIDString( cNode, 0 );
2397  }
2398  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2399  {
2400  ReuseBlockRef.Parse( cNode, aContext );
2401  }
2402  else if( cNodeName == wxT( "POURED" ) )
2403  {
2405  }
2406  else if( cNodeName == wxT( "ATTR" ) )
2407  {
2408  ATTRIBUTE_VALUE attr;
2409  attr.Parse( cNode, aContext );
2410  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2411  }
2412  else
2413  {
2414  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "TEMPLATE" ) );
2415  }
2416  }
2417 }
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this COPPER is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetChildren() const
Definition: xnode.h:62
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
TEMPLATE_ID PouredTemplateID
If not empty, it means this COPPER is part of a poured template.
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape(), 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::COPPER::AttributeValues

Definition at line 1147 of file cadstar_pcb_archive_parser.h.

◆ CopperCodeID

COPPERCODE_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::CopperCodeID

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Fixed = false

Definition at line 1143 of file cadstar_pcb_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::GroupID = wxEmptyString

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

Definition at line 1144 of file cadstar_pcb_archive_parser.h.

◆ ID

COPPER_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::ID

◆ LayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::LayerID

◆ NetRef

NETREF CADSTAR_PCB_ARCHIVE_PARSER::COPPER::NetRef

◆ PouredTemplateID

TEMPLATE_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::PouredTemplateID = wxEmptyString

If not empty, it means this COPPER is part of a poured template.

Definition at line 1141 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers().

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_PCB_ARCHIVE_PARSER::COPPER::ReuseBlockRef

Definition at line 1145 of file cadstar_pcb_archive_parser.h.

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Shape

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