KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA Struct Reference

From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are carried out (e.g. More...

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

COMP_AREA_ID ID
 
LINECODE_ID LineCodeID
 
LAYER_ID LayerID
 
SHAPE Shape
 
SWAP_RULE SwapRule = SWAP_RULE::BOTH
 
bool NoTracks = false
 From CADSTAR Help: "Check this button to specify that any area created by the Rectangle, Circle and Polygon icons can be used by the Auto Router and Route Editor options as the area within which no routes are placed during automatic routing. More...
 
bool NoVias = false
 From CADSTAR Help: "Check this button to specify that any area created by the Rectangle, Circle and Polygon icons can be used by the Auto Router and Route Editor options as the area within which no vias are placed during automatic routing. More...
 

Detailed Description

From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are carried out (e.g.

Placement.); and for creating 'keep out' areas, within which no operations are carried out and where no items are placed by operations such as Placement and Routing."

Definition at line 455 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1072 of file cadstar_pcb_archive_parser.cpp.

1073{
1074 wxASSERT( aNode->GetName() == wxT( "COMPAREA" ) );
1075
1076 ID = GetXmlAttributeIDString( aNode, 0 );
1077 LineCodeID = GetXmlAttributeIDString( aNode, 1 );
1078 LayerID = GetXmlAttributeIDString( aNode, 3 );
1079
1080 XNODE* cNode = aNode->GetChildren();
1081 bool shapeIsInitialised = false; // Stop more than one Shape Object
1082 wxString location = wxString::Format( wxT( "COMPAREA %s" ), ID );
1083
1084 if( !cNode )
1085 THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );
1086
1087 for( ; cNode; cNode = cNode->GetNext() )
1088 {
1089 wxString cNodeName = cNode->GetName();
1090
1091 if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1092 {
1093 Shape.Parse( cNode, aContext );
1094 shapeIsInitialised = true;
1095 }
1096 else if( cNodeName == wxT( "SWAPRULE" ) )
1097 {
1098 SwapRule = ParseSwapRule( cNode );
1099 }
1100 else if( cNodeName == wxT( "USAGE" ) )
1101 {
1102 wxXmlAttribute* xmlAttribute = cNode->GetAttributes();
1103
1104 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1105 {
1106 if( !IsValidAttribute( xmlAttribute ) )
1107 continue;
1108
1109 if( xmlAttribute->GetValue() == wxT( "NO_TRACKS" ) )
1110 NoTracks = true;
1111 else if( xmlAttribute->GetValue() == wxT( "NO_VIAS" ) )
1112 NoVias = true;
1113 else
1114 THROW_UNKNOWN_PARAMETER_IO_ERROR( xmlAttribute->GetValue(), location );
1115 }
1116
1117 CheckNoChildNodes( cNode );
1118 }
1119 else
1120 {
1121 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1122 }
1123 }
1124}
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
static SWAP_RULE ParseSwapRule(XNODE *aNode)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static bool IsValidAttribute(wxXmlAttribute *aAttribute)
static void CheckNoChildNodes(XNODE *aNode)
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 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
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool NoVias
From CADSTAR Help: "Check this button to specify that any area created by the Rectangle,...
bool NoTracks
From CADSTAR Help: "Check this button to specify that any area created by the Rectangle,...

References CADSTAR_ARCHIVE_PARSER::CheckNoChildNodes(), Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape(), CADSTAR_ARCHIVE_PARSER::IsValidAttribute(), CADSTAR_ARCHIVE_PARSER::ParseSwapRule(), THROW_MISSING_NODE_IO_ERROR, THROW_UNKNOWN_NODE_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

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

Member Data Documentation

◆ ID

COMP_AREA_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::ID

◆ LayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::LayerID

◆ LineCodeID

LINECODE_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::LineCodeID

Definition at line 458 of file cadstar_pcb_archive_parser.h.

◆ NoTracks

bool CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::NoTracks = false

From CADSTAR Help: "Check this button to specify that any area created by the Rectangle, Circle and Polygon icons can be used by the Auto Router and Route Editor options as the area within which no routes are placed during automatic routing.

"

Definition at line 463 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas().

◆ NoVias

bool CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::NoVias = false

From CADSTAR Help: "Check this button to specify that any area created by the Rectangle, Circle and Polygon icons can be used by the Auto Router and Route Editor options as the area within which no vias are placed during automatic routing.

"

Definition at line 467 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas().

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Shape

◆ SwapRule

SWAP_RULE CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::SwapRule = SWAP_RULE::BOTH

Definition at line 461 of file cadstar_pcb_archive_parser.h.


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