KiCad PCB EDA Suite
ABOARD6 Struct Reference

#include <altium_parser_pcb.h>

Public Member Functions

 ABOARD6 (ALTIUM_PARSER &aReader)
 

Public Attributes

wxPoint sheetpos
 
wxSize sheetsize
 
int layercount
 
std::vector< ABOARD6_LAYER_STACKUPstackup
 
std::vector< ALTIUM_VERTICEboard_vertices
 

Detailed Description

Definition at line 346 of file altium_parser_pcb.h.

Constructor & Destructor Documentation

◆ ABOARD6()

ABOARD6::ABOARD6 ( ALTIUM_PARSER aReader)
explicit

Definition at line 169 of file altium_parser_pcb.cpp.

170 {
171  std::map<wxString, wxString> props = aReader.ReadProperties();
172 
173  if( props.empty() )
174  THROW_IO_ERROR( "Board6 stream has no props!" );
175 
176  sheetpos = wxPoint( ALTIUM_PARSER::ReadKicadUnit( props, "SHEETX", "0mil" ),
177  -ALTIUM_PARSER::ReadKicadUnit( props, "SHEETY", "0mil" ) );
178  sheetsize = wxSize( ALTIUM_PARSER::ReadKicadUnit( props, "SHEETWIDTH", "0mil" ),
179  ALTIUM_PARSER::ReadKicadUnit( props, "SHEETHEIGHT", "0mil" ) );
180 
181  layercount = ALTIUM_PARSER::ReadInt( props, "LAYERSETSCOUNT", 1 ) + 1;
182 
183  for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
184  {
185  const wxString layeri = "LAYER" + std::to_string( i );
186  const wxString layername = layeri + "NAME";
187 
188  auto layernameit = props.find( layername );
189 
190  if( layernameit == props.end() )
191  break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
192 
194 
195  l.name = ALTIUM_PARSER::ReadString( props, layername, "" );
196  l.nextId = ALTIUM_PARSER::ReadInt( props, layeri + "NEXT", 0 );
197  l.prevId = ALTIUM_PARSER::ReadInt( props, layeri + "PREV", 0 );
198  l.copperthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + "COPTHICK", "1.4mil" );
199 
200  l.dielectricconst = ALTIUM_PARSER::ReadDouble( props, layeri + "DIELCONST", 0. );
201  l.dielectricthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + "DIELHEIGHT", "60mil" );
202  l.dielectricmaterial = ALTIUM_PARSER::ReadString( props, layeri + "DIELMATERIAL", "FR-4" );
203 
204  stackup.push_back( l );
205  }
206 
208 
209  if( aReader.HasParsingError() )
210  THROW_IO_ERROR( "Board6 stream was not parsed correctly!" );
211 }
wxSize sheetsize
static double ReadDouble(const std::map< wxString, wxString > &aProps, const wxString &aKey, double aDefault)
static int ReadInt(const std::map< wxString, wxString > &aProps, const wxString &aKey, int aDefault)
std::map< wxString, wxString > ReadProperties()
wxPoint sheetpos
int32_t ReadKicadUnit()
std::vector< ALTIUM_VERTICE > board_vertices
static wxString ReadString(const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
std::vector< ABOARD6_LAYER_STACKUP > stackup
void altium_parse_polygons(std::map< wxString, wxString > &aProps, std::vector< ALTIUM_VERTICE > &aVertices)
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
bool HasParsingError()

References altium_parse_polygons(), board_vertices, ABOARD6_LAYER_STACKUP::copperthick, ABOARD6_LAYER_STACKUP::dielectricconst, ABOARD6_LAYER_STACKUP::dielectricmaterial, ABOARD6_LAYER_STACKUP::dielectricthick, ALTIUM_PARSER::HasParsingError(), layercount, ABOARD6_LAYER_STACKUP::name, ABOARD6_LAYER_STACKUP::nextId, ABOARD6_LAYER_STACKUP::prevId, ALTIUM_PARSER::ReadDouble(), ALTIUM_PARSER::ReadInt(), ALTIUM_PARSER::ReadKicadUnit(), ALTIUM_PARSER::ReadProperties(), ALTIUM_PARSER::ReadString(), sheetpos, sheetsize, stackup, and THROW_IO_ERROR.

Member Data Documentation

◆ board_vertices

std::vector<ALTIUM_VERTICE> ABOARD6::board_vertices

Definition at line 354 of file altium_parser_pcb.h.

Referenced by ABOARD6(), and ALTIUM_PCB::ParseBoard6Data().

◆ layercount

int ABOARD6::layercount

Definition at line 351 of file altium_parser_pcb.h.

Referenced by ABOARD6().

◆ sheetpos

wxPoint ABOARD6::sheetpos

Definition at line 348 of file altium_parser_pcb.h.

Referenced by ABOARD6(), and ALTIUM_PCB::ParseBoard6Data().

◆ sheetsize

wxSize ABOARD6::sheetsize

Definition at line 349 of file altium_parser_pcb.h.

Referenced by ABOARD6().

◆ stackup

std::vector<ABOARD6_LAYER_STACKUP> ABOARD6::stackup

Definition at line 352 of file altium_parser_pcb.h.

Referenced by ABOARD6(), and ALTIUM_PCB::ParseBoard6Data().


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