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

1501 {
1502  wxASSERT( aNode->GetName() == wxT( "SYMDEF" ) );
1503 
1504  ParseIdentifiers( aNode, aContext );
1505 
1506  wxString rest;
1507 
1508  if( ReferenceName.StartsWith( wxT( "JUMPERNF" ), &rest ) )
1510  else if( ReferenceName.StartsWith( wxT( "STARPOINTNF" ), &rest ) )
1512  else if( ReferenceName == wxT( "TESTPOINT" ) )
1514  else
1516 
1517  XNODE* cNode = aNode->GetChildren();
1518 
1519  for( ; cNode; cNode = cNode->GetNext() )
1520  {
1521  wxString cNodeName = cNode->GetName();
1522 
1523  if( ParseSubNode( cNode, aContext ) )
1524  {
1525  continue;
1526  }
1527  else if( cNodeName == wxT( "SYMHEIGHT" ) )
1528  {
1529  SymHeight = GetXmlAttributeIDLong( cNode, 0 );
1530  }
1531  else if( cNodeName == wxT( "COMPCOPPER" ) )
1532  {
1533  COMPONENT_COPPER compcopper;
1534  compcopper.Parse( cNode, aContext );
1535  ComponentCoppers.push_back( compcopper );
1536  }
1537  else if( cNodeName == wxT( "COMPAREA" ) )
1538  {
1539  COMPONENT_AREA area;
1540  area.Parse( cNode, aContext );
1541  ComponentAreas.insert( std::make_pair( area.ID, area ) );
1542  }
1543  else if( cNodeName == wxT( "PAD" ) )
1544  {
1545  COMPONENT_PAD pad;
1546  pad.Parse( cNode, aContext );
1547  ComponentPads.insert( std::make_pair( pad.ID, pad ) );
1548  }
1549  else if( cNodeName == wxT( "DIMENSIONS" ) )
1550  {
1551  XNODE* dimensionNode = cNode->GetChildren();
1552 
1553  for( ; dimensionNode; dimensionNode = dimensionNode->GetNext() )
1554  {
1555  if( DIMENSION::IsDimension( dimensionNode ) )
1556  {
1557  DIMENSION dim;
1558  dim.Parse( dimensionNode, aContext );
1559  Dimensions.insert( std::make_pair( dim.ID, dim ) );
1560  }
1561  else
1562  {
1563  THROW_UNKNOWN_NODE_IO_ERROR( dimensionNode->GetName(), cNodeName );
1564  }
1565  }
1566  }
1567  else
1568  {
1569  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
1570  }
1571  }
1572 
1573  if( !Stub && !Origin.IsFullySpecified() )
1574  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
1575 }
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 1590 of file cadstar_archive_parser.cpp.

1591 {
1592  wxASSERT( aNode->GetName() == wxT( "SYMDEF" ) );
1593 
1594  ID = GetXmlAttributeIDString( aNode, 0 );
1595  ReferenceName = GetXmlAttributeIDString( aNode, 1 );
1596  Alternate = GetXmlAttributeIDString( aNode, 2 );
1597 }
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 1600 of file cadstar_archive_parser.cpp.

1601 {
1602  wxString cNodeName = aChildNode->GetName();
1603 
1604  if( cNodeName == wxT( "PT" ) )
1605  {
1606  Origin.Parse( aChildNode, aContext );
1607  }
1608  else if( cNodeName == wxT( "STUB" ) )
1609  {
1610  Stub = true;
1611  }
1612  else if( cNodeName == wxT( "VERSION" ) )
1613  {
1614  Version = GetXmlAttributeIDLong( aChildNode, 0 );
1615  }
1616  else if( cNodeName == wxT( "FIGURE" ) )
1617  {
1618  FIGURE figure;
1619  figure.Parse( aChildNode, aContext );
1620  Figures.insert( std::make_pair( figure.ID, figure ) );
1621  }
1622  else if( cNodeName == wxT( "TEXT" ) )
1623  {
1624  TEXT txt;
1625  txt.Parse( aChildNode, aContext );
1626  Texts.insert( std::make_pair( txt.ID, txt ) );
1627  }
1628  else if( cNodeName == wxT( "TEXTLOC" ) )
1629  {
1630  TEXT_LOCATION textloc;
1631  textloc.Parse( aChildNode, aContext );
1632  TextLocations.insert( std::make_pair( textloc.AttributeID, textloc ) );
1633  }
1634  else if( cNodeName == wxT( "ATTR" ) )
1635  {
1636  ATTRIBUTE_VALUE attrVal;
1637  attrVal.Parse( aChildNode, aContext );
1638  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
1639  }
1640  else
1641  {
1642  return false;
1643  }
1644 
1645  return true;
1646 }
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 919 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 905 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 916 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances().

◆ Texts

std::map<TEXT_ID, TEXT> CADSTAR_ARCHIVE_PARSER::SYMDEF::Texts
inherited

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


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