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 999 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 2049 of file cadstar_pcb_archive_parser.cpp.

2050 {
2051  ParseIdentifiers( aNode, aContext );
2052 
2053  //Parse child nodes
2054  XNODE* cNode = aNode->GetChildren();
2055  bool routeParsed = false; //assume only one route per connection
2056 
2057  for( ; cNode; cNode = cNode->GetNext() )
2058  {
2059  wxString cNodeName = cNode->GetName();
2060 
2061  if( ParseSubNode( cNode, aContext ) )
2062  {
2063  continue;
2064  }
2065  else if( !Unrouted && !routeParsed && cNodeName == wxT( "ROUTE" ) )
2066  {
2067  Route.Parse( cNode, aContext );
2068  routeParsed = true;
2069  }
2070  else if( !routeParsed && cNodeName == wxT( "UNROUTE" ) )
2071  {
2072  Unrouted = true;
2074  }
2075  else if( cNode->GetName() == wxT( "TRUNKREF" ) )
2076  {
2077  TrunkID = GetXmlAttributeIDString( cNode, 0 );
2078  }
2079  else
2080  {
2081  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "CONN" ) );
2082  }
2083  }
2084 }
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 2007 of file cadstar_archive_parser.cpp.

2008 {
2009  wxASSERT( aNode->GetName() == wxT( "CONN" ) );
2010 
2011  StartNode = GetXmlAttributeIDString( aNode, 0 );
2012  EndNode = GetXmlAttributeIDString( aNode, 1 );
2013  RouteCodeID = GetXmlAttributeIDString( aNode, 2 );
2014 }
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 2017 of file cadstar_archive_parser.cpp.

2018 {
2019  wxString cNodeName = aChildNode->GetName();
2020 
2021  if( cNodeName == wxT( "FIX" ) )
2022  {
2023  Fixed = true;
2024  }
2025  else if( cNodeName == wxT( "HIDDEN" ) )
2026  {
2027  Hidden = true;
2028  }
2029  else if( cNodeName == wxT( "GROUPREF" ) )
2030  {
2031  GroupID = GetXmlAttributeIDString( aChildNode, 0 );
2032  }
2033  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2034  {
2035  ReuseBlockRef.Parse( aChildNode, aContext );
2036  }
2037  else if( cNodeName == wxT( "ATTR" ) )
2038  {
2039  ATTRIBUTE_VALUE attrVal;
2040  attrVal.Parse( aChildNode, aContext );
2041  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
2042  }
2043  else
2044  {
2045  return false;
2046  }
2047 
2048  return true;
2049 }
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 1159 of file cadstar_archive_parser.h.

◆ EndNode

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

Definition at line 1151 of file cadstar_archive_parser.h.

◆ Fixed

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

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

◆ Hidden

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

Definition at line 1155 of file cadstar_archive_parser.h.

◆ ReuseBlockRef

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

Definition at line 1157 of file cadstar_archive_parser.h.

◆ Route

ROUTE CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::Route

Definition at line 1001 of file cadstar_pcb_archive_parser.h.

◆ RouteCodeID

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

Definition at line 1152 of file cadstar_archive_parser.h.

◆ StartNode

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

Definition at line 1150 of file cadstar_archive_parser.h.

◆ TrunkID

TRUNK_ID CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::TrunkID

TRUNKREF Statements.

Definition at line 1008 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 1002 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 1007 of file cadstar_pcb_archive_parser.h.


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