KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

MATERIAL_ID ID
 
wxString Name
 
MATERIAL_LAYER_TYPE Type
 
EVALUE Permittivity
 
EVALUE LossTangent
 
EVALUE Resistivity
 x10^-8 ohm*metre More...
 

Detailed Description

Definition at line 89 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 313 of file cadstar_pcb_archive_parser.cpp.

314{
315 wxASSERT( aNode->GetName() == wxT( "MATERIAL" ) );
316
317 ID = GetXmlAttributeIDString( aNode, 0 );
318 Name = GetXmlAttributeIDString( aNode, 1 );
319
320 wxString sType = GetXmlAttributeIDString( aNode, 2 );
321
322 if( sType == wxT( "CONSTRUCTION" ) )
323 {
325 }
326 else if( sType == wxT( "ELECTRICAL" ) )
327 {
329 }
330 else if( sType == wxT( "NONELEC" ) )
331 {
333 }
334 else
335 {
336 THROW_UNKNOWN_PARAMETER_IO_ERROR( sType, wxString::Format( wxT( "MATERIAL %s" ), Name ) );
337 }
338
339 XNODE* iNode = aNode->GetChildren();
340
341 if( !iNode )
342 {
343 THROW_MISSING_PARAMETER_IO_ERROR( wxT( "RESISTIVITY" ),
344 wxString::Format( wxT( "MATERIAL %s" ), Name ) );
345 }
346
347 for( ; iNode; iNode = iNode->GetNext() )
348 {
349 wxString nodeName = iNode->GetName();
350
351 if( nodeName == wxT( "RELPERMIT" ) )
352 {
353 ParseChildEValue( iNode, aContext, Permittivity );
354 }
355 else if( nodeName == wxT( "LOSSTANGENT" ) )
356 {
357 ParseChildEValue( iNode, aContext, LossTangent );
358 }
359 else if( nodeName == wxT( "RESISTIVITY" ) )
360 {
361 ParseChildEValue( iNode, aContext, Resistivity );
362 }
363 else
364 {
365 THROW_UNKNOWN_NODE_IO_ERROR( nodeName, wxString::Format( wxT( "MATERIAL %s" ), Name ) );
366 }
367 }
368}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static void ParseChildEValue(XNODE *aNode, PARSER_CONTEXT *aContext, EVALUE &aValueToParse)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References CADSTAR_PCB_ARCHIVE_PARSER::CONSTRUCTION, CADSTAR_PCB_ARCHIVE_PARSER::ELECTRICAL, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_PCB_ARCHIVE_PARSER::NON_ELECTRICAL, CADSTAR_ARCHIVE_PARSER::ParseChildEValue(), THROW_MISSING_PARAMETER_IO_ERROR, THROW_UNKNOWN_NODE_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::LAYERDEFS::Parse().

Member Data Documentation

◆ ID

MATERIAL_ID CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::ID

◆ LossTangent

EVALUE CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::LossTangent

◆ Name

wxString CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Name

◆ Permittivity

EVALUE CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Permittivity

◆ Resistivity

EVALUE CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Resistivity

x10^-8 ohm*metre

Definition at line 96 of file cadstar_pcb_archive_parser.h.

◆ Type

MATERIAL_LAYER_TYPE CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Type

Definition at line 93 of file cadstar_pcb_archive_parser.h.


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