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 1002 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 2080 of file cadstar_pcb_archive_parser.cpp.

2082 {
2083  ParseIdentifiers( aNode, aContext );
2084 
2085  //Parse child nodes
2086  XNODE* cNode = aNode->GetChildren();
2087  bool routeParsed = false; //assume only one route per connection
2088 
2089  for( ; cNode; cNode = cNode->GetNext() )
2090  {
2091  wxString cNodeName = cNode->GetName();
2092 
2093  if( ParseSubNode( cNode, aContext ) )
2094  {
2095  continue;
2096  }
2097  else if( !Unrouted && !routeParsed && cNodeName == wxT( "ROUTE" ) )
2098  {
2099  Route.Parse( cNode, aContext );
2100  routeParsed = true;
2101  }
2102  else if( !routeParsed && cNodeName == wxT( "UNROUTE" ) )
2103  {
2104  Unrouted = true;
2106  }
2107  else if( cNode->GetName() == wxT( "TRUNKREF" ) )
2108  {
2109  TrunkID = GetXmlAttributeIDString( cNode, 0 );
2110  }
2111  else
2112  {
2113  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "CONN" ) );
2114  }
2115  }
2116 }
bool Unrouted
Instead of a ROUTE, the CONNECTION might have an "UNROUTE" token.
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
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
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
#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(), 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 2018 of file cadstar_archive_parser.cpp.

2020 {
2021  wxASSERT( aNode->GetName() == wxT( "CONN" ) );
2022 
2023  StartNode = GetXmlAttributeIDString( aNode, 0 );
2024  EndNode = GetXmlAttributeIDString( aNode, 1 );
2025  RouteCodeID = GetXmlAttributeIDString( aNode, 2 );
2026 }
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

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

Definition at line 2029 of file cadstar_archive_parser.cpp.

2031 {
2032  wxString cNodeName = aChildNode->GetName();
2033 
2034  if( cNodeName == wxT( "FIX" ) )
2035  {
2036  Fixed = true;
2037  }
2038  else if( cNodeName == wxT( "HIDDEN" ) )
2039  {
2040  Hidden = true;
2041  }
2042  else if( cNodeName == wxT( "GROUPREF" ) )
2043  {
2044  GroupID = GetXmlAttributeIDString( aChildNode, 0 );
2045  }
2046  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2047  {
2048  ReuseBlockRef.Parse( aChildNode, aContext );
2049  }
2050  else if( cNodeName == wxT( "ATTR" ) )
2051  {
2052  ATTRIBUTE_VALUE attrVal;
2053  attrVal.Parse( aChildNode, aContext );
2054  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
2055  }
2056  else
2057  {
2058  return false;
2059  }
2060 
2061  return true;
2062 }
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this connection is part of a group.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
It is possible to add attributes solely to a particular connection.

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 1169 of file cadstar_archive_parser.h.

◆ EndNode

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

Definition at line 1161 of file cadstar_archive_parser.h.

◆ Fixed

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

Definition at line 1164 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 1166 of file cadstar_archive_parser.h.

◆ Hidden

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

Definition at line 1165 of file cadstar_archive_parser.h.

◆ ReuseBlockRef

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

Definition at line 1167 of file cadstar_archive_parser.h.

◆ Route

ROUTE CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::Route

Definition at line 1004 of file cadstar_pcb_archive_parser.h.

◆ RouteCodeID

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

Definition at line 1162 of file cadstar_archive_parser.h.

◆ StartNode

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

Definition at line 1160 of file cadstar_archive_parser.h.

◆ TrunkID

TRUNK_ID CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::TrunkID

TRUNKREF Statements.

Definition at line 1011 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 1005 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 1010 of file cadstar_pcb_archive_parser.h.


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