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 250 of file cadstar_pcb_archive_parser.cpp.

251 {
252  wxASSERT( aNode->GetName() == wxT( "CODEDEFS" ) );
253 
254  XNODE* cNode = aNode->GetChildren();
255 
256  for( ; cNode; cNode = cNode->GetNext() )
257  {
258  wxString nodeName = cNode->GetName();
259 
260  if( ParseSubNode( cNode, aContext ) ) // in CADSTAR_ARCHIVE_PARSER::CODEDEFS
261  {
262  }
263  else if( nodeName == wxT( "COPPERCODE" ) )
264  {
265  COPPERCODE coppercode;
266  coppercode.Parse( cNode, aContext );
267  CopperCodes.insert( std::make_pair( coppercode.ID, coppercode ) );
268  }
269  else if( nodeName == wxT( "SPACINGCODE" ) )
270  {
271  SPACINGCODE spacingcode;
272  spacingcode.Parse( cNode, aContext );
273  SpacingCodes.insert( std::make_pair( spacingcode.ID, spacingcode ) );
274  }
275  else if( nodeName == wxT( "RULESET" ) )
276  {
277  RULESET ruleset;
278  ruleset.Parse( cNode, aContext );
279  Rulesets.insert( std::make_pair( ruleset.ID, ruleset ) );
280  }
281  else if( nodeName == wxT( "PADCODE" ) )
282  {
283  PADCODE padcode;
284  padcode.Parse( cNode, aContext );
285  PadCodes.insert( std::make_pair( padcode.ID, padcode ) );
286  }
287  else if( nodeName == wxT( "VIACODE" ) )
288  {
289  VIACODE viacode;
290  viacode.Parse( cNode, aContext );
291  ViaCodes.insert( std::make_pair( viacode.ID, viacode ) );
292  }
293  else if( nodeName == wxT( "LAYERPAIR" ) )
294  {
295  LAYERPAIR layerpair;
296  layerpair.Parse( cNode, aContext );
297  LayerPairs.insert( std::make_pair( layerpair.ID, layerpair ) );
298  }
299  else if( nodeName == wxT( "SPCCLASSSPACE" ) )
300  {
301  SPCCLASSSPACE spcclassspace;
302  spcclassspace.Parse( cNode, aContext );
303  SpacingClasses.push_back( spcclassspace );
304  }
305  else
306  {
307  THROW_UNKNOWN_NODE_IO_ERROR( nodeName, aNode->GetName() );
308  }
309  }
310 }
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 1345 of file cadstar_archive_parser.cpp.

1346 {
1347  wxString nodeName = aChildNode->GetName();
1348 
1349  if( nodeName == wxT( "LINECODE" ) )
1350  {
1351  LINECODE linecode;
1352  linecode.Parse( aChildNode, aContext );
1353  LineCodes.insert( std::make_pair( linecode.ID, linecode ) );
1354  }
1355  else if( nodeName == wxT( "HATCHCODE" ) )
1356  {
1357  HATCHCODE hatchcode;
1358  hatchcode.Parse( aChildNode, aContext );
1359  HatchCodes.insert( std::make_pair( hatchcode.ID, hatchcode ) );
1360  }
1361  else if( nodeName == wxT( "TEXTCODE" ) )
1362  {
1363  TEXTCODE textcode;
1364  textcode.Parse( aChildNode, aContext );
1365  TextCodes.insert( std::make_pair( textcode.ID, textcode ) );
1366  }
1367  else if( nodeName == wxT( "ROUTECODE" ) )
1368  {
1369  ROUTECODE routecode;
1370  routecode.Parse( aChildNode, aContext );
1371  RouteCodes.insert( std::make_pair( routecode.ID, routecode ) );
1372  }
1373  else if( nodeName == wxT( "ATTRNAME" ) )
1374  {
1375  ATTRNAME attrname;
1376  attrname.Parse( aChildNode, aContext );
1377  AttributeNames.insert( std::make_pair( attrname.ID, attrname ) );
1378  }
1379  else if( nodeName == wxT( "NETCLASS" ) )
1380  {
1381  CADSTAR_NETCLASS netclass;
1382  netclass.Parse( aChildNode, aContext );
1383  NetClasses.insert( std::make_pair( netclass.ID, netclass ) );
1384  }
1385  else if( nodeName == wxT( "SPCCLASSNAME" ) )
1386  {
1387  SPCCLASSNAME spcclassname;
1388  spcclassname.Parse( aChildNode, aContext );
1389  SpacingClassNames.insert( std::make_pair( spcclassname.ID, spcclassname ) );
1390  }
1391  else
1392  {
1393  return false;
1394  }
1395 
1396  return true;
1397 }
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 790 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 794 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().

◆ 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 795 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().

◆ 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: