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

2144{
2145 ParseIdentifiers( aNode, aContext );
2146
2147 //Parse child nodes
2148 XNODE* cNode = aNode->GetChildren();
2149
2150 for( ; cNode; cNode = cNode->GetNext() )
2151 {
2152 wxString cNodeName = cNode->GetName();
2153
2154 if( cNodeName == wxT( "JPT" ) )
2155 {
2156 JUNCTION_PCB jpt;
2157 jpt.Parse( cNode, aContext );
2158 Junctions.insert( std::make_pair( jpt.ID, jpt ) );
2159 }
2160 else if( ParseSubNode( cNode, aContext ) )
2161 {
2162 continue;
2163 }
2164 else if( cNodeName == wxT( "PIN" ) )
2165 {
2166 PIN pin;
2167 pin.Parse( cNode, aContext );
2168 Pins.insert( std::make_pair( pin.ID, pin ) );
2169 }
2170 else if( cNodeName == wxT( "VIA" ) )
2171 {
2172 VIA via;
2173 via.Parse( cNode, aContext );
2174 Vias.insert( std::make_pair( via.ID, via ) );
2175 }
2176 else if( cNodeName == wxT( "COPTERM" ) )
2177 {
2178 COPPER_TERMINAL cterm;
2179 cterm.Parse( cNode, aContext );
2180 CopperTerminals.insert( std::make_pair( cterm.ID, cterm ) );
2181 }
2182 else if( cNodeName == wxT( "CONN" ) )
2183 {
2184 CONNECTION_PCB conn;
2185 conn.Parse( cNode, aContext );
2186 Connections.push_back( conn );
2187 }
2188 else
2189 {
2190 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "NET" ) );
2191 }
2192 }
2193}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
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
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
std::map< NETELEMENT_ID, COPPER_TERMINAL > CopperTerminals
std::map< NETELEMENT_ID, JUNCTION_PCB > Junctions

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::ID, CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::COPPER_TERMINAL::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 2161 of file cadstar_archive_parser.cpp.

2162{
2163 wxASSERT( aNode->GetName() == wxT( "NET" ) );
2164
2165 ID = GetXmlAttributeIDString( aNode, 0 );
2166}
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 2169 of file cadstar_archive_parser.cpp.

2170{
2171 wxString cNodeName = aChildNode->GetName();
2172
2173 if( cNodeName == wxT( "NETCODE" ) )
2174 {
2175 RouteCodeID = GetXmlAttributeIDString( aChildNode, 0 );
2176 }
2177 else if( cNodeName == wxT( "SIGNAME" ) )
2178 {
2179 Name = GetXmlAttributeIDString( aChildNode, 0 );
2180 }
2181 else if( cNodeName == wxT( "SIGNUM" ) )
2182 {
2183 SignalNum = GetXmlAttributeIDLong( aChildNode, 0 );
2184 }
2185 else if( cNodeName == wxT( "HIGHLIT" ) )
2186 {
2187 Highlight = true;
2188 }
2189 else if( cNodeName == wxT( "JPT" ) )
2190 {
2191 JUNCTION jpt;
2192 jpt.Parse( aChildNode, aContext );
2193 Junctions.insert( std::make_pair( jpt.ID, jpt ) );
2194 }
2195 else if( cNodeName == wxT( "NETCLASSREF" ) )
2196 {
2197 NetClassID = GetXmlAttributeIDString( aChildNode, 0 );
2198 }
2199 else if( cNodeName == wxT( "SPACINGCLASS" ) )
2200 {
2201 SpacingClassID = GetXmlAttributeIDString( aChildNode, 0 );
2202 }
2203 else if( cNodeName == wxT( "ATTR" ) )
2204 {
2205 ATTRIBUTE_VALUE attrVal;
2206 attrVal.Parse( aChildNode, aContext );
2207 AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
2208 }
2209 else
2210 {
2211 return false;
2212 }
2213
2214 return true;
2215}
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
ROUTECODE_ID RouteCodeID
"NETCODE" subnode
wxString Name
This is undefined (wxEmptyString) if the net is unnamed.
std::map< NETELEMENT_ID, JUNCTION > Junctions
NETCLASS_ID NetClassID
The net might not have a net class, in which case it will be wxEmptyString ("NETCLASSREF" subnode)
SPACING_CLASS_ID SpacingClassID
The net might not have a spacing class, in which case it will be wxEmptyString ("SPACINGCLASS" subnod...
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
long SignalNum
This is undefined if the net has been given a name.

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

◆ Connections

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

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

◆ Highlight

bool CADSTAR_ARCHIVE_PARSER::NET::Highlight = false
inherited

Definition at line 1209 of file cadstar_archive_parser.h.

◆ ID

◆ Junctions

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

Definition at line 1021 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadNets().

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::NET::Name = wxEmptyString
inherited

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

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().

◆ Pins

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

◆ RouteCodeID

ROUTECODE_ID CADSTAR_ARCHIVE_PARSER::NET::RouteCodeID = wxEmptyString
inherited

"NETCODE" subnode

Definition at line 1204 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().

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

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet(), 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 1217 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().

◆ Vias

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

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