KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB:
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< COPPERCODE_ID, COPPERCODECopperCodes
 
std::map< SPACINGCODE_ID, SPACINGCODESpacingCodes
 Spacing Design Rules. More...
 
std::map< RULESET_ID, RULESETRulesets
 Used for area design rules. More...
 
std::map< PADCODE_ID, PADCODEPadCodes
 
std::map< VIACODE_ID, VIACODEViaCodes
 
std::map< LAYERPAIR_ID, LAYERPAIRLayerPairs
 Default vias to use between pairs of layers. More...
 
std::vector< SPCCLASSSPACESpacingClasses
 
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 384 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 232 of file cadstar_pcb_archive_parser.cpp.

233 {
234  wxASSERT( aNode->GetName() == wxT( "CODEDEFS" ) );
235 
236  XNODE* cNode = aNode->GetChildren();
237 
238  for( ; cNode; cNode = cNode->GetNext() )
239  {
240  wxString nodeName = cNode->GetName();
241 
242  if( ParseSubNode( cNode, aContext ) ) // in CADSTAR_ARCHIVE_PARSER::CODEDEFS
243  {
244  }
245  else if( nodeName == wxT( "COPPERCODE" ) )
246  {
247  COPPERCODE coppercode;
248  coppercode.Parse( cNode, aContext );
249  CopperCodes.insert( std::make_pair( coppercode.ID, coppercode ) );
250  }
251  else if( nodeName == wxT( "SPACINGCODE" ) )
252  {
253  SPACINGCODE spacingcode;
254  spacingcode.Parse( cNode, aContext );
255  SpacingCodes.insert( std::make_pair( spacingcode.ID, spacingcode ) );
256  }
257  else if( nodeName == wxT( "RULESET" ) )
258  {
259  RULESET ruleset;
260  ruleset.Parse( cNode, aContext );
261  Rulesets.insert( std::make_pair( ruleset.ID, ruleset ) );
262  }
263  else if( nodeName == wxT( "PADCODE" ) )
264  {
265  PADCODE padcode;
266  padcode.Parse( cNode, aContext );
267  PadCodes.insert( std::make_pair( padcode.ID, padcode ) );
268  }
269  else if( nodeName == wxT( "VIACODE" ) )
270  {
271  VIACODE viacode;
272  viacode.Parse( cNode, aContext );
273  ViaCodes.insert( std::make_pair( viacode.ID, viacode ) );
274  }
275  else if( nodeName == wxT( "LAYERPAIR" ) )
276  {
277  LAYERPAIR layerpair;
278  layerpair.Parse( cNode, aContext );
279  LayerPairs.insert( std::make_pair( layerpair.ID, layerpair ) );
280  }
281  else if( nodeName == wxT( "SPCCLASSSPACE" ) )
282  {
283  SPCCLASSSPACE spcclassspace;
284  spcclassspace.Parse( cNode, aContext );
285  SpacingClasses.push_back( spcclassspace );
286  }
287  else
288  {
289  THROW_UNKNOWN_NODE_IO_ERROR( nodeName, aNode->GetName() );
290  }
291  }
292 }
std::map< RULESET_ID, RULESET > Rulesets
Used for area design rules.
std::map< COPPERCODE_ID, COPPERCODE > CopperCodes
std::map< LAYERPAIR_ID, LAYERPAIR > LayerPairs
Default vias to use between pairs of layers.
XNODE * GetChildren() const
Definition: xnode.h:62
Hold an XML or S-expression element.
Definition: xnode.h:43
std::map< SPACINGCODE_ID, SPACINGCODE > SpacingCodes
Spacing Design Rules.
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)

References XNODE::GetChildren(), CADSTAR_PCB_ARCHIVE_PARSER::COPPERCODE::ID, CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::ID, CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::ID, CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::ID, CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::ID, CADSTAR_PCB_ARCHIVE_PARSER::RULESET::ID, CADSTAR_PCB_ARCHIVE_PARSER::COPPERCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPCCLASSSPACE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::RULESET::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::ASSIGNMENTS::Parse().

◆ 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

◆ CopperCodes

std::map<COPPERCODE_ID, COPPERCODE> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::CopperCodes

◆ 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().

◆ LayerPairs

std::map<LAYERPAIR_ID, LAYERPAIR> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::LayerPairs

Default vias to use between pairs of layers.

Definition at line 392 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getLayerPair().

◆ LineCodes

◆ NetClasses

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

Definition at line 784 of file cadstar_archive_parser.h.

◆ PadCodes

std::map<PADCODE_ID, PADCODE> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::PadCodes

◆ RouteCodes

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

◆ Rulesets

std::map<RULESET_ID, RULESET> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::Rulesets

Used for area design rules.

Definition at line 388 of file cadstar_pcb_archive_parser.h.

◆ SpacingClasses

std::vector<SPCCLASSSPACE> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::SpacingClasses

Definition at line 393 of file cadstar_pcb_archive_parser.h.

◆ SpacingClassNames

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

Definition at line 785 of file cadstar_archive_parser.h.

◆ SpacingCodes

std::map<SPACINGCODE_ID, SPACINGCODE> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::SpacingCodes

◆ TextCodes

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

◆ ViaCodes

std::map<VIACODE_ID, VIACODE> CADSTAR_PCB_ARCHIVE_PARSER::CODEDEFS_PCB::ViaCodes

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