KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::SETTINGS Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::SETTINGS:
CADSTAR_ARCHIVE_PARSER::PARSER CADSTAR_PCB_ARCHIVE_PARSER::TECHNOLOGY_SECTION

Public Member Functions

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

Public Attributes

UNITS Units
 Units to display for linear dimensions. More...
 
long UnitDisplPrecision
 Number of decimal points to display for linear dimensions. More...
 
long InterlineGap
 For CADSTAR font only, distance between lines of text, expressed as a percentage of the text height (accepted values are 0-100) More...
 
long BarlineGap
 For CADSTAR font only, distance between top bar and character, expressed as a percentage of the text height (accepted values are 0-100) More...
 
bool AllowBarredText = false
 Specifies if barring is allowed in the design. More...
 
long AngularPrecision
 Number of decimal points to display for angular dimensions. More...
 
LONGPOINT DesignOrigin
 
std::pair< POINT, POINTDesignArea
 
LONGPOINT DesignRef
 Appears to be 0,0 always. More...
 
LONGPOINT DesignLimit
 

Detailed Description

Definition at line 523 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Reimplemented in CADSTAR_PCB_ARCHIVE_PARSER::TECHNOLOGY_SECTION.

Definition at line 719 of file cadstar_archive_parser.cpp.

720 {
721  wxASSERT( aNode->GetName() == wxT( "SETTINGS" ) );
722 
723  XNODE* cNode = aNode->GetChildren();
724 
725  for( ; cNode; cNode = cNode->GetNext() )
726  {
727  wxString cNodeName = cNode->GetName();
728 
729  if( ParseSubNode( cNode, aContext ) )
730  continue;
731  else
732  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "SETTINGS" ) );
733  }
734 }
XNODE * GetChildren() const
Definition: xnode.h:62
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
Hold an XML or S-expression element.
Definition: xnode.h:43
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)

References XNODE::GetChildren(), and THROW_UNKNOWN_NODE_IO_ERROR.

◆ ParseSubNode()

bool CADSTAR_ARCHIVE_PARSER::SETTINGS::ParseSubNode ( XNODE aChildNode,
PARSER_CONTEXT aContext 
)

Definition at line 665 of file cadstar_archive_parser.cpp.

666 {
667  wxString cNodeName = aChildNode->GetName();
668 
669  if( cNodeName == wxT( "UNITS" ) )
670  {
671  Units = ParseUnits( aChildNode );
672  }
673  else if( cNodeName == wxT( "UNITSPRECISION" ) )
674  {
675  UnitDisplPrecision = GetXmlAttributeIDLong( aChildNode, 0 );
676  }
677  else if( cNodeName == wxT( "INTERLINEGAP" ) )
678  {
679  InterlineGap = GetXmlAttributeIDLong( aChildNode, 0 );
680  }
681  else if( cNodeName == wxT( "BARLINEGAP" ) )
682  {
683  BarlineGap = GetXmlAttributeIDLong( aChildNode, 0 );
684  }
685  else if( cNodeName == wxT( "ALLOWBARTEXT" ) )
686  {
687  AllowBarredText = true;
688  }
689  else if( cNodeName == wxT( "ANGULARPRECISION" ) )
690  {
691  AngularPrecision = GetXmlAttributeIDLong( aChildNode, 0 );
692  }
693  else if( cNodeName == wxT( "DESIGNORIGIN" ) )
694  {
695  DesignOrigin.Parse( aChildNode->GetChildren(), aContext );
696  }
697  else if( cNodeName == wxT( "DESIGNAREA" ) )
698  {
699  std::vector<POINT> pts = ParseAllChildPoints( aChildNode, aContext, true, 2 );
700  DesignArea = std::make_pair( pts[0], pts[1] );
701  }
702  else if( cNodeName == wxT( "DESIGNREF" ) )
703  {
704  DesignOrigin.Parse( aChildNode->GetChildren(), aContext );
705  }
706  else if( cNodeName == wxT( "DESIGNLIMIT" ) )
707  {
708  DesignLimit.Parse( aChildNode->GetChildren(), aContext );
709  }
710  else
711  {
712  return false;
713  }
714 
715  return true;
716 }
std::pair< POINT, POINT > DesignArea
long AngularPrecision
Number of decimal points to display for angular dimensions.
UNITS Units
Units to display for linear dimensions.
long UnitDisplPrecision
Number of decimal points to display for linear dimensions.
XNODE * GetChildren() const
Definition: xnode.h:62
bool AllowBarredText
Specifies if barring is allowed in the design.
long InterlineGap
For CADSTAR font only, distance between lines of text, expressed as a percentage of the text height (...
long BarlineGap
For CADSTAR font only, distance between top bar and character, expressed as a percentage of the text ...
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static UNITS ParseUnits(XNODE *aNode)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static std::vector< POINT > ParseAllChildPoints(XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false, int aExpectedNumPoints=UNDEFINED_VALUE)
if no children are present, it just returns an empty vector (without throwing an exception)

References XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::ParseAllChildPoints(), and CADSTAR_ARCHIVE_PARSER::ParseUnits().

Member Data Documentation

◆ AllowBarredText

bool CADSTAR_ARCHIVE_PARSER::SETTINGS::AllowBarredText = false

Specifies if barring is allowed in the design.

Definition at line 533 of file cadstar_archive_parser.h.

◆ AngularPrecision

long CADSTAR_ARCHIVE_PARSER::SETTINGS::AngularPrecision

Number of decimal points to display for angular dimensions.

Definition at line 534 of file cadstar_archive_parser.h.

◆ BarlineGap

long CADSTAR_ARCHIVE_PARSER::SETTINGS::BarlineGap

For CADSTAR font only, distance between top bar and character, expressed as a percentage of the text height (accepted values are 0-100)

Definition at line 530 of file cadstar_archive_parser.h.

◆ DesignArea

std::pair<POINT, POINT> CADSTAR_ARCHIVE_PARSER::SETTINGS::DesignArea

Definition at line 537 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::Load().

◆ DesignLimit

◆ DesignOrigin

LONGPOINT CADSTAR_ARCHIVE_PARSER::SETTINGS::DesignOrigin

Definition at line 536 of file cadstar_archive_parser.h.

◆ DesignRef

LONGPOINT CADSTAR_ARCHIVE_PARSER::SETTINGS::DesignRef

Appears to be 0,0 always.

Definition at line 538 of file cadstar_archive_parser.h.

◆ InterlineGap

long CADSTAR_ARCHIVE_PARSER::SETTINGS::InterlineGap

For CADSTAR font only, distance between lines of text, expressed as a percentage of the text height (accepted values are 0-100)

Definition at line 527 of file cadstar_archive_parser.h.

◆ UnitDisplPrecision

long CADSTAR_ARCHIVE_PARSER::SETTINGS::UnitDisplPrecision

Number of decimal points to display for linear dimensions.

Definition at line 526 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings().

◆ Units

UNITS CADSTAR_ARCHIVE_PARSER::SETTINGS::Units

Units to display for linear dimensions.

Definition at line 525 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings().


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