KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT:

Public Member Functions

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

Public Attributes

NETSYNCH NetSynch = NETSYNCH::UNDEFINED
 
std::map< GROUP_ID, GROUPGroups
 
std::map< REUSEBLOCK_ID, REUSEBLOCKReuseBlocks
 
std::map< BOARD_ID, CADSTAR_BOARDBoards
 Normally CADSTAR only allows one board but. More...
 
std::map< FIGURE_ID, FIGUREFigures
 
std::map< AREA_ID, AREAAreas
 
std::map< COMPONENT_ID, COMPONENTComponents
 
std::map< DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOLDocumentationSymbols
 
std::map< TRUNK_ID, TRUNKTrunks
 
std::map< NET_ID, NET_PCBNets
 Contains tracks and vias. More...
 
std::map< TEMPLATE_ID, TEMPLATETemplates
 
std::map< COPPER_ID, COPPERCoppers
 
std::map< TEXT_ID, TEXTTexts
 
std::map< DIMENSION_ID, DIMENSIONDimensions
 
std::map< DRILL_TABLE_ID, DRILL_TABLEDrillTables
 
VARIANT_HIERARCHY VariantHierarchy
 

Detailed Description

Definition at line 1178 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
override

Definition at line 2471 of file cadstar_pcb_archive_parser.cpp.

2472 {
2473  wxASSERT( aNode->GetName() == wxT( "LAYOUT" ) );
2474 
2475  XNODE* cNode = aNode->GetChildren();
2476  bool netSynchParsed = false;
2477  bool dimensionsParsed = false;
2478 
2479  for( ; cNode; cNode = cNode->GetNext() )
2480  {
2481  wxString cNodeName = cNode->GetName();
2482 
2483  if( !netSynchParsed && cNodeName == wxT( "NETSYNCH" ) )
2484  {
2485  std::map<wxString, NETSYNCH> netSynchMap = { { wxT( "WARNING" ), NETSYNCH::WARNING },
2486  { wxT( "FULL" ), NETSYNCH::FULL } };
2487 
2488  wxString nsString = GetXmlAttributeIDString( cNode, 0 );
2489 
2490  if( netSynchMap.find( nsString ) == netSynchMap.end() )
2491  THROW_UNKNOWN_PARAMETER_IO_ERROR( nsString, aNode->GetName() );
2492 
2493  NetSynch = netSynchMap[nsString];
2494  netSynchParsed = true;
2495  }
2496  else if( cNodeName == wxT( "GROUP" ) )
2497  {
2498  GROUP group;
2499  group.Parse( cNode, aContext );
2500  Groups.insert( std::make_pair( group.ID, group ) );
2501  }
2502  else if( cNodeName == wxT( "REUSEBLOCK" ) )
2503  {
2504  REUSEBLOCK reuseblock;
2505  reuseblock.Parse( cNode, aContext );
2506  ReuseBlocks.insert( std::make_pair( reuseblock.ID, reuseblock ) );
2507  }
2508  else if( cNodeName == wxT( "BOARD" ) )
2509  {
2510  CADSTAR_BOARD board;
2511  board.Parse( cNode, aContext );
2512  Boards.insert( std::make_pair( board.ID, board ) );
2513  }
2514  else if( cNodeName == wxT( "FIGURE" ) )
2515  {
2516  FIGURE figure;
2517  figure.Parse( cNode, aContext );
2518  Figures.insert( std::make_pair( figure.ID, figure ) );
2519  }
2520  else if( cNodeName == wxT( "AREA" ) )
2521  {
2522  AREA area;
2523  area.Parse( cNode, aContext );
2524  Areas.insert( std::make_pair( area.ID, area ) );
2525  }
2526  else if( cNodeName == wxT( "COMP" ) )
2527  {
2528  COMPONENT comp;
2529  comp.Parse( cNode, aContext );
2530  Components.insert( std::make_pair( comp.ID, comp ) );
2531  }
2532  else if( cNodeName == wxT( "TRUNK" ) )
2533  {
2534  TRUNK trunk;
2535  trunk.Parse( cNode, aContext );
2536  Trunks.insert( std::make_pair( trunk.ID, trunk ) );
2537  }
2538  else if( cNodeName == wxT( "NET" ) )
2539  {
2540  NET_PCB net;
2541  net.Parse( cNode, aContext );
2542  Nets.insert( std::make_pair( net.ID, net ) );
2543  }
2544  else if( cNodeName == wxT( "TEMPLATE" ) )
2545  {
2546  TEMPLATE temp;
2547  temp.Parse( cNode, aContext );
2548  Templates.insert( std::make_pair( temp.ID, temp ) );
2549  }
2550  else if( cNodeName == wxT( "COPPER" ) )
2551  {
2552  COPPER copper;
2553  copper.Parse( cNode, aContext );
2554  Coppers.insert( std::make_pair( copper.ID, copper ) );
2555  }
2556  else if( cNodeName == wxT( "TEXT" ) )
2557  {
2558  TEXT txt;
2559  txt.Parse( cNode, aContext );
2560  Texts.insert( std::make_pair( txt.ID, txt ) );
2561  }
2562  else if( cNodeName == wxT( "DOCSYMBOL" ) )
2563  {
2564  DOCUMENTATION_SYMBOL docsym;
2565  docsym.Parse( cNode, aContext );
2566  DocumentationSymbols.insert( std::make_pair( docsym.ID, docsym ) );
2567  }
2568  else if( !dimensionsParsed && cNodeName == wxT( "DIMENSIONS" ) )
2569  {
2570  XNODE* dimensionNode = cNode->GetChildren();
2571 
2572  for( ; dimensionNode; dimensionNode = dimensionNode->GetNext() )
2573  {
2574  if( DIMENSION::IsDimension( dimensionNode ) )
2575  {
2576  DIMENSION dim;
2577  dim.Parse( dimensionNode, aContext );
2578  Dimensions.insert( std::make_pair( dim.ID, dim ) );
2579  }
2580  else
2581  {
2582  THROW_UNKNOWN_NODE_IO_ERROR( dimensionNode->GetName(), cNodeName );
2583  }
2584  }
2585 
2586  dimensionsParsed = true;
2587  }
2588  else if( cNodeName == wxT( "DRILLTABLE" ) )
2589  {
2590  DRILL_TABLE drilltable;
2591  drilltable.Parse( cNode, aContext );
2592  DrillTables.insert( std::make_pair( drilltable.ID, drilltable ) );
2593  }
2594  else if( cNodeName == wxT( "VHIERARCHY" ) )
2595  {
2596  VariantHierarchy.Parse( cNode, aContext );
2597  }
2598  else if( cNodeName == wxT( "ERRORMARK" ) )
2599  {
2600  //ignore (this is a DRC error marker in cadstar)
2601  continue;
2602  }
2603  else
2604  {
2605  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
2606  }
2607 
2608  aContext->CheckPointCallback();
2609  }
2610 }
std::map< DRILL_TABLE_ID, DRILL_TABLE > DrillTables
std::map< TEMPLATE_ID, TEMPLATE > Templates
std::map< NET_ID, NET_PCB > Nets
Contains tracks and vias.
XNODE * GetChildren() const
Definition: xnode.h:62
std::map< REUSEBLOCK_ID, REUSEBLOCK > ReuseBlocks
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:84
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
std::map< DIMENSION_ID, DIMENSION > Dimensions
std::map< DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOL > DocumentationSymbols
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
std::map< COMPONENT_ID, COMPONENT > Components
std::map< BOARD_ID, CADSTAR_BOARD > Boards
Normally CADSTAR only allows one board but.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)

References CADSTAR_ARCHIVE_PARSER::PARSER_CONTEXT::CheckPointCallback, CADSTAR_PCB_ARCHIVE_PARSER::FULL, XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), group, CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ID, CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::ID, CADSTAR_PCB_ARCHIVE_PARSER::AREA::ID, CADSTAR_ARCHIVE_PARSER::REUSEBLOCK::ID, CADSTAR_ARCHIVE_PARSER::FIGURE::ID, CADSTAR_ARCHIVE_PARSER::TEXT::ID, CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::ID, CADSTAR_PCB_ARCHIVE_PARSER::TRUNK::ID, CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::ID, CADSTAR_PCB_ARCHIVE_PARSER::COPPER::ID, CADSTAR_PCB_ARCHIVE_PARSER::DRILL_TABLE::ID, CADSTAR_ARCHIVE_PARSER::NET::ID, CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::ID, CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::IsDimension(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse(), CADSTAR_ARCHIVE_PARSER::REUSEBLOCK::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TRUNK::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DRILL_TABLE::Parse(), CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Parse(), THROW_UNKNOWN_NODE_IO_ERROR, THROW_UNKNOWN_PARAMETER_IO_ERROR, and CADSTAR_PCB_ARCHIVE_PARSER::WARNING.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::Parse().

Member Data Documentation

◆ Areas

std::map<AREA_ID, AREA> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Areas

◆ Boards

std::map<BOARD_ID, CADSTAR_BOARD> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Boards

Normally CADSTAR only allows one board but.

implemented this as a map just in case

Definition at line 1185 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadBoards(), and CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates().

◆ Components

std::map<COMPONENT_ID, COMPONENT> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Components

◆ Coppers

std::map<COPPER_ID, COPPER> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Coppers

◆ Dimensions

std::map<DIMENSION_ID, DIMENSION> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Dimensions

◆ DocumentationSymbols

std::map<DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOL> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::DocumentationSymbols

◆ DrillTables

std::map<DRILL_TABLE_ID, DRILL_TABLE> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::DrillTables

Definition at line 1197 of file cadstar_pcb_archive_parser.h.

◆ Figures

std::map<FIGURE_ID, FIGURE> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Figures

◆ Groups

std::map<GROUP_ID, GROUP> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Groups

◆ Nets

std::map<NET_ID, NET_PCB> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Nets

◆ NetSynch

NETSYNCH CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::NetSynch = NETSYNCH::UNDEFINED

Definition at line 1180 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::Load().

◆ ReuseBlocks

std::map<REUSEBLOCK_ID, REUSEBLOCK> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::ReuseBlocks

Definition at line 1183 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::Load().

◆ Templates

◆ Texts

std::map<TEXT_ID, TEXT> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Texts

◆ Trunks

std::map<TRUNK_ID, TRUNK> CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Trunks

Definition at line 1191 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::Load().

◆ VariantHierarchy

VARIANT_HIERARCHY CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::VariantHierarchy

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