KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE Struct Reference

Templates are CADSTAR's equivalent to a "filled zone". More...

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE:

Classes

struct  POURING
 

Public Member Functions

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

Public Attributes

TEMPLATE_ID ID
 
LINECODE_ID LineCodeID
 
wxString Name
 
NET_ID NetID
 
LAYER_ID LayerID
 
POURING Pouring
 Copper pour settings (e.g. relief / hatching /etc.) More...
 
SHAPE Shape
 
bool Fixed = false
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this TEMPLATE is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 

Detailed Description

Templates are CADSTAR's equivalent to a "filled zone".

However the difference is that in CADSTAR the template just specifies the rules for "pouring" copper. Then, if the template has indeed been "poured", there will be one or more separate COPPER objects linked to the TEMPLATE via COPPER::PouredTemplateID

Definition at line 1031 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Definition at line 2249 of file cadstar_pcb_archive_parser.cpp.

2250 {
2251  wxASSERT( aNode->GetName() == wxT( "TEMPLATE" ) );
2252 
2253  ID = GetXmlAttributeIDString( aNode, 0 );
2254  LineCodeID = GetXmlAttributeIDString( aNode, 1 );
2255  Name = GetXmlAttributeIDString( aNode, 2 );
2256  NetID = GetXmlAttributeIDString( aNode, 3 );
2257  LayerID = GetXmlAttributeIDString( aNode, 4 );
2258 
2259  XNODE* cNode = aNode->GetChildren();
2260  bool shapeParsed = false;
2261  bool pouringParsed = false;
2262 
2263  for( ; cNode; cNode = cNode->GetNext() )
2264  {
2265  wxString cNodeName = cNode->GetName();
2266 
2267  if( !shapeParsed && SHAPE::IsShape( cNode ) )
2268  {
2269  Shape.Parse( cNode, aContext );
2270  shapeParsed = true;
2271  }
2272  else if( !pouringParsed && cNodeName == wxT( "POURING" ) )
2273  {
2274  Pouring.Parse( cNode, aContext );
2275  pouringParsed = true;
2276  }
2277  else if( cNodeName == wxT( "FIX" ) )
2278  {
2279  Fixed = true;
2280  }
2281  else if( cNodeName == wxT( "GROUPREF" ) )
2282  {
2283  GroupID = GetXmlAttributeIDString( cNode, 0 );
2284  }
2285  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2286  {
2287  ReuseBlockRef.Parse( cNode, aContext );
2288  }
2289  else if( cNodeName == wxT( "ATTR" ) )
2290  {
2291  ATTRIBUTE_VALUE attr;
2292  attr.Parse( cNode, aContext );
2293  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2294  }
2295  else
2296  {
2297  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "TEMPLATE" ) );
2298  }
2299  }
2300 }
POURING Pouring
Copper pour settings (e.g. relief / hatching /etc.)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetChildren() const
Definition: xnode.h:62
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
GROUP_ID GroupID
If not empty, this TEMPLATE is part of a group.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

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

Definition at line 1110 of file cadstar_pcb_archive_parser.h.

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Fixed = false

Definition at line 1106 of file cadstar_pcb_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::GroupID = wxEmptyString

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

Definition at line 1107 of file cadstar_pcb_archive_parser.h.

◆ ID

◆ LayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::LayerID

◆ LineCodeID

LINECODE_ID CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::LineCodeID

Definition at line 1100 of file cadstar_pcb_archive_parser.h.

◆ Name

wxString CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Name

◆ NetID

NET_ID CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::NetID

◆ Pouring

POURING CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Pouring

Copper pour settings (e.g. relief / hatching /etc.)

Definition at line 1104 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates().

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::ReuseBlockRef

Definition at line 1108 of file cadstar_pcb_archive_parser.h.

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Shape

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