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 248 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 84 of file cadstar_archive_parser.cpp.

85 {
86  wxASSERT( aNode->GetName() == wxT( "HEADER" ) );
87 
88  XNODE* cNode = aNode->GetChildren();
89 
90  for( ; cNode; cNode = cNode->GetNext() )
91  {
92  wxString nodeName = cNode->GetName();
93 
94  if( nodeName == wxT( "FORMAT" ) )
95  {
96  Format.Parse( cNode, aContext );
97  }
98  else if( nodeName == wxT( "JOBFILE" ) )
99  {
100  JobFile = GetXmlAttributeIDString( cNode, 0 );
101  }
102  else if( nodeName == wxT( "JOBTITLE" ) )
103  {
104  JobTitle = GetXmlAttributeIDString( cNode, 0 );
105  }
106  else if( nodeName == wxT( "GENERATOR" ) )
107  {
108  Generator = GetXmlAttributeIDString( cNode, 0 );
109  }
110  else if( nodeName == wxT( "RESOLUTION" ) )
111  {
112  XNODE* subNode = cNode->GetChildren();
113 
114  if( ( subNode->GetName() == wxT( "METRIC" ) )
115  && ( GetXmlAttributeIDString( subNode, 0 ) == wxT( "HUNDREDTH" ) )
116  && ( GetXmlAttributeIDString( subNode, 1 ) == wxT( "MICRON" ) ) )
117  {
119  }
120  else
121  {
122  // TODO Need to find out if there are other possible resolutions. Logically
123  // there must be other base units that could be used, such as "IMPERIAL INCH"
124  // or "METRIC MM" but so far none of settings in CADSTAR generated a different
125  // output resolution to "HUNDREDTH MICRON"
126  THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), wxT( "HEADER->RESOLUTION" ) );
127  }
128  }
129  else if( nodeName == wxT( "TIMESTAMP" ) )
130  {
131  Timestamp.Parse( cNode, aContext );
132  }
133  else
134  {
135  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "HEADER" ) );
136  }
137  }
138 }
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 253 of file cadstar_archive_parser.h.

◆ JobFile

wxString CADSTAR_ARCHIVE_PARSER::HEADER::JobFile

Definition at line 251 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 255 of file cadstar_archive_parser.h.


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