KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH Struct Reference

< "CONN" nodename More...

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH:
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

LAYER_ID LayerID
 Sheet on which the connection is drawn. More...
 
std::vector< POINT > Path
 
GROUP_ID GroupID = wxEmptyString
 
REUSEBLOCKREF ReuseBlockRef
 
LINECODE_ID ConnectionLineCode
 
NETELEMENT_ID StartNode
 
NETELEMENT_ID EndNode
 
ROUTECODE_ID RouteCodeID
 
bool Fixed = false
 
bool Hidden = false
 
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 405 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1014 of file cadstar_sch_archive_parser.cpp.

1015 {
1016  ParseIdentifiers( aNode, aContext );
1017  LayerID = GetXmlAttributeIDString( aNode, 3 );
1018 
1019  XNODE* cNode = aNode->GetChildren();
1020 
1021  for( ; cNode; cNode = cNode->GetNext() )
1022  {
1023  wxString cNodeName = cNode->GetName();
1024 
1025  if( ParseSubNode( cNode, aContext ) )
1026  {
1027  continue;
1028  }
1029  else if( cNodeName == wxT( "PATH" ) )
1030  {
1031  Path = ParseAllChildPoints( cNode, aContext, true );
1032  }
1033  else if( cNodeName == wxT( "GROUPREF" ) )
1034  {
1035  GroupID = GetXmlAttributeIDString( cNode, 0 );
1036  }
1037  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
1038  {
1039  ReuseBlockRef.Parse( cNode, aContext );
1040  }
1041  else if( cNodeName == wxT( "CONLINECODE" ) )
1042  {
1044  }
1045  else
1046  {
1047  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "CONN" ) );
1048  }
1049  }
1050 }
LAYER_ID LayerID
Sheet on which the connection is drawn.
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 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)
static std::vector< POINT > ParseAllChildPoints(XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false, int aExpectedNumPoints=UNDEFINED_VALUE)
if no children are present, it just returns an empty vector (without throwing an exception)

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::ParseAllChildPoints(), and THROW_UNKNOWN_NODE_IO_ERROR.

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

◆ ConnectionLineCode

LINECODE_ID CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::ConnectionLineCode

Definition at line 411 of file cadstar_sch_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_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::GroupID = wxEmptyString

Definition at line 409 of file cadstar_sch_archive_parser.h.

◆ Hidden

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

Definition at line 1155 of file cadstar_archive_parser.h.

◆ LayerID

LAYER_ID CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::LayerID

Sheet on which the connection is drawn.

Definition at line 407 of file cadstar_sch_archive_parser.h.

◆ Path

std::vector<POINT> CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::Path

Definition at line 408 of file cadstar_sch_archive_parser.h.

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::ReuseBlockRef

Definition at line 410 of file cadstar_sch_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.


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