KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

COMPONENT_ID ID
 
wxString Name
 Designator e.g. "C1", "R1", etc. More...
 
PART_ID PartID
 
SYMDEF_ID SymdefID
 
POINT Origin
 Origin of the component (this is used as the reference point when placing the component in the design) More...
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this component is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
COMPONENT_ID VariantParentComponentID = wxEmptyString
 
VARIANT_ID VariantID = wxEmptyString
 
long OrientAngle = 0
 
bool TestPoint = false
 Indicates whether this component should be treated as a testpoint. More...
 
bool Mirror = false
 
bool Fixed = false
 
READABILITY Readability = READABILITY::BOTTOM_TO_TOP
 
std::map< ATTRIBUTE_ID, TEXT_LOCATION > TextLocations
 This contains location of any attributes, including designator position. More...
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
 
std::map< PART_DEFINITION_PIN_ID, wxString > PinLabels
 This is inherited from the PARTS library but is allowed to be out of sync. More...
 
std::map< PART_DEFINITION_PIN_ID, PIN_ATTRIBUTEPinAttributes
 
std::map< PAD_ID, PADEXCEPTIONPadExceptions
 Override pad definitions for this instance. More...
 

Detailed Description

Definition at line 893 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1800 of file cadstar_pcb_archive_parser.cpp.

1801 {
1802  wxASSERT( aNode->GetName() == wxT( "COMP" ) );
1803 
1804  ID = GetXmlAttributeIDString( aNode, 0 );
1805  Name = GetXmlAttributeIDString( aNode, 1 );
1806  PartID = GetXmlAttributeIDString( aNode, 2 );
1807  SymdefID = GetXmlAttributeIDString( aNode, 3 );
1808 
1809  XNODE* cNode = aNode->GetChildren();
1810  bool originParsed = false;
1811 
1812  for( ; cNode; cNode = cNode->GetNext() )
1813  {
1814  wxString cNodeName = cNode->GetName();
1815 
1816  if( !originParsed && cNodeName == wxT( "PT" ) )
1817  {
1818  Origin.Parse( cNode, aContext );
1819  originParsed = true;
1820  }
1821  else if( cNodeName == wxT( "GROUPREF" ) )
1822  {
1823  GroupID = GetXmlAttributeIDString( cNode, 0 );
1824  }
1825  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
1826  {
1827  ReuseBlockRef.Parse( cNode, aContext );
1828  }
1829  else if( cNodeName == wxT( "TESTPOINT" ) )
1830  {
1831  TestPoint = true;
1832  }
1833  else if( cNodeName == wxT( "FIX" ) )
1834  {
1835  Fixed = true;
1836  }
1837  else if( cNodeName == wxT( "MIRROR" ) )
1838  {
1839  Mirror = true;
1840  }
1841  else if( cNodeName == wxT( "READABILITY" ) )
1842  {
1843  Readability = ParseReadability( cNode );
1844  }
1845  else if( cNodeName == wxT( "ORIENT" ) )
1846  {
1847  OrientAngle = GetXmlAttributeIDLong( cNode, 0 );
1848  }
1849  else if( cNodeName == wxT( "VCOMPMASTER" ) )
1850  {
1852  VariantID = GetXmlAttributeIDString( cNode, 1 );
1853  }
1854  else if( cNodeName == wxT( "TEXTLOC" ) )
1855  {
1856  TEXT_LOCATION textloc;
1857  textloc.Parse( cNode, aContext );
1858  TextLocations.insert( std::make_pair( textloc.AttributeID, textloc ) );
1859  }
1860  else if( cNodeName == wxT( "ATTR" ) )
1861  {
1862  ATTRIBUTE_VALUE attrVal;
1863  attrVal.Parse( cNode, aContext );
1864  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
1865  }
1866  else if( cNodeName == wxT( "PINATTR" ) )
1867  {
1868  PIN_ATTRIBUTE pinAttr;
1869  pinAttr.Parse( cNode, aContext );
1870  PinAttributes.insert( std::make_pair( pinAttr.Pin, pinAttr ) );
1871  }
1872  else if( cNodeName == wxT( "COMPPINLABEL" ) )
1873  {
1874  PART_DEFINITION_PIN_ID pinID = GetXmlAttributeIDLong( cNode, 0 );
1875  wxString pinLabel = GetXmlAttributeIDString( cNode, 1 );
1876  PinLabels.insert( std::make_pair( pinID, pinLabel ) );
1877  }
1878  else if( cNodeName == wxT( "PADEXCEPTION" ) )
1879  {
1880  PADEXCEPTION padExcept;
1881  padExcept.Parse( cNode, aContext );
1882  PadExceptions.insert( std::make_pair( padExcept.ID, padExcept ) );
1883  }
1884  else
1885  {
1886  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
1887  }
1888  }
1889 
1890  if( !originParsed )
1891  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
1892 }
long PART_DEFINITION_PIN_ID
Pin identifier in the part definition.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool TestPoint
Indicates whether this component should be treated as a testpoint.
std::map< PART_DEFINITION_PIN_ID, wxString > PinLabels
This is inherited from the PARTS library but is allowed to be out of sync.
std::map< PART_DEFINITION_PIN_ID, PIN_ATTRIBUTE > PinAttributes
wxString Name
Designator e.g. "C1", "R1", etc.
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
XNODE * GetChildren() const
Definition: xnode.h:62
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
std::map< PAD_ID, PADEXCEPTION > PadExceptions
Override pad definitions for this instance.
XNODE * GetNext() const
Definition: xnode.h:67
static READABILITY ParseReadability(XNODE *aNode)
GROUP_ID GroupID
If not empty, this component is part of a group.
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
std::map< ATTRIBUTE_ID, TEXT_LOCATION > TextLocations
This contains location of any attributes, including designator position.
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_PCB_ARCHIVE_PARSER::PADEXCEPTION::ID, CADSTAR_PCB_ARCHIVE_PARSER::PIN_ATTRIBUTE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADEXCEPTION::Parse(), CADSTAR_ARCHIVE_PARSER::ParseReadability(), CADSTAR_PCB_ARCHIVE_PARSER::PIN_ATTRIBUTE::Pin, THROW_MISSING_PARAMETER_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

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

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::AttributeValues

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Fixed = false

Definition at line 910 of file cadstar_pcb_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::GroupID = wxEmptyString

If not empty, this component is part of a group.

Definition at line 902 of file cadstar_pcb_archive_parser.h.

◆ ID

COMPONENT_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::ID

◆ Mirror

bool CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Mirror = false

◆ Name

wxString CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Name

Designator e.g. "C1", "R1", etc.

Definition at line 896 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadComponents().

◆ OrientAngle

long CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::OrientAngle = 0

◆ Origin

POINT CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Origin

Origin of the component (this is used as the reference point when placing the component in the design)

Definition at line 899 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadComponents().

◆ PadExceptions

std::map<PAD_ID, PADEXCEPTION> CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::PadExceptions

Override pad definitions for this instance.

Definition at line 922 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadComponents().

◆ PartID

PART_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::PartID

◆ PinAttributes

std::map<PART_DEFINITION_PIN_ID, PIN_ATTRIBUTE> CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::PinAttributes

Definition at line 921 of file cadstar_pcb_archive_parser.h.

◆ PinLabels

std::map<PART_DEFINITION_PIN_ID, wxString> CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::PinLabels

This is inherited from the PARTS library but is allowed to be out of sync.

See PART::DEFINITION::PIN::Label

Definition at line 917 of file cadstar_pcb_archive_parser.h.

◆ Readability

READABILITY CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Readability = READABILITY::BOTTOM_TO_TOP

Definition at line 911 of file cadstar_pcb_archive_parser.h.

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::ReuseBlockRef

Definition at line 903 of file cadstar_pcb_archive_parser.h.

◆ SymdefID

SYMDEF_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::SymdefID

◆ TestPoint

bool CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::TestPoint = false

Indicates whether this component should be treated as a testpoint.

See SYMDEF_TYPE::TESTPOINT

Definition at line 907 of file cadstar_pcb_archive_parser.h.

◆ TextLocations

std::map<ATTRIBUTE_ID, TEXT_LOCATION> CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::TextLocations

This contains location of any attributes, including designator position.

Definition at line 913 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadComponentAttributes().

◆ VariantID

VARIANT_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::VariantID = wxEmptyString

◆ VariantParentComponentID

COMPONENT_ID CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::VariantParentComponentID = wxEmptyString

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