KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::PART::DEFINITION Struct Reference

< "PARTDEFINITION" node name More...

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::PART::DEFINITION:
CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  GATE
 < "GATEDEFINITION" node name More...
 
struct  PIN
 < "PARTDEFINITIONPIN" node name More...
 
struct  PIN_EQUIVALENCE
 < "PINEQUIVALENCE" Node name More...
 
struct  SWAP_GATE
 < "SWAPGATE" Node name (represents an "Element") More...
 
struct  SWAP_GROUP
 

Public Member Functions

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

Public Attributes

wxString Name
 This name can be different to the PART name. More...
 
bool HidePinNames
 Specifies whether to display the pin names/identifier in the schematic symbol or not. More...
 
long MaxPinCount
 Optional parameter which is used for specifying the number of electrical pins on the PCB component symbol to be used in the part definition (this should not include mechanical pins for fixing etc.). More...
 
std::map< GATE_ID, GATEGateSymbols
 
std::map< PART_DEFINITION_PIN_ID, PINPins
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 Some attributes are defined within the part definition, whilst others are defined in the part. More...
 
std::vector< PIN_EQUIVALENCEPinEquivalences
 
std::vector< SWAP_GROUPSwapGroups
 

Detailed Description

< "PARTDEFINITION" node name

Definition at line 945 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1833 of file cadstar_archive_parser.cpp.

1834 {
1835  wxASSERT( aNode->GetName() == wxT( "PARTDEFINITION" ) );
1836 
1837  Name = GetXmlAttributeIDString( aNode, 0 );
1838 
1839  XNODE* cNode = aNode->GetChildren();
1840 
1841  for( ; cNode; cNode = cNode->GetNext() )
1842  {
1843  wxString cNodeName = cNode->GetName();
1844 
1845  if( cNodeName == wxT( "HIDEPINNAMES" ) )
1846  {
1847  HidePinNames = true;
1848  }
1849  else if( cNodeName == wxT( "MAXPIN" ) )
1850  {
1851  MaxPinCount = GetXmlAttributeIDLong( cNode, 0 );
1852  }
1853  else if( cNodeName == wxT( "GATEDEFINITION" ) )
1854  {
1855  GATE gate;
1856  gate.Parse( cNode, aContext );
1857  GateSymbols.insert( std::make_pair( gate.ID, gate ) );
1858  }
1859  else if( cNodeName == wxT( "PARTDEFINITIONPIN" ) )
1860  {
1861  PIN pin;
1862  pin.Parse( cNode, aContext );
1863  Pins.insert( std::make_pair( pin.ID, pin ) );
1864  }
1865  else if( cNodeName == wxT( "ATTR" ) )
1866  {
1867  ATTRIBUTE_VALUE attr;
1868  attr.Parse( cNode, aContext );
1869  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
1870  }
1871  else if( cNodeName == wxT( "PINEQUIVALENCE" ) )
1872  {
1873  PIN_EQUIVALENCE pinEq;
1874  pinEq.Parse( cNode, aContext );
1875  PinEquivalences.push_back( pinEq );
1876  }
1877  else if( cNodeName == wxT( "SWAPGROUP" ) )
1878  {
1879  SWAP_GROUP swapGroup;
1880  swapGroup.Parse( cNode, aContext );
1881  SwapGroups.push_back( swapGroup );
1882  }
1883  else
1884  {
1885  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
1886  }
1887  }
1888 }
std::map< PART_DEFINITION_PIN_ID, PIN > Pins
std::vector< PIN_EQUIVALENCE > PinEquivalences
wxString Name
This name can be different to the PART name.
XNODE * GetChildren() const
Definition: xnode.h:62
long MaxPinCount
Optional parameter which is used for specifying the number of electrical pins on the PCB component sy...
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
bool HidePinNames
Specifies whether to display the pin names/identifier in the schematic symbol or not.
XNODE * GetNext() const
Definition: xnode.h:67
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
Some attributes are defined within the part definition, whilst others are defined in the part.
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::GATE::ID, CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::GATE::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PIN_EQUIVALENCE::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::SWAP_GROUP::Parse(), pin, and THROW_UNKNOWN_NODE_IO_ERROR.

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::AttributeValues

Some attributes are defined within the part definition, whilst others are defined in the part.

Definition at line 1076 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ GateSymbols

std::map<GATE_ID, GATE> CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::GateSymbols

◆ HidePinNames

bool CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::HidePinNames
Initial value:
=
false

Specifies whether to display the pin names/identifier in the schematic symbol or not.

E.g. it is useful to display pin name information for integrated circuits but less so for resistors and capacitors. (subnode HIDEPINNAMES)

Definition at line 1060 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().

◆ MaxPinCount

long CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::MaxPinCount
Initial value:

Optional parameter which is used for specifying the number of electrical pins on the PCB component symbol to be used in the part definition (this should not include mechanical pins for fixing etc.).

This value must be less than or equal to than the number of pins on the PCB Component symbol.

Definition at line 1066 of file cadstar_archive_parser.h.

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::Name

This name can be different to the PART name.

Definition at line 1059 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadComponents().

◆ PinEquivalences

std::vector<PIN_EQUIVALENCE> CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PinEquivalences

Definition at line 1080 of file cadstar_archive_parser.h.

◆ Pins

std::map<PART_DEFINITION_PIN_ID, PIN> CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::Pins

◆ SwapGroups

std::vector<SWAP_GROUP> CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::SwapGroups

Definition at line 1081 of file cadstar_archive_parser.h.


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