KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::SIGLOC Struct Reference

Net name or bus name label. More...

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::SIGLOC:
CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 
void ParseIdentifiers (XNODE *aNode, PARSER_CONTEXT *aContext)
 
bool ParseSubNode (XNODE *aChildNode, PARSER_CONTEXT *aContext)
 

Public Attributes

TEXTCODE_ID TextCodeID
 
LAYER_ID LayerID
 
POINT Position
 
long OrientAngle = 0
 
bool Mirror = false
 
bool Fixed = false
 
JUSTIFICATION Justification
 Note: Justification has no effect on single lines of text. More...
 
ALIGNMENT Alignment
 In CADSTAR The default alignment for a TEXT object (when "(No Alignment()" is selected) Bottom Left of the first line. More...
 

Detailed Description

Net name or bus name label.

Definition at line 303 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Reimplemented from CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION.

Definition at line 777 of file cadstar_sch_archive_parser.cpp.

778 {
779  wxCHECK( aNode->GetName() == wxT( "SIGLOC" ), );
780 
781  TextCodeID = GetXmlAttributeIDString( aNode, 0 );
782 
783  //Parse child nodes
784  XNODE* cNode = aNode->GetChildren();
785 
786  for( ; cNode; cNode = cNode->GetNext() )
787  {
788  if( ParseSubNode( cNode, aContext ) )
789  continue;
790  else
791  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), aNode->GetName() );
792  }
793 
794  if( !Position.IsFullySpecified() )
795  THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), aNode->GetName() );
796 }
XNODE * GetChildren() const
Definition: xnode.h:62
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), THROW_MISSING_NODE_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

◆ ParseIdentifiers()

void CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseIdentifiers ( XNODE aNode,
PARSER_CONTEXT aContext 
)
inherited

Definition at line 999 of file cadstar_archive_parser.cpp.

1000 {
1001  TextCodeID = GetXmlAttributeIDString( aNode, 0 );
1002  LayerID = GetXmlAttributeIDString( aNode, 1 );
1003 }
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

bool CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseSubNode ( XNODE aChildNode,
PARSER_CONTEXT aContext 
)
inherited

Definition at line 1006 of file cadstar_archive_parser.cpp.

1007 {
1008  wxString cNodeName = aChildNode->GetName();
1009 
1010  if( cNodeName == wxT( "PT" ) )
1011  Position.Parse( aChildNode, aContext );
1012  else if( cNodeName == wxT( "ORIENT" ) )
1013  OrientAngle = GetXmlAttributeIDLong( aChildNode, 0 );
1014  else if( cNodeName == wxT( "MIRROR" ) )
1015  Mirror = true;
1016  else if( cNodeName == wxT( "FIX" ) )
1017  Fixed = true;
1018  else if( cNodeName == wxT( "ALIGN" ) )
1019  Alignment = ParseAlignment( aChildNode );
1020  else if( cNodeName == wxT( "JUSTIFICATION" ) )
1021  Justification = ParseJustification( aChildNode );
1022  else
1023  return false;
1024 
1025  return true;
1026 }
static JUSTIFICATION ParseJustification(XNODE *aNode)
ALIGNMENT Alignment
In CADSTAR The default alignment for a TEXT object (when "(No Alignment()" is selected) Bottom Left o...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
JUSTIFICATION Justification
Note: Justification has no effect on single lines of text.
static ALIGNMENT ParseAlignment(XNODE *aNode)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::ParseAlignment(), and CADSTAR_ARCHIVE_PARSER::ParseJustification().

Member Data Documentation

◆ Alignment

ALIGNMENT CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::Alignment
inherited
Initial value:
= ALIGNMENT::
NO_ALIGNMENT

In CADSTAR The default alignment for a TEXT object (when "(No Alignment()" is selected) Bottom Left of the first line.

Note that this is different from BOTTOM_LEFT (which is bottom left of the whole text block)

Definition at line 667 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::applyToLibraryFieldAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymbolFieldAttribute(), and CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::TEXT_LOCATION().

◆ Fixed

bool CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::Fixed = false
inherited

Definition at line 664 of file cadstar_archive_parser.h.

◆ Justification

JUSTIFICATION CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::Justification
inherited

◆ LayerID

LAYER_ID CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::LayerID
inherited

Definition at line 660 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute().

◆ Mirror

◆ OrientAngle

◆ Position

◆ TextCodeID


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