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 938 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 2087 of file cadstar_pcb_archive_parser.cpp.

2088 {
2089  ParseIdentifiers( aNode, aContext );
2090 
2091  //Parse child nodes
2092  XNODE* cNode = aNode->GetChildren();
2093 
2094  for( ; cNode; cNode = cNode->GetNext() )
2095  {
2096  wxString cNodeName = cNode->GetName();
2097 
2098  if( cNodeName == wxT( "JPT" ) )
2099  {
2100  JUNCTION_PCB jpt;
2101  jpt.Parse( cNode, aContext );
2102  Junctions.insert( std::make_pair( jpt.ID, jpt ) );
2103  }
2104  else if( ParseSubNode( cNode, aContext ) )
2105  {
2106  continue;
2107  }
2108  else if( cNodeName == wxT( "PIN" ) )
2109  {
2110  PIN pin;
2111  pin.Parse( cNode, aContext );
2112  Pins.insert( std::make_pair( pin.ID, pin ) );
2113  }
2114  else if( cNodeName == wxT( "VIA" ) )
2115  {
2116  VIA via;
2117  via.Parse( cNode, aContext );
2118  Vias.insert( std::make_pair( via.ID, via ) );
2119  }
2120  else if( cNodeName == wxT( "COPTERM" ) )
2121  {
2122  COPPER_TERMINAL cterm;
2123  cterm.Parse( cNode, aContext );
2124  CopperTerminals.insert( std::make_pair( cterm.ID, cterm ) );
2125  }
2126  else if( cNodeName == wxT( "CONN" ) )
2127  {
2128  CONNECTION_PCB conn;
2129  conn.Parse( cNode, aContext );
2130  Connections.push_back( conn );
2131  }
2132  else
2133  {
2134  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "NET" ) );
2135  }
2136  }
2137 }
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 2052 of file cadstar_archive_parser.cpp.

2053 {
2054  wxASSERT( aNode->GetName() == wxT( "NET" ) );
2055 
2056  ID = GetXmlAttributeIDString( aNode, 0 );
2057 }
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 2060 of file cadstar_archive_parser.cpp.

2061 {
2062  wxString cNodeName = aChildNode->GetName();
2063 
2064  if( cNodeName == wxT( "NETCODE" ) )
2065  {
2066  RouteCodeID = GetXmlAttributeIDString( aChildNode, 0 );
2067  }
2068  else if( cNodeName == wxT( "SIGNAME" ) )
2069  {
2070  Name = GetXmlAttributeIDString( aChildNode, 0 );
2071  }
2072  else if( cNodeName == wxT( "SIGNUM" ) )
2073  {
2074  SignalNum = GetXmlAttributeIDLong( aChildNode, 0 );
2075  }
2076  else if( cNodeName == wxT( "HIGHLIT" ) )
2077  {
2078  Highlight = true;
2079  }
2080  else if( cNodeName == wxT( "JPT" ) )
2081  {
2082  JUNCTION jpt;
2083  jpt.Parse( aChildNode, aContext );
2084  Junctions.insert( std::make_pair( jpt.ID, jpt ) );
2085  }
2086  else if( cNodeName == wxT( "NETCLASSREF" ) )
2087  {
2088  NetClassID = GetXmlAttributeIDString( aChildNode, 0 );
2089  }
2090  else if( cNodeName == wxT( "SPACINGCLASS" ) )
2091  {
2092  SpacingClassID = GetXmlAttributeIDString( aChildNode, 0 );
2093  }
2094  else if( cNodeName == wxT( "ATTR" ) )
2095  {
2096  ATTRIBUTE_VALUE attrVal;
2097  attrVal.Parse( aChildNode, aContext );
2098  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
2099  }
2100  else
2101  {
2102  return false;
2103  }
2104 
2105  return true;
2106 }
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 1177 of file cadstar_archive_parser.h.

◆ Connections

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

Definition at line 1017 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 1016 of file cadstar_pcb_archive_parser.h.

◆ Highlight

bool CADSTAR_ARCHIVE_PARSER::NET::Highlight = false
inherited

Definition at line 1174 of file cadstar_archive_parser.h.

◆ ID

◆ Junctions

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

Definition at line 1014 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 1172 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 1179 of file cadstar_archive_parser.h.

◆ Pins

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

Definition at line 1013 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 1169 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 1170 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 1182 of file cadstar_archive_parser.h.

◆ Vias

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

Definition at line 1015 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: