KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

DOCUMENTATION_SYMBOL_ID ID
 
SYMDEF_ID SymdefID
 Normally documentation symbols only have TEXT, FIGURE and TEXT_LOCATION objects which are all drawn on the "(Undefined)" Layer. More...
 
LAYER_ID LayerID
 Move all objects in the Symdef to this layer. More...
 
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
 
long OrientAngle = 0
 
bool Mirror = false
 
bool Fixed = false
 
READABILITY Readability = READABILITY::BOTTOM_TO_TOP
 
long ScaleRatioNumerator = 1
 Documentation symbols can be arbitrarily scaled when added to a design. More...
 
long ScaleRatioDenominator = 1
 Documentation symbols can be arbitrarily scaled when added to a design. More...
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 

Detailed Description

Definition at line 1189 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2105 of file cadstar_archive_parser.cpp.

2106 {
2107  wxASSERT( aNode->GetName() == wxT( "DOCSYMBOL" ) );
2108 
2109  ID = GetXmlAttributeIDString( aNode, 0 );
2110  SymdefID = GetXmlAttributeIDString( aNode, 1 );
2111  LayerID = GetXmlAttributeIDString( aNode, 2 );
2112 
2113  XNODE* cNode = aNode->GetChildren();
2114  bool originParsed = false;
2115 
2116  for( ; cNode; cNode = cNode->GetNext() )
2117  {
2118  wxString cNodeName = cNode->GetName();
2119 
2120  if( !originParsed && cNodeName == wxT( "PT" ) )
2121  {
2122  Origin.Parse( cNode, aContext );
2123  originParsed = true;
2124  }
2125  else if( cNodeName == wxT( "GROUPREF" ) )
2126  {
2127  GroupID = GetXmlAttributeIDString( cNode, 0 );
2128  }
2129  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2130  {
2131  ReuseBlockRef.Parse( cNode, aContext );
2132  }
2133  else if( cNodeName == wxT( "FIX" ) )
2134  {
2135  Fixed = true;
2136  }
2137  else if( cNodeName == wxT( "MIRROR" ) )
2138  {
2139  Mirror = true;
2140  }
2141  else if( cNodeName == wxT( "READABILITY" ) )
2142  {
2143  Readability = ParseReadability( cNode );
2144  }
2145  else if( cNodeName == wxT( "ORIENT" ) )
2146  {
2147  OrientAngle = GetXmlAttributeIDLong( cNode, 0 );
2148  }
2149  else if( cNodeName == wxT( "ATTR" ) )
2150  {
2151  ATTRIBUTE_VALUE attr;
2152  attr.Parse( cNode, aContext );
2153  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2154  }
2155  else if( cNodeName == wxT( "SCALE" ) )
2156  {
2159  }
2160  else
2161  {
2162  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
2163  }
2164  }
2165 
2166  if( !originParsed )
2167  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
2168 }
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
LAYER_ID LayerID
Move all objects in the Symdef to this layer.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long ScaleRatioNumerator
Documentation symbols can be arbitrarily scaled when added to a design.
long ScaleRatioDenominator
Documentation symbols can be arbitrarily scaled when added to a design.
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
GROUP_ID GroupID
If not empty, this component is part of a group.
XNODE * GetChildren() const
Definition: xnode.h:62
SYMDEF_ID SymdefID
Normally documentation symbols only have TEXT, FIGURE and TEXT_LOCATION objects which are all drawn o...
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
XNODE * GetNext() const
Definition: xnode.h:67
static READABILITY ParseReadability(XNODE *aNode)
#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::ATTRIBUTE_VALUE::Parse(), CADSTAR_ARCHIVE_PARSER::ParseReadability(), THROW_MISSING_PARAMETER_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::CADSTAR_SCHEMATIC::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Parse().

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::AttributeValues

Definition at line 1213 of file cadstar_archive_parser.h.

◆ Fixed

bool CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Fixed = false

Definition at line 1205 of file cadstar_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::GroupID = wxEmptyString

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

Definition at line 1201 of file cadstar_archive_parser.h.

◆ ID

◆ LayerID

LAYER_ID CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::LayerID

Move all objects in the Symdef to this layer.

Definition at line 1197 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadDocumentationSymbols(), and CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols().

◆ Mirror

bool CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Mirror = false

◆ OrientAngle

long CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::OrientAngle = 0

◆ Origin

POINT CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Origin

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

Definition at line 1198 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadDocumentationSymbols(), and CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols().

◆ Readability

READABILITY CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Readability = READABILITY::BOTTOM_TO_TOP

Definition at line 1206 of file cadstar_archive_parser.h.

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::ReuseBlockRef

Definition at line 1202 of file cadstar_archive_parser.h.

◆ ScaleRatioDenominator

long CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::ScaleRatioDenominator = 1

Documentation symbols can be arbitrarily scaled when added to a design.

Definition at line 1210 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadDocumentationSymbols(), and CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols().

◆ ScaleRatioNumerator

long CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::ScaleRatioNumerator = 1

Documentation symbols can be arbitrarily scaled when added to a design.

Definition at line 1208 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadDocumentationSymbols(), and CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols().

◆ SymdefID

SYMDEF_ID CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::SymdefID

Normally documentation symbols only have TEXT, FIGURE and TEXT_LOCATION objects which are all drawn on the "(Undefined)" Layer.

When used in the design, the user has to specify which layer to draw it on.

Definition at line 1193 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadDocumentationSymbols(), and CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols().


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