KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::CODEDEFS_SCM Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::CODEDEFS_SCM:
CADSTAR_ARCHIVE_PARSER::CODEDEFS CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 
bool ParseSubNode (XNODE *aChildNode, PARSER_CONTEXT *aContext)
 

Public Attributes

std::map< TERMINALCODE_ID, TERMINALCODETerminalCodes
 
std::map< LINECODE_ID, LINECODELineCodes
 
std::map< HATCHCODE_ID, HATCHCODEHatchCodes
 
std::map< TEXTCODE_ID, TEXTCODETextCodes
 
std::map< ROUTECODE_ID, ROUTECODERouteCodes
 
std::map< ATTRIBUTE_ID, ATTRNAMEAttributeNames
 
std::map< NETCLASS_ID, CADSTAR_NETCLASSNetClasses
 
std::map< SPACING_CLASS_ID, SPCCLASSNAMESpacingClassNames
 

Detailed Description

Definition at line 110 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 259 of file cadstar_sch_archive_parser.cpp.

260 {
261  wxCHECK( aNode->GetName() == wxT( "CODEDEFS" ), );
262 
263  XNODE* cNode = aNode->GetChildren();
264 
265  for( ; cNode; cNode = cNode->GetNext() )
266  {
267  wxString nodeName = cNode->GetName();
268 
269  if( ParseSubNode( cNode, aContext ) ) // in CADSTAR_ARCHIVE_PARSER::CODEDEFS
270  {
271  continue;
272  }
273  else if( nodeName == wxT( "TERMINALCODE" ) )
274  {
275  TERMINALCODE termcode;
276  termcode.Parse( cNode, aContext );
277  TerminalCodes.insert( std::make_pair( termcode.ID, termcode ) );
278  }
279  else
280  {
281  THROW_UNKNOWN_NODE_IO_ERROR( nodeName, aNode->GetName() );
282  }
283  }
284 }
std::map< TERMINALCODE_ID, TERMINALCODE > TerminalCodes
XNODE * GetChildren() const
Definition: xnode.h:62
Hold an XML or S-expression element.
Definition: xnode.h:43
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)

References XNODE::GetChildren(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::ID, CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.

◆ ParseSubNode()

bool CADSTAR_ARCHIVE_PARSER::CODEDEFS::ParseSubNode ( XNODE aChildNode,
PARSER_CONTEXT aContext 
)
inherited

Definition at line 1341 of file cadstar_archive_parser.cpp.

1342 {
1343  wxString nodeName = aChildNode->GetName();
1344 
1345  if( nodeName == wxT( "LINECODE" ) )
1346  {
1347  LINECODE linecode;
1348  linecode.Parse( aChildNode, aContext );
1349  LineCodes.insert( std::make_pair( linecode.ID, linecode ) );
1350  }
1351  else if( nodeName == wxT( "HATCHCODE" ) )
1352  {
1353  HATCHCODE hatchcode;
1354  hatchcode.Parse( aChildNode, aContext );
1355  HatchCodes.insert( std::make_pair( hatchcode.ID, hatchcode ) );
1356  }
1357  else if( nodeName == wxT( "TEXTCODE" ) )
1358  {
1359  TEXTCODE textcode;
1360  textcode.Parse( aChildNode, aContext );
1361  TextCodes.insert( std::make_pair( textcode.ID, textcode ) );
1362  }
1363  else if( nodeName == wxT( "ROUTECODE" ) )
1364  {
1365  ROUTECODE routecode;
1366  routecode.Parse( aChildNode, aContext );
1367  RouteCodes.insert( std::make_pair( routecode.ID, routecode ) );
1368  }
1369  else if( nodeName == wxT( "ATTRNAME" ) )
1370  {
1371  ATTRNAME attrname;
1372  attrname.Parse( aChildNode, aContext );
1373  AttributeNames.insert( std::make_pair( attrname.ID, attrname ) );
1374  }
1375  else if( nodeName == wxT( "NETCLASS" ) )
1376  {
1377  CADSTAR_NETCLASS netclass;
1378  netclass.Parse( aChildNode, aContext );
1379  NetClasses.insert( std::make_pair( netclass.ID, netclass ) );
1380  }
1381  else if( nodeName == wxT( "SPCCLASSNAME" ) )
1382  {
1383  SPCCLASSNAME spcclassname;
1384  spcclassname.Parse( aChildNode, aContext );
1385  SpacingClassNames.insert( std::make_pair( spcclassname.ID, spcclassname ) );
1386  }
1387  else
1388  {
1389  return false;
1390  }
1391 
1392  return true;
1393 }
std::map< ROUTECODE_ID, ROUTECODE > RouteCodes
std::map< ATTRIBUTE_ID, ATTRNAME > AttributeNames
std::map< LINECODE_ID, LINECODE > LineCodes
std::map< NETCLASS_ID, CADSTAR_NETCLASS > NetClasses
std::map< TEXTCODE_ID, TEXTCODE > TextCodes
std::map< SPACING_CLASS_ID, SPCCLASSNAME > SpacingClassNames
std::map< HATCHCODE_ID, HATCHCODE > HatchCodes

References CADSTAR_ARCHIVE_PARSER::LINECODE::ID, CADSTAR_ARCHIVE_PARSER::HATCHCODE::ID, CADSTAR_ARCHIVE_PARSER::TEXTCODE::ID, CADSTAR_ARCHIVE_PARSER::ROUTECODE::ID, CADSTAR_ARCHIVE_PARSER::ATTRNAME::ID, CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::ID, CADSTAR_ARCHIVE_PARSER::SPCCLASSNAME::ID, CADSTAR_ARCHIVE_PARSER::LINECODE::Parse(), CADSTAR_ARCHIVE_PARSER::HATCHCODE::Parse(), CADSTAR_ARCHIVE_PARSER::TEXTCODE::Parse(), CADSTAR_ARCHIVE_PARSER::ROUTECODE::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::Parse(), CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::Parse(), and CADSTAR_ARCHIVE_PARSER::SPCCLASSNAME::Parse().

Member Data Documentation

◆ AttributeNames

std::map<ATTRIBUTE_ID, ATTRNAME> CADSTAR_ARCHIVE_PARSER::CODEDEFS::AttributeNames
inherited

◆ HatchCodes

std::map<HATCHCODE_ID, HATCHCODE> CADSTAR_ARCHIVE_PARSER::CODEDEFS::HatchCodes
inherited

Definition at line 780 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getHatchCode().

◆ LineCodes

◆ NetClasses

std::map<NETCLASS_ID, CADSTAR_NETCLASS> CADSTAR_ARCHIVE_PARSER::CODEDEFS::NetClasses
inherited

Definition at line 784 of file cadstar_archive_parser.h.

◆ RouteCodes

std::map<ROUTECODE_ID, ROUTECODE> CADSTAR_ARCHIVE_PARSER::CODEDEFS::RouteCodes
inherited

◆ SpacingClassNames

std::map<SPACING_CLASS_ID, SPCCLASSNAME> CADSTAR_ARCHIVE_PARSER::CODEDEFS::SpacingClassNames
inherited

Definition at line 785 of file cadstar_archive_parser.h.

◆ TerminalCodes

std::map<TERMINALCODE_ID, TERMINALCODE> CADSTAR_SCH_ARCHIVE_PARSER::CODEDEFS_SCM::TerminalCodes

Definition at line 112 of file cadstar_sch_archive_parser.h.

◆ TextCodes

std::map<TEXTCODE_ID, TEXTCODE> CADSTAR_ARCHIVE_PARSER::CODEDEFS::TextCodes
inherited

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