KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SPRINT_LAYOUT_PARSER Class Reference

#include <sprint_layout_parser.h>

Public Member Functions

 SPRINT_LAYOUT_PARSER ()
 
 ~SPRINT_LAYOUT_PARSER ()
 
bool Parse (const wxString &aFileName)
 
BOARDCreateBoard (std::map< wxString, std::unique_ptr< FOOTPRINT > > &aFootprintMap, size_t aBoardIndex=0)
 
const SPRINT_LAYOUT::FILE_DATAGetFileData () const
 

Private Member Functions

uint8_t readUint8 ()
 
uint16_t readUint16 ()
 
uint32_t readUint32 ()
 
int32_t readInt32 ()
 
float readFloat ()
 
double readDouble ()
 
std::string readFixedString (size_t aMaxLen)
 
std::string readVarString ()
 
void skip (size_t aBytes)
 
void parseBoardHeader (SPRINT_LAYOUT::BOARD_DATA &aBoard)
 
void parseObject (SPRINT_LAYOUT::OBJECT &aObject, bool aIsTextChild=false)
 
void parseTrailer ()
 
PCB_LAYER_ID mapLayer (uint8_t aSprintLayer) const
 
int sprintToKicadCoord (float aValue) const
 
VECTOR2I sprintToKicadPos (float aX, float aY) const
 
void addPadToBoard (BOARD *aBoard, const SPRINT_LAYOUT::OBJECT &aObj, std::map< uint16_t, FOOTPRINT * > &aComponentMap, std::map< wxString, std::unique_ptr< FOOTPRINT > > &aFootprintMap)
 
void addCircleToBoard (BOARD *aBoard, const SPRINT_LAYOUT::OBJECT &aObj, std::vector< std::vector< VECTOR2I > > &aOutlineSegments)
 
void addLineToBoard (BOARD *aBoard, const SPRINT_LAYOUT::OBJECT &aObj, std::vector< std::vector< VECTOR2I > > &aOutlineSegments)
 
void addPolyToBoard (BOARD *aBoard, const SPRINT_LAYOUT::OBJECT &aObj, std::vector< std::vector< VECTOR2I > > &aOutlineSegments)
 
void addTextToBoard (BOARD *aBoard, const SPRINT_LAYOUT::OBJECT &aObj)
 
void buildOutline (BOARD *aBoard, std::vector< std::vector< VECTOR2I > > &aOutlineSegments, const SPRINT_LAYOUT::BOARD_DATA &aBoardData)
 

Private Attributes

SPRINT_LAYOUT::FILE_DATA m_fileData
 
const uint8_t * m_pos = nullptr
 
const uint8_t * m_start = nullptr
 
const uint8_t * m_end = nullptr
 
std::vector< uint8_t > m_buffer
 

Detailed Description

Definition at line 149 of file sprint_layout_parser.h.

Constructor & Destructor Documentation

◆ SPRINT_LAYOUT_PARSER()

SPRINT_LAYOUT_PARSER::SPRINT_LAYOUT_PARSER ( )
default

◆ ~SPRINT_LAYOUT_PARSER()

SPRINT_LAYOUT_PARSER::~SPRINT_LAYOUT_PARSER ( )
default

Member Function Documentation

◆ addCircleToBoard()

◆ addLineToBoard()

◆ addPadToBoard()

◆ addPolyToBoard()

◆ addTextToBoard()

◆ buildOutline()

◆ CreateBoard()

◆ GetFileData()

const SPRINT_LAYOUT::FILE_DATA & SPRINT_LAYOUT_PARSER::GetFileData ( ) const
inline

◆ mapLayer()

◆ Parse()

◆ parseBoardHeader()

◆ parseObject()

void SPRINT_LAYOUT_PARSER::parseObject ( SPRINT_LAYOUT::OBJECT & aObject,
bool aIsTextChild = false )
private

Definition at line 306 of file sprint_layout_parser.cpp.

References _, SPRINT_LAYOUT::COMPONENT_DATA::center_mode, SPRINT_LAYOUT::OBJECT::clearance, SPRINT_LAYOUT::COMPONENT_DATA::comment, SPRINT_LAYOUT::OBJECT::component, SPRINT_LAYOUT::OBJECT::component_id, SPRINT_LAYOUT::OBJECT::filled, SPRINT_LAYOUT::OBJECT::groups, SPRINT_LAYOUT::OBJECT::inner, SPRINT_LAYOUT::OBJECT::keepout, SPRINT_LAYOUT::OBJECT::layer, SPRINT_LAYOUT::OBJECT::line_width, MAX_CHILDREN, MAX_GROUPS, MAX_POINTS, SPRINT_LAYOUT::OBJECT::mirror, SPRINT_LAYOUT::OBJECT::net_name, SPRINT_LAYOUT::OBJ_CIRCLE, SPRINT_LAYOUT::OBJ_LINE, SPRINT_LAYOUT::OBJ_POLY, SPRINT_LAYOUT::OBJ_SMD_PAD, SPRINT_LAYOUT::OBJ_TEXT, SPRINT_LAYOUT::OBJ_THT_PAD, SPRINT_LAYOUT::COMPONENT_DATA::off_x, SPRINT_LAYOUT::COMPONENT_DATA::off_y, SPRINT_LAYOUT::OBJECT::outer, SPRINT_LAYOUT::COMPONENT_DATA::package, parseObject(), SPRINT_LAYOUT::OBJECT::plated, SPRINT_LAYOUT::OBJECT::points, readDouble(), readFloat(), readInt32(), readUint16(), readUint32(), readUint8(), readVarString(), SPRINT_LAYOUT::COMPONENT_DATA::rotation, SPRINT_LAYOUT::OBJECT::rotation, skip(), SPRINT_LAYOUT::OBJECT::soldermask, SPRINT_LAYOUT::OBJECT::start_angle, SPRINT_LAYOUT::OBJECT::text, SPRINT_LAYOUT::OBJECT::text_children, SPRINT_LAYOUT::OBJECT::thermal_width, THROW_IO_ERROR, SPRINT_LAYOUT::OBJECT::tht_shape, SPRINT_LAYOUT::OBJECT::type, SPRINT_LAYOUT::COMPONENT_DATA::use, SPRINT_LAYOUT::COMPONENT_DATA::valid, SPRINT_LAYOUT::OBJECT::x, and SPRINT_LAYOUT::OBJECT::y.

Referenced by parseBoardHeader(), and parseObject().

◆ parseTrailer()

void SPRINT_LAYOUT_PARSER::parseTrailer ( )
private

Definition at line 424 of file sprint_layout_parser.cpp.

References m_fileData, readFixedString(), readUint32(), and readVarString().

Referenced by Parse().

◆ readDouble()

double SPRINT_LAYOUT_PARSER::readDouble ( )
private

Definition at line 120 of file sprint_layout_parser.cpp.

References _, m_end, m_pos, and THROW_IO_ERROR.

Referenced by parseBoardHeader(), and parseObject().

◆ readFixedString()

std::string SPRINT_LAYOUT_PARSER::readFixedString ( size_t aMaxLen)
private

Definition at line 141 of file sprint_layout_parser.cpp.

References _, m_end, m_pos, readUint8(), and THROW_IO_ERROR.

Referenced by parseBoardHeader(), and parseTrailer().

◆ readFloat()

float SPRINT_LAYOUT_PARSER::readFloat ( )
private

Definition at line 111 of file sprint_layout_parser.cpp.

References readUint32().

Referenced by parseObject().

◆ readInt32()

int32_t SPRINT_LAYOUT_PARSER::readInt32 ( )
private

Definition at line 105 of file sprint_layout_parser.cpp.

References readUint32().

Referenced by parseBoardHeader(), and parseObject().

◆ readUint16()

uint16_t SPRINT_LAYOUT_PARSER::readUint16 ( )
private

Definition at line 79 of file sprint_layout_parser.cpp.

References _, m_end, m_pos, and THROW_IO_ERROR.

Referenced by parseObject().

◆ readUint32()

uint32_t SPRINT_LAYOUT_PARSER::readUint32 ( )
private

◆ readUint8()

uint8_t SPRINT_LAYOUT_PARSER::readUint8 ( )
private

Definition at line 70 of file sprint_layout_parser.cpp.

References _, m_end, m_pos, and THROW_IO_ERROR.

Referenced by Parse(), parseBoardHeader(), parseObject(), and readFixedString().

◆ readVarString()

std::string SPRINT_LAYOUT_PARSER::readVarString ( )
private

Definition at line 155 of file sprint_layout_parser.cpp.

References _, m_end, m_pos, readUint32(), and THROW_IO_ERROR.

Referenced by parseObject(), and parseTrailer().

◆ skip()

void SPRINT_LAYOUT_PARSER::skip ( size_t aBytes)
private

Definition at line 171 of file sprint_layout_parser.cpp.

References _, m_end, m_pos, and THROW_IO_ERROR.

Referenced by Parse(), parseBoardHeader(), and parseObject().

◆ sprintToKicadCoord()

int SPRINT_LAYOUT_PARSER::sprintToKicadCoord ( float aValue) const
private

◆ sprintToKicadPos()

VECTOR2I SPRINT_LAYOUT_PARSER::sprintToKicadPos ( float aX,
float aY ) const
private

Member Data Documentation

◆ m_buffer

std::vector<uint8_t> SPRINT_LAYOUT_PARSER::m_buffer
private

Definition at line 206 of file sprint_layout_parser.h.

Referenced by Parse().

◆ m_end

const uint8_t* SPRINT_LAYOUT_PARSER::m_end = nullptr
private

◆ m_fileData

SPRINT_LAYOUT::FILE_DATA SPRINT_LAYOUT_PARSER::m_fileData
private

Definition at line 202 of file sprint_layout_parser.h.

Referenced by CreateBoard(), GetFileData(), Parse(), and parseTrailer().

◆ m_pos

const uint8_t* SPRINT_LAYOUT_PARSER::m_pos = nullptr
private

◆ m_start

const uint8_t* SPRINT_LAYOUT_PARSER::m_start = nullptr
private

Definition at line 204 of file sprint_layout_parser.h.

Referenced by Parse().


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