KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::BLOCK Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::BLOCK:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Types

enum  TYPE { TYPE::CLONE, TYPE::PARENT, TYPE::CHILD }
 

Public Member Functions

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

Public Attributes

BLOCK_ID ID
 
TYPE Type
 Determines what the associated layer is, whether parent, child or clone. More...
 
LAYER_ID LayerID = wxEmptyString
 The sheet block is on (TODO: verify this is true) More...
 
LAYER_ID AssocLayerID = wxEmptyString
 Parent or Child linked sheet. More...
 
wxString Name = wxEmptyString
 
bool HasBlockLabel = false
 
ATTRIBUTE_LOCATION BlockLabel
 
std::map< TERMINAL_ID, TERMINALTerminals
 
std::map< FIGURE_ID, FIGUREFigures
 

Detailed Description

Definition at line 323 of file cadstar_sch_archive_parser.h.

Member Enumeration Documentation

◆ TYPE

Enumerator
CLONE 

the block is referring to the sheet it is on.

PARENT 
CHILD 

Definition at line 325 of file cadstar_sch_archive_parser.h.

326  {
327  CLONE,
328  PARENT,
329  CHILD
330  };

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 845 of file cadstar_sch_archive_parser.cpp.

846 {
847  wxCHECK( aNode->GetName() == wxT( "BLOCK" ), );
848 
849  ID = GetXmlAttributeIDString( aNode, 0 );
850  LayerID = GetXmlAttributeIDString( aNode, 2 );
851 
852  XNODE* cNode = aNode->GetChildren();
853 
854  for( ; cNode; cNode = cNode->GetNext() )
855  {
856  wxString cNodeName = cNode->GetName();
857 
858  if( cNodeName == wxT( "CLONE" ) )
859  {
860  Type = TYPE::CLONE;
861  }
862  else if( cNodeName == wxT( "PARENT" ) )
863  {
864  Type = TYPE::PARENT;
866  }
867  else if( cNodeName == wxT( "CHILD" ) )
868  {
869  Type = TYPE::CHILD;
871  }
872  else if( cNodeName == wxT( "BLOCKNAME" ) )
873  {
874  Name = GetXmlAttributeIDString( cNode, 0 );
875  XNODE* subNode = cNode->GetChildren();
876 
877  if( subNode )
878  {
879  if( subNode->GetName() == wxT( "ATTRLOC" ) )
880  {
881  BlockLabel.Parse( subNode, aContext );
882  HasBlockLabel = true;
883  }
884  else
885  {
886  THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), cNode->GetName() );
887  }
888  }
889  }
890  else if( cNodeName == wxT( "TERMINAL" ) )
891  {
892  TERMINAL term;
893  term.Parse( cNode, aContext );
894  Terminals.insert( std::make_pair( term.ID, term ) );
895  }
896  else if( cNodeName == wxT( "FIGURE" ) )
897  {
898  FIGURE figure;
899  figure.Parse( cNode, aContext );
900  Figures.insert( std::make_pair( figure.ID, figure ) );
901  }
902  else
903  {
904  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
905  }
906  }
907 }
TYPE Type
Determines what the associated layer is, whether parent, child or clone.
LAYER_ID AssocLayerID
Parent or Child linked sheet.
XNODE * GetChildren() const
Definition: xnode.h:62
std::map< TERMINAL_ID, TERMINAL > Terminals
LAYER_ID LayerID
The sheet block is on (TODO: verify this is true)
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
the block is referring to the sheet it is on.
#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_SCH_ARCHIVE_PARSER::TERMINAL::ID, CADSTAR_ARCHIVE_PARSER::FIGURE::ID, CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.

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

Member Data Documentation

◆ AssocLayerID

LAYER_ID CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::AssocLayerID = wxEmptyString

◆ BlockLabel

ATTRIBUTE_LOCATION CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::BlockLabel

◆ Figures

std::map<FIGURE_ID, FIGURE> CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::Figures

◆ HasBlockLabel

bool CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::HasBlockLabel = false

◆ ID

◆ LayerID

LAYER_ID CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::LayerID = wxEmptyString

The sheet block is on (TODO: verify this is true)

Definition at line 334 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), and CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins().

◆ Name

wxString CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::Name = wxEmptyString

◆ Terminals

std::map<TERMINAL_ID, TERMINAL> CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::Terminals

◆ Type

TYPE CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::Type

Determines what the associated layer is, whether parent, child or clone.

Definition at line 333 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::findOrphanSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), and CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins().


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