KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::GRID Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::GRID:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Static Public Member Functions

static bool IsGrid (XNODE *aNode)
 

Public Attributes

GRID_TYPE Type
 
wxString Name
 
long Param1
 Either Units or X step, depending on Type (see GRID_TYPE for more details) More...
 
long Param2
 Either Divisor or Y step, depending on Type (see GRID_TYPE for more details) More...
 

Detailed Description

Definition at line 492 of file cadstar_archive_parser.h.

Member Function Documentation

◆ IsGrid()

bool CADSTAR_ARCHIVE_PARSER::GRID::IsGrid ( XNODE aNode)
static

Definition at line 587 of file cadstar_archive_parser.cpp.

588 {
589  wxString aNodeName = aNode->GetName();
590 
591  if( aNodeName == wxT( "FRACTIONALGRID" ) || aNodeName == wxT( "STEPGRID" ) )
592  return true;
593  else
594  return false;
595 }

Referenced by CADSTAR_ARCHIVE_PARSER::GRIDS::Parse().

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 598 of file cadstar_archive_parser.cpp.

599 {
600  wxASSERT( IsGrid( aNode ) );
601 
602  wxString aNodeName = aNode->GetName();
603 
604  if( aNodeName == wxT( "FRACTIONALGRID" ) )
606  else if( aNodeName == wxT( "STEPGRID" ) )
608  else
609  wxASSERT_MSG( true, wxT( "Unknown Grid Type" ) );
610 
611  Name = GetXmlAttributeIDString( aNode, 0 );
612  Param1 = GetXmlAttributeIDLong( aNode, 1 );
613  Param2 = GetXmlAttributeIDLong( aNode, 2 );
614 }
Param1 = X Step, Param2 = Y Step. A standard x,y grid.
static bool IsGrid(XNODE *aNode)
long Param1
Either Units or X step, depending on Type (see GRID_TYPE for more details)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Param1 = Units, Param2 = Divisor.
long Param2
Either Divisor or Y step, depending on Type (see GRID_TYPE for more details)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::FRACTIONALGRID, CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), and CADSTAR_ARCHIVE_PARSER::STEPGRID.

Referenced by CADSTAR_ARCHIVE_PARSER::GRIDS::Parse().

Member Data Documentation

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::GRID::Name

Definition at line 495 of file cadstar_archive_parser.h.

◆ Param1

long CADSTAR_ARCHIVE_PARSER::GRID::Param1

Either Units or X step, depending on Type (see GRID_TYPE for more details)

Definition at line 496 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::Load().

◆ Param2

long CADSTAR_ARCHIVE_PARSER::GRID::Param2

Either Divisor or Y step, depending on Type (see GRID_TYPE for more details)

Definition at line 498 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::Load().

◆ Type

GRID_TYPE CADSTAR_ARCHIVE_PARSER::GRID::Type

Definition at line 494 of file cadstar_archive_parser.h.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::Load().


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