KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB Struct Reference

< "CONN" nodename More...

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB:
CADSTAR_ARCHIVE_PARSER::NET::CONNECTION CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 
void ParseIdentifiers (XNODE *aNode, PARSER_CONTEXT *aContext)
 
bool ParseSubNode (XNODE *aChildNode, PARSER_CONTEXT *aContext)
 

Public Attributes

ROUTE Route
 
bool Unrouted = false
 Instead of a ROUTE, the CONNECTION might have an "UNROUTE" token. More...
 
LAYER_ID UnrouteLayerID = wxEmptyString
 See Unrouted member variable. More...
 
TRUNK_ID TrunkID
 TRUNKREF Statements. More...
 
NETELEMENT_ID StartNode
 
NETELEMENT_ID EndNode
 
ROUTECODE_ID RouteCodeID
 
bool Fixed = false
 
bool Hidden = false
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this connection is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 It is possible to add attributes solely to a particular connection. More...
 

Detailed Description

< "CONN" nodename

Definition at line 1006 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2104 of file cadstar_pcb_archive_parser.cpp.

2106{
2107 ParseIdentifiers( aNode, aContext );
2108
2109 //Parse child nodes
2110 XNODE* cNode = aNode->GetChildren();
2111 bool routeParsed = false; //assume only one route per connection
2112
2113 for( ; cNode; cNode = cNode->GetNext() )
2114 {
2115 wxString cNodeName = cNode->GetName();
2116
2117 if( ParseSubNode( cNode, aContext ) )
2118 {
2119 continue;
2120 }
2121 else if( !Unrouted && !routeParsed && cNodeName == wxT( "ROUTE" ) )
2122 {
2123 Route.Parse( cNode, aContext );
2124 routeParsed = true;
2125 }
2126 else if( !routeParsed && cNodeName == wxT( "UNROUTE" ) )
2127 {
2128 Unrouted = true;
2130 }
2131 else if( cNode->GetName() == wxT( "TRUNKREF" ) )
2132 {
2133 TrunkID = GetXmlAttributeIDString( cNode, 0 );
2134 }
2135 else
2136 {
2137 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "CONN" ) );
2138 }
2139 }
2140}
#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 ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
bool Unrouted
Instead of a ROUTE, the CONNECTION might have an "UNROUTE" token.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), and THROW_UNKNOWN_NODE_IO_ERROR.

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

◆ ParseIdentifiers()

void CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::ParseIdentifiers ( XNODE aNode,
PARSER_CONTEXT aContext 
)
inherited

Definition at line 2114 of file cadstar_archive_parser.cpp.

2116{
2117 wxASSERT( aNode->GetName() == wxT( "CONN" ) );
2118
2119 StartNode = GetXmlAttributeIDString( aNode, 0 );
2120 EndNode = GetXmlAttributeIDString( aNode, 1 );
2122}

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

bool CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::ParseSubNode ( XNODE aChildNode,
PARSER_CONTEXT aContext 
)
inherited

Definition at line 2125 of file cadstar_archive_parser.cpp.

2127{
2128 wxString cNodeName = aChildNode->GetName();
2129
2130 if( cNodeName == wxT( "FIX" ) )
2131 {
2132 Fixed = true;
2133 }
2134 else if( cNodeName == wxT( "HIDDEN" ) )
2135 {
2136 Hidden = true;
2137 }
2138 else if( cNodeName == wxT( "GROUPREF" ) )
2139 {
2140 GroupID = GetXmlAttributeIDString( aChildNode, 0 );
2141 }
2142 else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2143 {
2144 ReuseBlockRef.Parse( aChildNode, aContext );
2145 }
2146 else if( cNodeName == wxT( "ATTR" ) )
2147 {
2148 ATTRIBUTE_VALUE attrVal;
2149 attrVal.Parse( aChildNode, aContext );
2150 AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
2151 }
2152 else
2153 {
2154 return false;
2155 }
2156
2157 return true;
2158}
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
It is possible to add attributes solely to a particular connection.
GROUP_ID GroupID
If not empty, this connection is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), and CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse().

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::AttributeValues
inherited

It is possible to add attributes solely to a particular connection.

Definition at line 1194 of file cadstar_archive_parser.h.

◆ EndNode

NETELEMENT_ID CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::EndNode
inherited

Definition at line 1186 of file cadstar_archive_parser.h.

◆ Fixed

bool CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::Fixed = false
inherited

Definition at line 1189 of file cadstar_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::GroupID = wxEmptyString
inherited

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

Definition at line 1191 of file cadstar_archive_parser.h.

◆ Hidden

bool CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::Hidden = false
inherited

Definition at line 1190 of file cadstar_archive_parser.h.

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::ReuseBlockRef
inherited

Definition at line 1192 of file cadstar_archive_parser.h.

◆ Route

ROUTE CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::Route

Definition at line 1008 of file cadstar_pcb_archive_parser.h.

◆ RouteCodeID

ROUTECODE_ID CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::RouteCodeID
inherited

Definition at line 1187 of file cadstar_archive_parser.h.

◆ StartNode

NETELEMENT_ID CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::StartNode
inherited

Definition at line 1185 of file cadstar_archive_parser.h.

◆ TrunkID

TRUNK_ID CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::TrunkID

TRUNKREF Statements.

Definition at line 1015 of file cadstar_pcb_archive_parser.h.

◆ Unrouted

bool CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::Unrouted = false

Instead of a ROUTE, the CONNECTION might have an "UNROUTE" token.

This appears to indicate that the connection is made via a power plane layer as opposed to a route (track in KiCad terms)

Definition at line 1009 of file cadstar_pcb_archive_parser.h.

◆ UnrouteLayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::UnrouteLayerID = wxEmptyString

See Unrouted member variable.

Definition at line 1014 of file cadstar_pcb_archive_parser.h.


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