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:
CADSTAR_ARCHIVE_PARSER::PARSER

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 1035 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2273 of file cadstar_pcb_archive_parser.cpp.

2274{
2275 wxASSERT( aNode->GetName() == wxT( "TEMPLATE" ) );
2276
2277 ID = GetXmlAttributeIDString( aNode, 0 );
2278 LineCodeID = GetXmlAttributeIDString( aNode, 1 );
2279 Name = GetXmlAttributeIDString( aNode, 2 );
2280 NetID = GetXmlAttributeIDString( aNode, 3 );
2281 LayerID = GetXmlAttributeIDString( aNode, 4 );
2282
2283 XNODE* cNode = aNode->GetChildren();
2284 bool shapeParsed = false;
2285 bool pouringParsed = false;
2286
2287 for( ; cNode; cNode = cNode->GetNext() )
2288 {
2289 wxString cNodeName = cNode->GetName();
2290
2291 if( !shapeParsed && SHAPE::IsShape( cNode ) )
2292 {
2293 Shape.Parse( cNode, aContext );
2294 shapeParsed = true;
2295 }
2296 else if( !pouringParsed && cNodeName == wxT( "POURING" ) )
2297 {
2298 Pouring.Parse( cNode, aContext );
2299 pouringParsed = true;
2300 }
2301 else if( cNodeName == wxT( "FIX" ) )
2302 {
2303 Fixed = true;
2304 }
2305 else if( cNodeName == wxT( "GROUPREF" ) )
2306 {
2307 GroupID = GetXmlAttributeIDString( cNode, 0 );
2308 }
2309 else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2310 {
2311 ReuseBlockRef.Parse( cNode, aContext );
2312 }
2313 else if( cNodeName == wxT( "ATTR" ) )
2314 {
2315 ATTRIBUTE_VALUE attr;
2316 attr.Parse( cNode, aContext );
2317 AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2318 }
2319 else
2320 {
2321 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "TEMPLATE" ) );
2322 }
2323 }
2324}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
POURING Pouring
Copper pour settings (e.g. relief / hatching /etc.)
GROUP_ID GroupID
If not empty, this TEMPLATE is part of a group.

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 1114 of file cadstar_pcb_archive_parser.h.

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Fixed = false

Definition at line 1110 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 1111 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 1104 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 1108 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 1112 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: