KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM:
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

std::map< TERMINAL_ID, TERMINALTerminals
 
std::map< TERMINAL_ID, PIN_NUM_LABEL_LOCPinLabelLocations
 
std::map< TERMINAL_ID, PIN_NUM_LABEL_LOCPinNumberLocations
 
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 149 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 379 of file cadstar_sch_archive_parser.cpp.

380 {
381  wxCHECK( aNode->GetName() == wxT( "SYMDEF" ), );
382 
383  ParseIdentifiers( aNode, aContext );
384 
385  XNODE* cNode = aNode->GetChildren();
386 
387  for( ; cNode; cNode = cNode->GetNext() )
388  {
389  wxString cNodeName = cNode->GetName();
390 
391  if( ParseSubNode( cNode, aContext ) )
392  {
393  continue;
394  }
395  else if( cNodeName == wxT( "TERMINAL" ) )
396  {
397  TERMINAL term;
398  term.Parse( cNode, aContext );
399  Terminals.insert( std::make_pair( term.ID, term ) );
400  }
401  else if( cNodeName == wxT( "PINLABELLOC" ) )
402  {
403  PIN_NUM_LABEL_LOC loc;
404  loc.Parse( cNode, aContext );
405  PinLabelLocations.insert( std::make_pair( loc.TerminalID, loc ) );
406  }
407  else if( cNodeName == wxT( "PINNUMNAMELOC" ) )
408  {
409  PIN_NUM_LABEL_LOC loc;
410  loc.Parse( cNode, aContext );
411  PinNumberLocations.insert( std::make_pair( loc.TerminalID, loc ) );
412  }
413  else
414  {
415  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
416  }
417  }
418 
419  if( !Stub && !Origin.IsFullySpecified() )
420  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
421 }
std::map< TERMINAL_ID, TERMINAL > Terminals
std::map< TERMINAL_ID, PIN_NUM_LABEL_LOC > PinLabelLocations
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
std::map< TERMINAL_ID, PIN_NUM_LABEL_LOC > PinNumberLocations
XNODE * GetChildren() const
Definition: xnode.h:62
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...
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::ID, CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::PIN_NUM_LABEL_LOC::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::PIN_NUM_LABEL_LOC::TerminalID, THROW_MISSING_PARAMETER_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::LIBRARY_SCM::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.

◆ Figures

◆ ID

◆ Origin

POINT CADSTAR_ARCHIVE_PARSER::SYMDEF::Origin
inherited

◆ PinLabelLocations

std::map<TERMINAL_ID, PIN_NUM_LABEL_LOC> CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM::PinLabelLocations

Definition at line 152 of file cadstar_sch_archive_parser.h.

◆ PinNumberLocations

std::map<TERMINAL_ID, PIN_NUM_LABEL_LOC> CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM::PinNumberLocations

Definition at line 153 of file cadstar_sch_archive_parser.h.

◆ 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.

◆ Terminals

std::map<TERMINAL_ID, TERMINAL> CADSTAR_SCH_ARCHIVE_PARSER::SYMDEF_SCM::Terminals

◆ 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

◆ 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: