KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB Struct Reference

#include <cadstar_pcb_archive_parser.h>

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

Classes

struct  CONNECTION_PCB
 < "CONN" nodename More...
 
struct  COPPER_TERMINAL
 < "COPTERM" nodename More...
 
struct  JUNCTION_PCB
 < "JPT" nodename More...
 
struct  PIN
 < "PIN" nodename (represents a PAD in a PCB component) More...
 
struct  ROUTE
 < "ROUTE" nodename More...
 
struct  ROUTE_VERTEX
 < Two sibbling nodes: first node being "ROUTEWIDTH" and next node being a VERTEX (e.g. More...
 
struct  VIA
 < "VIA" nodename More...
 

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

std::map< NETELEMENT_ID, PINPins
 
std::map< NETELEMENT_ID, JUNCTION_PCBJunctions
 
std::map< NETELEMENT_ID, VIAVias
 
std::map< NETELEMENT_ID, COPPER_TERMINALCopperTerminals
 
std::vector< CONNECTION_PCBConnections
 
NET_ID ID
 
ROUTECODE_ID RouteCodeID = wxEmptyString
 "NETCODE" subnode More...
 
long SignalNum = UNDEFINED_VALUE
 This is undefined if the net has been given a name. More...
 
wxString Name = wxEmptyString
 This is undefined (wxEmptyString) if the net is unnamed. More...
 
bool Highlight = false
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 
NETCLASS_ID NetClassID
 The net might not have a net class, in which case it will be wxEmptyString ("NETCLASSREF" subnode) More...
 
SPACING_CLASS_ID SpacingClassID
 The net might not have a spacing class, in which case it will be wxEmptyString ("SPACINGCLASS" subnode) More...
 

Detailed Description

Definition at line 940 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2119 of file cadstar_pcb_archive_parser.cpp.

2120 {
2121  ParseIdentifiers( aNode, aContext );
2122 
2123  //Parse child nodes
2124  XNODE* cNode = aNode->GetChildren();
2125 
2126  for( ; cNode; cNode = cNode->GetNext() )
2127  {
2128  wxString cNodeName = cNode->GetName();
2129 
2130  if( cNodeName == wxT( "JPT" ) )
2131  {
2132  JUNCTION_PCB jpt;
2133  jpt.Parse( cNode, aContext );
2134  Junctions.insert( std::make_pair( jpt.ID, jpt ) );
2135  }
2136  else if( ParseSubNode( cNode, aContext ) )
2137  {
2138  continue;
2139  }
2140  else if( cNodeName == wxT( "PIN" ) )
2141  {
2142  PIN pin;
2143  pin.Parse( cNode, aContext );
2144  Pins.insert( std::make_pair( pin.ID, pin ) );
2145  }
2146  else if( cNodeName == wxT( "VIA" ) )
2147  {
2148  VIA via;
2149  via.Parse( cNode, aContext );
2150  Vias.insert( std::make_pair( via.ID, via ) );
2151  }
2152  else if( cNodeName == wxT( "COPTERM" ) )
2153  {
2154  COPPER_TERMINAL cterm;
2155  cterm.Parse( cNode, aContext );
2156  CopperTerminals.insert( std::make_pair( cterm.ID, cterm ) );
2157  }
2158  else if( cNodeName == wxT( "CONN" ) )
2159  {
2160  CONNECTION_PCB conn;
2161  conn.Parse( cNode, aContext );
2162  Connections.push_back( conn );
2163  }
2164  else
2165  {
2166  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "NET" ) );
2167  }
2168  }
2169 }
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
std::map< NETELEMENT_ID, COPPER_TERMINAL > CopperTerminals
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
std::map< NETELEMENT_ID, JUNCTION_PCB > Junctions
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::COPPER_TERMINAL::ID, CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::ID, CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::JUNCTION_PCB::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::COPPER_TERMINAL::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::Parse(), pin, THROW_UNKNOWN_NODE_IO_ERROR, and via.

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

◆ ParseIdentifiers()

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

Definition at line 2065 of file cadstar_archive_parser.cpp.

2066 {
2067  wxASSERT( aNode->GetName() == wxT( "NET" ) );
2068 
2069  ID = GetXmlAttributeIDString( aNode, 0 );
2070 }
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

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

Definition at line 2073 of file cadstar_archive_parser.cpp.

2074 {
2075  wxString cNodeName = aChildNode->GetName();
2076 
2077  if( cNodeName == wxT( "NETCODE" ) )
2078  {
2079  RouteCodeID = GetXmlAttributeIDString( aChildNode, 0 );
2080  }
2081  else if( cNodeName == wxT( "SIGNAME" ) )
2082  {
2083  Name = GetXmlAttributeIDString( aChildNode, 0 );
2084  }
2085  else if( cNodeName == wxT( "SIGNUM" ) )
2086  {
2087  SignalNum = GetXmlAttributeIDLong( aChildNode, 0 );
2088  }
2089  else if( cNodeName == wxT( "HIGHLIT" ) )
2090  {
2091  Highlight = true;
2092  }
2093  else if( cNodeName == wxT( "JPT" ) )
2094  {
2095  JUNCTION jpt;
2096  jpt.Parse( aChildNode, aContext );
2097  Junctions.insert( std::make_pair( jpt.ID, jpt ) );
2098  }
2099  else if( cNodeName == wxT( "NETCLASSREF" ) )
2100  {
2101  NetClassID = GetXmlAttributeIDString( aChildNode, 0 );
2102  }
2103  else if( cNodeName == wxT( "SPACINGCLASS" ) )
2104  {
2105  SpacingClassID = GetXmlAttributeIDString( aChildNode, 0 );
2106  }
2107  else if( cNodeName == wxT( "ATTR" ) )
2108  {
2109  ATTRIBUTE_VALUE attrVal;
2110  attrVal.Parse( aChildNode, aContext );
2111  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
2112  }
2113  else
2114  {
2115  return false;
2116  }
2117 
2118  return true;
2119 }
long SignalNum
This is undefined if the net has been given a name.
std::map< NETELEMENT_ID, JUNCTION > Junctions
ROUTECODE_ID RouteCodeID
"NETCODE" subnode
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
wxString Name
This is undefined (wxEmptyString) if the net is unnamed.
NETCLASS_ID NetClassID
The net might not have a net class, in which case it will be wxEmptyString ("NETCLASSREF" subnode)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
SPACING_CLASS_ID SpacingClassID
The net might not have a spacing class, in which case it will be wxEmptyString ("SPACINGCLASS" subnod...

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::ID, CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), and CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::Parse().

Member Data Documentation

◆ AttributeValues

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

Definition at line 1187 of file cadstar_archive_parser.h.

◆ Connections

std::vector<CONNECTION_PCB> CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::Connections

Definition at line 1020 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadNets().

◆ CopperTerminals

std::map<NETELEMENT_ID, COPPER_TERMINAL> CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CopperTerminals

Definition at line 1019 of file cadstar_pcb_archive_parser.h.

◆ Highlight

bool CADSTAR_ARCHIVE_PARSER::NET::Highlight = false
inherited

Definition at line 1184 of file cadstar_archive_parser.h.

◆ ID

◆ Junctions

std::map<NETELEMENT_ID, JUNCTION_PCB> CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::Junctions

Definition at line 1017 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadNets().

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::NET::Name = wxEmptyString
inherited

This is undefined (wxEmptyString) if the net is unnamed.

"SIGNAME" subnode

Definition at line 1182 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::getNetName(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), CADSTAR_PCB_ARCHIVE_LOADER::loadNets(), and CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates().

◆ NetClassID

NETCLASS_ID CADSTAR_ARCHIVE_PARSER::NET::NetClassID
inherited
Initial value:
=
wxEmptyString

The net might not have a net class, in which case it will be wxEmptyString ("NETCLASSREF" subnode)

Definition at line 1189 of file cadstar_archive_parser.h.

◆ Pins

std::map<NETELEMENT_ID, PIN> CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::Pins

Definition at line 1016 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadNets().

◆ RouteCodeID

ROUTECODE_ID CADSTAR_ARCHIVE_PARSER::NET::RouteCodeID = wxEmptyString
inherited

"NETCODE" subnode

Definition at line 1179 of file cadstar_archive_parser.h.

◆ SignalNum

long CADSTAR_ARCHIVE_PARSER::NET::SignalNum = UNDEFINED_VALUE
inherited

This is undefined if the net has been given a name.

"SIGNUM" subnode.

Definition at line 1180 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::getNetName(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), and CADSTAR_PCB_ARCHIVE_LOADER::loadNets().

◆ SpacingClassID

SPACING_CLASS_ID CADSTAR_ARCHIVE_PARSER::NET::SpacingClassID
inherited
Initial value:
=
wxEmptyString

The net might not have a spacing class, in which case it will be wxEmptyString ("SPACINGCLASS" subnode)

Definition at line 1192 of file cadstar_archive_parser.h.

◆ Vias

std::map<NETELEMENT_ID, VIA> CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::Vias

Definition at line 1018 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadNets().


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