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

< "BUSTERM" nodename (represents a connection to a bus) More...

#include <cadstar_sch_archive_parser.h>

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

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

NETELEMENT_ID ID
 First two characters "BT". More...
 
BUS_ID BusID
 
POINT FirstPoint
 Point on the bus itself. More...
 
POINT SecondPoint
 Start point for any wires. More...
 
bool HasNetLabel = false
 
SIGLOC NetLabel
 

Detailed Description

< "BUSTERM" nodename (represents a connection to a bus)

Definition at line 369 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 938 of file cadstar_sch_archive_parser.cpp.

939 {
940  wxASSERT( aNode->GetName() == wxT( "BUSTERM" ) );
941 
942  ID = GetXmlAttributeIDString( aNode, 0 );
943  BusID = GetXmlAttributeIDString( aNode, 1 );
944 
945 
946  XNODE* cNode = aNode->GetChildren();
947  bool firstPointParsed = false;
948  bool secondPointParsed = false;
949 
950  for( ; cNode; cNode = cNode->GetNext() )
951  {
952  wxString cNodeName = cNode->GetName();
953 
954  if( cNodeName == wxT( "SIGLOC" ) )
955  {
956  NetLabel.Parse( cNode, aContext );
957  HasNetLabel = true;
958  }
959  else if( cNodeName == wxT( "PT" ) )
960  {
961  if( !firstPointParsed )
962  {
963  FirstPoint.Parse( cNode, aContext );
964  firstPointParsed = true;
965  }
966  else if( !secondPointParsed )
967  {
968  SecondPoint.Parse( cNode, aContext );
969  secondPointParsed = true;
970  }
971  else
972  {
973  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
974  }
975  }
976  else
977  {
978  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
979  }
980  }
981 
982  if( !firstPointParsed || !secondPointParsed )
983  THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), aNode->GetName() );
984 }
NETELEMENT_ID ID
First two characters "BT".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetChildren() const
Definition: xnode.h:62
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
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)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

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

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Parse().

Member Data Documentation

◆ BusID

BUS_ID CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::BusID

Definition at line 372 of file cadstar_sch_archive_parser.h.

◆ FirstPoint

POINT CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::FirstPoint

Point on the bus itself.

Definition at line 373 of file cadstar_sch_archive_parser.h.

◆ HasNetLabel

bool CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::HasNetLabel = false

Definition at line 375 of file cadstar_sch_archive_parser.h.

◆ ID

NETELEMENT_ID CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::ID

First two characters "BT".

Definition at line 371 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::Parse().

◆ NetLabel

SIGLOC CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::NetLabel

Definition at line 376 of file cadstar_sch_archive_parser.h.

◆ SecondPoint

POINT CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::SecondPoint

Start point for any wires.

Definition at line 374 of file cadstar_sch_archive_parser.h.


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