KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::HEADER Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::HEADER:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

FORMAT Format
 
wxString JobFile
 
wxString JobTitle
 
wxString Generator
 
RESOLUTION Resolution
 
TIMESTAMP Timestamp
 

Detailed Description

Definition at line 236 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 78 of file cadstar_archive_parser.cpp.

79 {
80  wxASSERT( aNode->GetName() == wxT( "HEADER" ) );
81 
82  XNODE* cNode = aNode->GetChildren();
83 
84  for( ; cNode; cNode = cNode->GetNext() )
85  {
86  wxString nodeName = cNode->GetName();
87 
88  if( nodeName == wxT( "FORMAT" ) )
89  {
90  Format.Parse( cNode, aContext );
91  }
92  else if( nodeName == wxT( "JOBFILE" ) )
93  {
94  JobFile = GetXmlAttributeIDString( cNode, 0 );
95  }
96  else if( nodeName == wxT( "JOBTITLE" ) )
97  {
98  JobTitle = GetXmlAttributeIDString( cNode, 0 );
99  }
100  else if( nodeName == wxT( "GENERATOR" ) )
101  {
102  Generator = GetXmlAttributeIDString( cNode, 0 );
103  }
104  else if( nodeName == wxT( "RESOLUTION" ) )
105  {
106  XNODE* subNode = cNode->GetChildren();
107 
108  if( ( subNode->GetName() == wxT( "METRIC" ) )
109  && ( GetXmlAttributeIDString( subNode, 0 ) == wxT( "HUNDREDTH" ) )
110  && ( GetXmlAttributeIDString( subNode, 1 ) == wxT( "MICRON" ) ) )
111  {
113  }
114  else
115  {
116  // TODO Need to find out if there are other possible resolutions. Logically
117  // there must be other base units that could be used, such as "IMPERIAL INCH"
118  // or "METRIC MM" but so far none of settings in CADSTAR generated a different
119  // output resolution to "HUNDREDTH MICRON"
120  THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), wxT( "HEADER->RESOLUTION" ) );
121  }
122  }
123  else if( nodeName == wxT( "TIMESTAMP" ) )
124  {
125  Timestamp.Parse( cNode, aContext );
126  }
127  else
128  {
129  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "HEADER" ) );
130  }
131  }
132 }
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
XNODE * GetChildren() const
Definition: xnode.h:62
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Hold an XML or S-expression element.
Definition: xnode.h:43
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References Format(), XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::HUNDREDTH_MICRON, and THROW_UNKNOWN_NODE_IO_ERROR.

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

Member Data Documentation

◆ Format

◆ Generator

wxString CADSTAR_ARCHIVE_PARSER::HEADER::Generator

Definition at line 241 of file cadstar_archive_parser.h.

◆ JobFile

wxString CADSTAR_ARCHIVE_PARSER::HEADER::JobFile

Definition at line 239 of file cadstar_archive_parser.h.

◆ JobTitle

wxString CADSTAR_ARCHIVE_PARSER::HEADER::JobTitle

◆ Resolution

RESOLUTION CADSTAR_ARCHIVE_PARSER::HEADER::Resolution

◆ Timestamp

TIMESTAMP CADSTAR_ARCHIVE_PARSER::HEADER::Timestamp

Definition at line 243 of file cadstar_archive_parser.h.


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