KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB:
CADSTAR_ARCHIVE_PARSER::SYMDEF CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

SYMDEF_TYPE Type = SYMDEF_TYPE::COMPONENT
 
long SymHeight = 0
 The Height of the component (3D height in z direction) More...
 
std::vector< COMPONENT_COPPERComponentCoppers
 
std::map< COMP_AREA_ID, COMPONENT_AREAComponentAreas
 
std::map< PAD_ID, COMPONENT_PADComponentPads
 
std::map< DIMENSION_ID, DIMENSIONDimensions
 inside "DIMENSIONS" subnode More...
 
SYMDEF_ID ID
 
wxString ReferenceName
 This is the name which identifies the symbol in the library Multiple components may exist with the same ReferenceName. More...
 
wxString Alternate
 This is in addition to ReferenceName. More...
 
POINT Origin
 Origin of the component (this is used as the reference point when placing the component in the design) More...
 
bool Stub = false
 When the CADSTAR Archive file is exported without the component library, if components on the board are still exported, the Reference and Alternate names will still be exported but the content is replaced with a "STUB" atom, requiring access to the original library for component definition. More...
 
long Version = UNDEFINED_VALUE
 Version is a sequential integer number to identify discrepancies between the library and the design. More...
 
std::map< FIGURE_ID, FIGUREFigures
 
std::map< TEXT_ID, TEXTTexts
 
std::map< ATTRIBUTE_ID, TEXT_LOCATIONTextLocations
 This contains location of any attributes, including designator position. More...
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 These attributes might also have a location. More...
 

Detailed Description

Definition at line 774 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1526 of file cadstar_pcb_archive_parser.cpp.

1527{
1528 wxASSERT( aNode->GetName() == wxT( "SYMDEF" ) );
1529
1530 ParseIdentifiers( aNode, aContext );
1531
1532 wxString rest;
1533
1534 if( ReferenceName.StartsWith( wxT( "JUMPERNF" ), &rest ) )
1536 else if( ReferenceName.StartsWith( wxT( "STARPOINTNF" ), &rest ) )
1538 else if( ReferenceName == wxT( "TESTPOINT" ) )
1540 else
1542
1543 XNODE* cNode = aNode->GetChildren();
1544
1545 for( ; cNode; cNode = cNode->GetNext() )
1546 {
1547 wxString cNodeName = cNode->GetName();
1548
1549 if( ParseSubNode( cNode, aContext ) )
1550 {
1551 continue;
1552 }
1553 else if( cNodeName == wxT( "SYMHEIGHT" ) )
1554 {
1555 SymHeight = GetXmlAttributeIDLong( cNode, 0 );
1556 }
1557 else if( cNodeName == wxT( "COMPCOPPER" ) )
1558 {
1559 COMPONENT_COPPER compcopper;
1560 compcopper.Parse( cNode, aContext );
1561 ComponentCoppers.push_back( compcopper );
1562 }
1563 else if( cNodeName == wxT( "COMPAREA" ) )
1564 {
1565 COMPONENT_AREA area;
1566 area.Parse( cNode, aContext );
1567 ComponentAreas.insert( std::make_pair( area.ID, area ) );
1568 }
1569 else if( cNodeName == wxT( "PAD" ) )
1570 {
1571 COMPONENT_PAD pad;
1572 pad.Parse( cNode, aContext );
1573 ComponentPads.insert( std::make_pair( pad.ID, pad ) );
1574 }
1575 else if( cNodeName == wxT( "DIMENSIONS" ) )
1576 {
1577 XNODE* dimensionNode = cNode->GetChildren();
1578
1579 for( ; dimensionNode; dimensionNode = dimensionNode->GetNext() )
1580 {
1581 if( DIMENSION::IsDimension( dimensionNode ) )
1582 {
1583 DIMENSION dim;
1584 dim.Parse( dimensionNode, aContext );
1585 Dimensions.insert( std::make_pair( dim.ID, dim ) );
1586 }
1587 else
1588 {
1589 THROW_UNKNOWN_NODE_IO_ERROR( dimensionNode->GetName(), cNodeName );
1590 }
1591 }
1592 }
1593 else
1594 {
1595 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
1596 }
1597 }
1598
1599 if( !Stub && !Origin.IsFullySpecified() )
1600 THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
1601}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
@ STARPOINT
From CADSTAR Help: "Starpoints are special symbols/components that can be used to electrically connec...
@ JUMPER
From CADSTAR Help: "Jumpers are components used primarily for the purpose of routing.
@ COMPONENT
Standard PCB Component definition.
@ TESTPOINT
From CADSTAR Help: "A testpoint is an area of copper connected to a net.
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
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
bool Stub
When the CADSTAR Archive file is exported without the component library, if components on the board a...
wxString ReferenceName
This is the name which identifies the symbol in the library Multiple components may exist with the sa...
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
std::map< PAD_ID, COMPONENT_PAD > ComponentPads
std::map< DIMENSION_ID, DIMENSION > Dimensions
inside "DIMENSIONS" subnode
std::vector< COMPONENT_COPPER > ComponentCoppers
long SymHeight
The Height of the component (3D height in z direction)
std::map< COMP_AREA_ID, COMPONENT_AREA > ComponentAreas

References CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT, XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::ID, CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ID, CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::IsDimension(), CADSTAR_PCB_ARCHIVE_PARSER::JUMPER, pad, CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_COPPER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::STARPOINT, CADSTAR_PCB_ARCHIVE_PARSER::TESTPOINT, THROW_MISSING_PARAMETER_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

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

◆ ParseIdentifiers()

void CADSTAR_ARCHIVE_PARSER::SYMDEF::ParseIdentifiers ( XNODE aNode,
PARSER_CONTEXT aContext 
)
inherited

Definition at line 1690 of file cadstar_archive_parser.cpp.

1691{
1692 wxASSERT( aNode->GetName() == wxT( "SYMDEF" ) );
1693
1694 ID = GetXmlAttributeIDString( aNode, 0 );
1696 Alternate = GetXmlAttributeIDString( aNode, 2 );
1697}
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
wxString Alternate
This is in addition to ReferenceName.

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

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

Definition at line 1700 of file cadstar_archive_parser.cpp.

1701{
1702 wxString cNodeName = aChildNode->GetName();
1703
1704 if( cNodeName == wxT( "PT" ) )
1705 {
1706 Origin.Parse( aChildNode, aContext );
1707 }
1708 else if( cNodeName == wxT( "STUB" ) )
1709 {
1710 Stub = true;
1711 }
1712 else if( cNodeName == wxT( "VERSION" ) )
1713 {
1714 Version = GetXmlAttributeIDLong( aChildNode, 0 );
1715 }
1716 else if( cNodeName == wxT( "FIGURE" ) )
1717 {
1718 FIGURE figure;
1719 figure.Parse( aChildNode, aContext );
1720 Figures.insert( std::make_pair( figure.ID, figure ) );
1721 }
1722 else if( cNodeName == wxT( "TEXT" ) )
1723 {
1724 TEXT txt;
1725 txt.Parse( aChildNode, aContext );
1726 Texts.insert( std::make_pair( txt.ID, txt ) );
1727 }
1728 else if( cNodeName == wxT( "TEXTLOC" ) )
1729 {
1730 TEXT_LOCATION textloc;
1731 textloc.Parse( aChildNode, aContext );
1732 TextLocations.insert( std::make_pair( textloc.AttributeID, textloc ) );
1733 }
1734 else if( cNodeName == wxT( "ATTR" ) )
1735 {
1736 ATTRIBUTE_VALUE attrVal;
1737 attrVal.Parse( aChildNode, aContext );
1738 AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
1739 }
1740 else
1741 {
1742 return false;
1743 }
1744
1745 return true;
1746}
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< FIGURE_ID, FIGURE > Figures
std::map< ATTRIBUTE_ID, TEXT_LOCATION > TextLocations
This contains location of any attributes, including designator position.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
These attributes might also have a location.
long Version
Version is a sequential integer number to identify discrepancies between the library and the design.

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::AttributeID, CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::FIGURE::ID, CADSTAR_ARCHIVE_PARSER::TEXT::ID, CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), and CADSTAR_ARCHIVE_PARSER::TEXT::Parse().

Member Data Documentation

◆ Alternate

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_ARCHIVE_PARSER::SYMDEF::AttributeValues
inherited

These attributes might also have a location.

Definition at line 954 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ ComponentAreas

std::map<COMP_AREA_ID, COMPONENT_AREA> CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB::ComponentAreas

◆ ComponentCoppers

std::vector<COMPONENT_COPPER> CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB::ComponentCoppers

◆ ComponentPads

◆ Dimensions

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

inside "DIMENSIONS" subnode

Definition at line 782 of file cadstar_pcb_archive_parser.h.

◆ Figures

◆ ID

◆ Origin

POINT CADSTAR_ARCHIVE_PARSER::SYMDEF::Origin
inherited

◆ ReferenceName

wxString CADSTAR_ARCHIVE_PARSER::SYMDEF::ReferenceName
inherited

◆ Stub

bool CADSTAR_ARCHIVE_PARSER::SYMDEF::Stub = false
inherited

When the CADSTAR Archive file is exported without the component library, if components on the board are still exported, the Reference and Alternate names will still be exported but the content is replaced with a "STUB" atom, requiring access to the original library for component definition.

Definition at line 940 of file cadstar_archive_parser.h.

◆ SymHeight

long CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB::SymHeight = 0

The Height of the component (3D height in z direction)

Definition at line 777 of file cadstar_pcb_archive_parser.h.

◆ TextLocations

std::map<ATTRIBUTE_ID, TEXT_LOCATION> CADSTAR_ARCHIVE_PARSER::SYMDEF::TextLocations
inherited

This contains location of any attributes, including designator position.

Definition at line 951 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ Texts

◆ Type

SYMDEF_TYPE CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB::Type = SYMDEF_TYPE::COMPONENT

Definition at line 776 of file cadstar_pcb_archive_parser.h.

◆ Version

long CADSTAR_ARCHIVE_PARSER::SYMDEF::Version = UNDEFINED_VALUE
inherited

Version is a sequential integer number to identify discrepancies between the library and the design.

Definition at line 946 of file cadstar_archive_parser.h.


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