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 }
wxString ReferenceName
This is the name which identifies the symbol in the library Multiple components may exist with the sa...
From CADSTAR Help: "A testpoint is an area of copper connected to a net.
std::map< COMP_AREA_ID, COMPONENT_AREA > ComponentAreas
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
From CADSTAR Help: "Jumpers are components used primarily for the purpose of routing.
XNODE * GetChildren() const
Definition: xnode.h:62
std::map< PAD_ID, COMPONENT_PAD > ComponentPads
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...
std::vector< COMPONENT_COPPER > ComponentCoppers
From CADSTAR Help: "Starpoints are special symbols/components that can be used to electrically connec...
Standard PCB Component definition.
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
long SymHeight
The Height of the component (3D height in z direction)
std::map< DIMENSION_ID, DIMENSION > Dimensions
inside "DIMENSIONS" subnode
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)

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 1594 of file cadstar_archive_parser.cpp.

1595 {
1596  wxASSERT( aNode->GetName() == wxT( "SYMDEF" ) );
1597 
1598  ID = GetXmlAttributeIDString( aNode, 0 );
1599  ReferenceName = GetXmlAttributeIDString( aNode, 1 );
1600  Alternate = GetXmlAttributeIDString( aNode, 2 );
1601 }
wxString ReferenceName
This is the name which identifies the symbol in the library Multiple components may exist with the sa...
wxString Alternate
This is in addition to ReferenceName.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

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

Definition at line 1604 of file cadstar_archive_parser.cpp.

1605 {
1606  wxString cNodeName = aChildNode->GetName();
1607 
1608  if( cNodeName == wxT( "PT" ) )
1609  {
1610  Origin.Parse( aChildNode, aContext );
1611  }
1612  else if( cNodeName == wxT( "STUB" ) )
1613  {
1614  Stub = true;
1615  }
1616  else if( cNodeName == wxT( "VERSION" ) )
1617  {
1618  Version = GetXmlAttributeIDLong( aChildNode, 0 );
1619  }
1620  else if( cNodeName == wxT( "FIGURE" ) )
1621  {
1622  FIGURE figure;
1623  figure.Parse( aChildNode, aContext );
1624  Figures.insert( std::make_pair( figure.ID, figure ) );
1625  }
1626  else if( cNodeName == wxT( "TEXT" ) )
1627  {
1628  TEXT txt;
1629  txt.Parse( aChildNode, aContext );
1630  Texts.insert( std::make_pair( txt.ID, txt ) );
1631  }
1632  else if( cNodeName == wxT( "TEXTLOC" ) )
1633  {
1634  TEXT_LOCATION textloc;
1635  textloc.Parse( aChildNode, aContext );
1636  TextLocations.insert( std::make_pair( textloc.AttributeID, textloc ) );
1637  }
1638  else if( cNodeName == wxT( "ATTR" ) )
1639  {
1640  ATTRIBUTE_VALUE attrVal;
1641  attrVal.Parse( aChildNode, aContext );
1642  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
1643  }
1644  else
1645  {
1646  return false;
1647  }
1648 
1649  return true;
1650 }
std::map< FIGURE_ID, FIGURE > Figures
bool Stub
When the CADSTAR Archive file is exported without the component library, if components on the board a...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
These attributes might also have a location.
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
long Version
Version is a sequential integer number to identify discrepancies between the library and the design.
std::map< ATTRIBUTE_ID, TEXT_LOCATION > TextLocations
This contains location of any attributes, including designator position.

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

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

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances().

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


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