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

2332 {
2333  wxASSERT( aNode->GetName() == wxT( "COPPER" ) );
2334 
2335  ID = GetXmlAttributeIDString( aNode, 0 );
2336  CopperCodeID = GetXmlAttributeIDString( aNode, 1 );
2337  LayerID = GetXmlAttributeIDString( aNode, 2 );
2338 
2339  XNODE* cNode = aNode->GetChildren();
2340  bool shapeParsed = false;
2341  bool netRefParsed = false;
2342 
2343  for( ; cNode; cNode = cNode->GetNext() )
2344  {
2345  wxString cNodeName = cNode->GetName();
2346 
2347  if( !shapeParsed && SHAPE::IsShape( cNode ) )
2348  {
2349  Shape.Parse( cNode, aContext );
2350  shapeParsed = true;
2351  }
2352  else if( !netRefParsed && cNodeName == wxT( "NETREF" ) )
2353  {
2354  NetRef.Parse( cNode, aContext );
2355  netRefParsed = true;
2356  }
2357  else if( cNodeName == wxT( "FIX" ) )
2358  {
2359  Fixed = true;
2360  }
2361  else if( cNodeName == wxT( "GROUPREF" ) )
2362  {
2363  GroupID = GetXmlAttributeIDString( cNode, 0 );
2364  }
2365  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2366  {
2367  ReuseBlockRef.Parse( cNode, aContext );
2368  }
2369  else if( cNodeName == wxT( "POURED" ) )
2370  {
2372  }
2373  else if( cNodeName == wxT( "ATTR" ) )
2374  {
2375  ATTRIBUTE_VALUE attr;
2376  attr.Parse( cNode, aContext );
2377  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2378  }
2379  else
2380  {
2381  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "TEMPLATE" ) );
2382  }
2383  }
2384 }
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 1143 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 1139 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 1140 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 1137 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 1141 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: