KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL:
CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  PIN_NUM
 

Public Member Functions

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

Public Attributes

SYMBOL_ID ID
 
SYMDEF_ID SymdefID
 
LAYER_ID LayerID
 Sheet on which symbol is located. More...
 
POINT Origin
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this symbol is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
long OrientAngle = 0
 
bool Mirror = false
 
bool Fixed = false
 
long ScaleRatioNumerator = 1
 Symbols can be arbitrarily scaled in CADSTAR. More...
 
long ScaleRatioDenominator = 1
 
READABILITY Readability = READABILITY::BOTTOM_TO_TOP
 
bool IsComponent = false
 
COMP ComponentRef
 
bool HasPartRef = false
 
PARTREF PartRef
 
bool PartNameVisible = true
 
GATE_ID GateID
 The gate this symbol represents within the associated Part. More...
 
bool IsSymbolVariant = false
 
SYMBOLVARIANT SymbolVariant
 
SIGNALREFERENCELINK SigRefLink
 Signal References (a special form of global signal) have annotations showing the location of all the other sheets where the signal is present. More...
 
SYMBOL_ID VariantParentSymbolID = wxEmptyString
 
VARIANT_ID VariantID = wxEmptyString
 
std::map< TERMINAL_ID, TERMATTRTerminalAttributes
 
std::map< TERMINAL_ID, SYMPINNAME_LABELPinLabels
 Equivalent to KiCad's Pin Name. More...
 
std::map< TERMINAL_ID, SYMPINNAME_LABELPinNames
 Identifier of the pin in the PCB Equivalent to KiCad's Pin Number. More...
 
std::map< TERMINAL_ID, PIN_NUMPinNumbers
 This seems to only appear in older designs and is similar to PinNames but only allowing numerical values. More...
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 

Detailed Description

Definition at line 246 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 655 of file cadstar_sch_archive_parser.cpp.

656 {
657  wxCHECK( aNode->GetName() == wxT( "SYMBOL" ), );
658 
659  ID = GetXmlAttributeIDString( aNode, 0 );
660  SymdefID = GetXmlAttributeIDString( aNode, 1 );
661  LayerID = GetXmlAttributeIDString( aNode, 2 );
662 
663  XNODE* cNode = aNode->GetChildren();
664  bool originParsed = false;
665  wxString location = wxString::Format( "SYMBOL -> %s", ID );
666 
667  for( ; cNode; cNode = cNode->GetNext() )
668  {
669  wxString cNodeName = cNode->GetName();
670 
671  if( !originParsed && cNodeName == wxT( "PT" ) )
672  {
673  Origin.Parse( cNode, aContext );
674  originParsed = true;
675  }
676  else if( cNodeName == wxT( "COMP" ) )
677  {
678  ComponentRef.Parse( cNode, aContext );
679  IsComponent = true;
680  }
681  else if( cNodeName == wxT( "PARTREF" ) )
682  {
683  PartRef.Parse( cNode, aContext );
684  HasPartRef = true;
685  }
686  else if( cNodeName == wxT( "PARTNAMENOTVISIBLE" ) )
687  {
688  PartNameVisible = false;
689  }
690  else if( cNodeName == wxT( "VSYMMASTER" ) )
691  {
693  VariantID = GetXmlAttributeIDString( cNode, 1 );
694  }
695  else if( cNodeName == wxT( "GROUPREF" ) )
696  {
697  GroupID = GetXmlAttributeIDString( cNode, 0 );
698  }
699  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
700  {
701  ReuseBlockRef.Parse( cNode, aContext );
702  }
703  else if( cNodeName == wxT( "SIGNALREFERENCELINK" ) )
704  {
705  SigRefLink.Parse( cNode, aContext );
706  }
707  else if( cNodeName == wxT( "ORIENT" ) )
708  {
709  OrientAngle = GetXmlAttributeIDLong( cNode, 0 );
710  }
711  else if( cNodeName == wxT( "MIRROR" ) )
712  {
713  Mirror = true;
714  }
715  else if( cNodeName == wxT( "FIX" ) )
716  {
717  Fixed = true;
718  }
719  else if( cNodeName == wxT( "SCALE" ) )
720  {
723  }
724  else if( cNodeName == wxT( "READABILITY" ) )
725  {
726  Readability = ParseReadability( cNode );
727  }
728  else if( cNodeName == wxT( "GATE" ) )
729  {
730  GateID = GetXmlAttributeIDString( cNode, 0 );
731  }
732  else if( cNodeName == wxT( "SYMBOLVARIANT" ) )
733  {
734  IsSymbolVariant = true;
735  SymbolVariant.Parse( cNode, aContext );
736  }
737  else if( cNodeName == wxT( "TERMATTR" ) )
738  {
739  TERMATTR termattr;
740  termattr.Parse( cNode, aContext );
741  TerminalAttributes.insert( std::make_pair( termattr.TerminalID, termattr ) );
742  }
743  else if( cNodeName == wxT( "SYMPINLABEL" ) )
744  {
745  SYMPINNAME_LABEL sympinname;
746  sympinname.Parse( cNode, aContext );
747  PinLabels.insert( std::make_pair( sympinname.TerminalID, sympinname ) );
748  }
749  else if( cNodeName == wxT( "SYMPINNAME" ) )
750  {
751  SYMPINNAME_LABEL sympinname;
752  sympinname.Parse( cNode, aContext );
753  PinNames.insert( std::make_pair( sympinname.TerminalID, sympinname ) );
754  }
755  else if( cNodeName == wxT( "PINNUM" ) )
756  {
757  PIN_NUM pinNum;
758  pinNum.Parse( cNode, aContext );
759  PinNumbers.insert( std::make_pair( pinNum.TerminalID, pinNum ) );
760  }
761  else if( cNodeName == wxT( "ATTR" ) )
762  {
763  ATTRIBUTE_VALUE attrVal;
764  attrVal.Parse( cNode, aContext );
765  AttributeValues.insert( std::make_pair( attrVal.AttributeID, attrVal ) );
766  }
767  else
768  {
769  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
770  }
771  }
772 
773  if( !originParsed )
774  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
775 }
SIGNALREFERENCELINK SigRefLink
Signal References (a special form of global signal) have annotations showing the location of all the ...
std::map< TERMINAL_ID, TERMATTR > TerminalAttributes
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
LAYER_ID LayerID
Sheet on which symbol is located.
void insert(value_type const &v)
Definition: pin_number.h:57
long ScaleRatioNumerator
Symbols can be arbitrarily scaled in CADSTAR.
XNODE * GetChildren() const
Definition: xnode.h:62
GROUP_ID GroupID
If not empty, this symbol is part of a group.
GATE_ID GateID
The gate this symbol represents within the associated Part.
std::map< TERMINAL_ID, SYMPINNAME_LABEL > PinNames
Identifier of the pin in the PCB Equivalent to KiCad's Pin Number.
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetNext() const
Definition: xnode.h:67
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static READABILITY ParseReadability(XNODE *aNode)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< TERMINAL_ID, SYMPINNAME_LABEL > PinLabels
Equivalent to KiCad's Pin Name.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), PinNumbers::insert(), CADSTAR_SCH_ARCHIVE_PARSER::TERMATTR::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMPINNAME_LABEL::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PIN_NUM::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), CADSTAR_ARCHIVE_PARSER::ParseReadability(), CADSTAR_SCH_ARCHIVE_PARSER::TERMATTR::TerminalID, CADSTAR_SCH_ARCHIVE_PARSER::SYMPINNAME_LABEL::TerminalID, CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PIN_NUM::TerminalID, THROW_MISSING_PARAMETER_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::CADSTAR_SCHEMATIC::Parse().

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::AttributeValues

◆ ComponentRef

COMP CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::ComponentRef

◆ Fixed

bool CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Fixed = false

Definition at line 266 of file cadstar_sch_archive_parser.h.

◆ GateID

GATE_ID CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::GateID

The gate this symbol represents within the associated Part.

Definition at line 276 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances().

◆ GroupID

GROUP_ID CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::GroupID = wxEmptyString

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

Definition at line 262 of file cadstar_sch_archive_parser.h.

◆ HasPartRef

bool CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::HasPartRef = false

◆ ID

◆ IsComponent

bool CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::IsComponent = false

◆ IsSymbolVariant

bool CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::IsSymbolVariant = false

◆ LayerID

LAYER_ID CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::LayerID

◆ Mirror

◆ OrientAngle

◆ Origin

◆ PartNameVisible

bool CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PartNameVisible = true

Definition at line 275 of file cadstar_sch_archive_parser.h.

◆ PartRef

PARTREF CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PartRef

◆ PinLabels

std::map<TERMINAL_ID, SYMPINNAME_LABEL> CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PinLabels

Equivalent to KiCad's Pin Name.

Definition at line 288 of file cadstar_sch_archive_parser.h.

◆ PinNames

std::map<TERMINAL_ID, SYMPINNAME_LABEL> CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PinNames

Identifier of the pin in the PCB Equivalent to KiCad's Pin Number.

Definition at line 289 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol().

◆ PinNumbers

std::map<TERMINAL_ID, PIN_NUM> CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PinNumbers

This seems to only appear in older designs and is similar to PinNames but only allowing numerical values.

Definition at line 291 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol().

◆ Readability

READABILITY CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Readability = READABILITY::BOTTOM_TO_TOP

Definition at line 269 of file cadstar_sch_archive_parser.h.

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::ReuseBlockRef

Definition at line 263 of file cadstar_sch_archive_parser.h.

◆ ScaleRatioDenominator

long CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::ScaleRatioDenominator = 1

◆ ScaleRatioNumerator

long CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::ScaleRatioNumerator = 1

Symbols can be arbitrarily scaled in CADSTAR.

Definition at line 267 of file cadstar_sch_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::getLocationOfNetElement(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances().

◆ SigRefLink

SIGNALREFERENCELINK CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::SigRefLink

Signal References (a special form of global signal) have annotations showing the location of all the other sheets where the signal is present.

Definition at line 280 of file cadstar_sch_archive_parser.h.

◆ SymbolVariant

SYMBOLVARIANT CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::SymbolVariant

◆ SymdefID

◆ TerminalAttributes

std::map<TERMINAL_ID, TERMATTR> CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::TerminalAttributes

Definition at line 287 of file cadstar_sch_archive_parser.h.

◆ VariantID

VARIANT_ID CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::VariantID = wxEmptyString

◆ VariantParentSymbolID

SYMBOL_ID CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::VariantParentSymbolID = wxEmptyString

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