KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::BUS Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::BUS:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

BUS_ID ID
 
LINECODE_ID LineCodeID
 
LAYER_ID LayerID
 Sheet on which bus is located. More...
 
SHAPE Shape
 
wxString Name = wxEmptyString
 
bool HasBusLabel = false
 
SIGLOC BusLabel
 

Detailed Description

Definition at line 309 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 800 of file cadstar_sch_archive_parser.cpp.

801 {
802  wxCHECK( aNode->GetName() == wxT( "BUS" ), );
803 
804  ID = GetXmlAttributeIDString( aNode, 0 );
805  LineCodeID = GetXmlAttributeIDString( aNode, 1 );
806  LayerID = GetXmlAttributeIDString( aNode, 2 );
807 
808  XNODE* cNode = aNode->GetChildren();
809 
810  for( ; cNode; cNode = cNode->GetNext() )
811  {
812  wxString cNodeName = cNode->GetName();
813 
814  if( SHAPE::IsShape( cNode ) )
815  {
816  Shape.Parse( cNode, aContext );
817  }
818  else if( cNodeName == wxT( "BUSNAME" ) )
819  {
820  Name = GetXmlAttributeIDString( cNode, 0 );
821 
822  XNODE* subNode = cNode->GetChildren();
823 
824  if( subNode )
825  {
826  if( subNode->GetName() == wxT( "SIGLOC" ) )
827  {
828  BusLabel.Parse( subNode, aContext );
829  HasBusLabel = true;
830  }
831  else
832  {
833  THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), cNode->GetName() );
834  }
835  }
836  }
837  else
838  {
839  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
840  }
841  }
842 }
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetChildren() const
Definition: xnode.h:62
virtual bool Parse(std::stringstream &aStream)
Definition: shape.cpp:28
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
LAYER_ID LayerID
Sheet on which bus is located.
#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(), CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape(), and THROW_UNKNOWN_NODE_IO_ERROR.

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

Member Data Documentation

◆ BusLabel

SIGLOC CADSTAR_SCH_ARCHIVE_PARSER::BUS::BusLabel

◆ HasBusLabel

bool CADSTAR_SCH_ARCHIVE_PARSER::BUS::HasBusLabel = false

◆ ID

◆ LayerID

LAYER_ID CADSTAR_SCH_ARCHIVE_PARSER::BUS::LayerID

Sheet on which bus is located.

Definition at line 313 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), and CADSTAR_SCH_ARCHIVE_LOADER::loadNets().

◆ LineCodeID

LINECODE_ID CADSTAR_SCH_ARCHIVE_PARSER::BUS::LineCodeID

◆ Name

wxString CADSTAR_SCH_ARCHIVE_PARSER::BUS::Name = wxEmptyString

◆ Shape

SHAPE CADSTAR_SCH_ARCHIVE_PARSER::BUS::Shape

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