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 1233 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 2227 of file cadstar_archive_parser.cpp.

2228{
2229 wxASSERT( aNode->GetName() == wxT( "DOCSYMBOL" ) );
2230
2231 ID = GetXmlAttributeIDString( aNode, 0 );
2232 SymdefID = GetXmlAttributeIDString( aNode, 1 );
2233 LayerID = GetXmlAttributeIDString( aNode, 2 );
2234
2235 XNODE* cNode = aNode->GetChildren();
2236 bool originParsed = false;
2237
2238 for( ; cNode; cNode = cNode->GetNext() )
2239 {
2240 wxString cNodeName = cNode->GetName();
2241
2242 if( !originParsed && cNodeName == wxT( "PT" ) )
2243 {
2244 Origin.Parse( cNode, aContext );
2245 originParsed = true;
2246 }
2247 else if( cNodeName == wxT( "GROUPREF" ) )
2248 {
2249 GroupID = GetXmlAttributeIDString( cNode, 0 );
2250 }
2251 else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2252 {
2253 ReuseBlockRef.Parse( cNode, aContext );
2254 }
2255 else if( cNodeName == wxT( "FIX" ) )
2256 {
2257 Fixed = true;
2258 }
2259 else if( cNodeName == wxT( "MIRROR" ) )
2260 {
2261 Mirror = true;
2262 }
2263 else if( cNodeName == wxT( "READABILITY" ) )
2264 {
2265 Readability = ParseReadability( cNode );
2266 }
2267 else if( cNodeName == wxT( "ORIENT" ) )
2268 {
2269 OrientAngle = GetXmlAttributeIDLong( cNode, 0 );
2270 }
2271 else if( cNodeName == wxT( "ATTR" ) )
2272 {
2273 ATTRIBUTE_VALUE attr;
2274 attr.Parse( cNode, aContext );
2275 AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2276 }
2277 else if( cNodeName == wxT( "SCALE" ) )
2278 {
2281 }
2282 else
2283 {
2284 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
2285 }
2286 }
2287
2288 if( !originParsed )
2289 THROW_MISSING_PARAMETER_IO_ERROR( wxT( "PT" ), aNode->GetName() );
2290}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static READABILITY ParseReadability(XNODE *aNode)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
long ScaleRatioNumerator
Documentation symbols can be arbitrarily scaled when added to a design.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
long ScaleRatioDenominator
Documentation symbols can be arbitrarily scaled when added to a design.
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.
LAYER_ID LayerID
Move all objects in the Symdef to this layer.
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
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override

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 1257 of file cadstar_archive_parser.h.

◆ Fixed

bool CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Fixed = false

Definition at line 1249 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 1245 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 1241 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 1242 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 1250 of file cadstar_archive_parser.h.

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::ReuseBlockRef

Definition at line 1246 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 1254 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 1252 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 1237 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: