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:
CADSTAR_ARCHIVE_PARSER::PARSER

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 1182 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2495 of file cadstar_pcb_archive_parser.cpp.

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

References CADSTAR_ARCHIVE_PARSER::PARSER_CONTEXT::CheckPointCallback, CADSTAR_PCB_ARCHIVE_PARSER::FULL, XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), group, CADSTAR_ARCHIVE_PARSER::REUSEBLOCK::ID, CADSTAR_ARCHIVE_PARSER::FIGURE::ID, CADSTAR_ARCHIVE_PARSER::TEXT::ID, CADSTAR_ARCHIVE_PARSER::NET::ID, CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::ID, CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ID, CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::ID, CADSTAR_PCB_ARCHIVE_PARSER::AREA::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_PCB_ARCHIVE_PARSER::DIMENSION::IsDimension(), CADSTAR_ARCHIVE_PARSER::REUSEBLOCK::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT::Parse(), CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::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(), 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 1189 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 1201 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 1184 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 1187 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 1195 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: