KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH:
CADSTAR_ARCHIVE_PARSER::NET CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  BLOCK_TERM
 < "BLOCKTERM" nodename (represents a connection to a block) More...
 
struct  BUS_TERM
 < "BUSTERM" nodename (represents a connection to a bus) More...
 
struct  CONNECTION_SCH
 < "CONN" nodename More...
 
struct  DANGLER
 < "DANGLER" nodename (represents a dangling wire) More...
 
struct  JUNCTION_SCH
 < "JPT" nodename. More...
 
struct  SYM_TERM
 < "TERM" nodename (represents a pin in a SCH symbol) 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, JUNCTION_SCHJunctions
 
std::map< NETELEMENT_ID, SYM_TERMTerminals
 
std::map< NETELEMENT_ID, BUS_TERMBusTerminals
 
std::map< NETELEMENT_ID, BLOCK_TERMBlockTerminals
 
std::map< NETELEMENT_ID, DANGLERDanglers
 
std::vector< CONNECTION_SCHConnections
 
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 347 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1053 of file cadstar_sch_archive_parser.cpp.

1054 {
1055  ParseIdentifiers( aNode, aContext );
1056 
1057  //Parse child nodes
1058  XNODE* cNode = aNode->GetChildren();
1059 
1060  for( ; cNode; cNode = cNode->GetNext() )
1061  {
1062  wxString cNodeName = cNode->GetName();
1063 
1064  if( cNodeName == wxT( "JPT" ) )
1065  {
1066  JUNCTION_SCH jpt;
1067  jpt.Parse( cNode, aContext );
1068  Junctions.insert( std::make_pair( jpt.ID, jpt ) );
1069  }
1070  else if( ParseSubNode( cNode, aContext ) )
1071  {
1072  continue;
1073  }
1074  else if( cNodeName == wxT( "TERM" ) )
1075  {
1076  SYM_TERM pin;
1077  pin.Parse( cNode, aContext );
1078  Terminals.insert( std::make_pair( pin.ID, pin ) );
1079  }
1080  else if( cNodeName == wxT( "BUSTERM" ) )
1081  {
1082  BUS_TERM bt;
1083  bt.Parse( cNode, aContext );
1084  BusTerminals.insert( std::make_pair( bt.ID, bt ) );
1085  }
1086  else if( cNodeName == wxT( "BLOCKTERM" ) )
1087  {
1088  BLOCK_TERM bt;
1089  bt.Parse( cNode, aContext );
1090  BlockTerminals.insert( std::make_pair( bt.ID, bt ) );
1091  }
1092  else if( cNodeName == wxT( "DANGLER" ) )
1093  {
1094  DANGLER dang;
1095  dang.Parse( cNode, aContext );
1096  Danglers.insert( std::make_pair( dang.ID, dang ) );
1097  }
1098  else if( cNodeName == wxT( "CONN" ) )
1099  {
1100  CONNECTION_SCH conn;
1101  conn.Parse( cNode, aContext );
1102  Connections.push_back( conn );
1103  }
1104  else
1105  {
1106  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "NET" ) );
1107  }
1108  }
1109 }
std::map< NETELEMENT_ID, BLOCK_TERM > BlockTerminals
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
std::map< NETELEMENT_ID, DANGLER > Danglers
XNODE * GetChildren() const
Definition: xnode.h:62
std::map< NETELEMENT_ID, SYM_TERM > Terminals
std::map< NETELEMENT_ID, BUS_TERM > BusTerminals
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
std::map< NETELEMENT_ID, JUNCTION_SCH > Junctions

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::ID, CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BLOCK_TERM::ID, CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::DANGLER::ID, CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::ID, CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::JUNCTION_SCH::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BLOCK_TERM::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::DANGLER::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::Parse(), pin, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::CADSTAR_SCHEMATIC::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.

◆ BlockTerminals

std::map<NETELEMENT_ID, BLOCK_TERM> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BlockTerminals

◆ BusTerminals

std::map<NETELEMENT_ID, BUS_TERM> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BusTerminals

◆ Connections

std::vector<CONNECTION_SCH> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Connections

Definition at line 421 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadNets().

◆ Danglers

std::map<NETELEMENT_ID, DANGLER> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Danglers

◆ 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_SCH> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Junctions

◆ 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.

◆ 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.

◆ Terminals

std::map<NETELEMENT_ID, SYM_TERM> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Terminals

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