KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PADS_IO::PARSER Class Reference

#include <pads_parser.h>

Public Member Functions

 PARSER ()
 
 ~PARSER ()
 
void Parse (const wxString &aFileName)
 
const PARAMETERSGetParameters () const
 
const std::vector< PART > & GetParts () const
 
const std::vector< NET > & GetNets () const
 
const std::vector< ROUTE > & GetRoutes () const
 
const std::vector< TEXT > & GetTexts () const
 
const std::vector< LINE > & GetLines () const
 
const std::vector< POLYLINE > & GetBoardOutlines () const
 
const std::vector< POUR > & GetPours () const
 
const std::map< std::string, VIA_DEF > & GetViaDefs () const
 
const std::map< std::string, PART_DECAL > & GetPartDecals () const
 
const std::map< std::string, PART_TYPE > & GetPartTypes () const
 
const std::map< std::string, std::map< std::string, std::string > > & GetPartInstanceAttrs () const
 
const std::map< std::string, REUSE_BLOCK > & GetReuseBlocks () const
 
const std::vector< CLUSTER > & GetClusters () const
 
const std::vector< TEST_POINT > & GetTestPoints () const
 
const std::vector< DIMENSION > & GetDimensions () const
 
const DESIGN_RULESGetDesignRules () const
 
const std::vector< NET_CLASS_DEF > & GetNetClasses () const
 
const std::vector< DIFF_PAIR_DEF > & GetDiffPairs () const
 
const std::vector< KEEPOUT > & GetKeepouts () const
 
const std::vector< JUMPER_DEF > & GetJumperDefs () const
 
const std::vector< COPPER_SHAPE > & GetCopperShapes () const
 
const std::vector< GRAPHIC_LINE > & GetGraphicLines () const
 
const FILE_HEADERGetFileHeader () const
 
bool IsBasicUnits () const
 
std::vector< LAYER_INFOGetLayerInfos () const
 Get layer information for layer mapping dialog.
 

Private Member Functions

void parseLine (const std::string &aLine)
 
void parseSectionPCB (std::ifstream &aStream)
 
void parseSectionPARTS (std::ifstream &aStream)
 
void parseSectionNETS (std::ifstream &aStream)
 
void parseSectionROUTES (std::ifstream &aStream)
 
void parseSectionTEXT (std::ifstream &aStream)
 
void parseSectionBOARD (std::ifstream &aStream)
 
void parseSectionLINES (std::ifstream &aStream)
 
void parseSectionVIA (std::ifstream &aStream)
 
void parseSectionPOUR (std::ifstream &aStream)
 
void parseSectionPARTDECAL (std::ifstream &aStream)
 
void parseSectionPARTTYPE (std::ifstream &aStream)
 
void parseSectionREUSE (std::ifstream &aStream)
 
void parseSectionCLUSTER (std::ifstream &aStream)
 
void parseSectionJUMPER (std::ifstream &aStream)
 
void parseSectionTESTPOINT (std::ifstream &aStream)
 
void parseSectionNETCLASS (std::ifstream &aStream)
 
void parseSectionDIFFPAIR (std::ifstream &aStream)
 
void parseSectionLAYERDEFS (std::ifstream &aStream)
 
void parseSectionMISC (std::ifstream &aStream)
 
void clampDesignRuleSentinels ()
 
bool readLine (std::ifstream &aStream, std::string &aLine)
 
void pushBackLine (const std::string &aLine)
 

Private Attributes

PARAMETERS m_parameters
 
std::vector< PARTm_parts
 
std::vector< NETm_nets
 
std::vector< ROUTEm_routes
 
std::vector< TEXTm_texts
 
std::vector< LINEm_lines
 
std::vector< POLYLINEm_board_outlines
 
std::vector< POURm_pours
 
std::map< std::string, VIA_DEFm_via_defs
 
std::map< std::string, PART_DECALm_decals
 
std::map< std::string, PART_TYPEm_part_types
 Per-instance attribute overrides from PART <name> {...} blocks in PARTTYPE section.
 
std::map< std::string, std::map< std::string, std::string > > m_part_instance_attrs
 
std::map< std::string, REUSE_BLOCKm_reuse_blocks
 
std::vector< CLUSTERm_clusters
 
std::vector< TEST_POINTm_test_points
 
std::vector< DIMENSIONm_dimensions
 
DESIGN_RULES m_design_rules
 
std::vector< NET_CLASS_DEFm_net_classes
 
std::vector< DIFF_PAIR_DEFm_diff_pairs
 
std::vector< KEEPOUTm_keepouts
 
std::vector< JUMPER_DEFm_jumper_defs
 Jumper definitions from JUMPER section.
 
std::vector< COPPER_SHAPEm_copper_shapes
 Copper shapes from LINES section.
 
std::vector< GRAPHIC_LINEm_graphic_lines
 2D graphic lines from LINES section
 
std::map< int, LAYER_INFOm_layer_defs
 Parsed layer definitions by layer number.
 
FILE_HEADER m_file_header
 Parsed file header info.
 
bool m_is_basic_units = false
 
std::string m_current_section
 
std::optional< std::string > m_pushed_line
 

Detailed Description

Definition at line 714 of file pads_parser.h.

Constructor & Destructor Documentation

◆ PARSER()

PADS_IO::PARSER::PARSER ( )

Definition at line 100 of file pads_parser.cpp.

◆ ~PARSER()

PADS_IO::PARSER::~PARSER ( )

Definition at line 104 of file pads_parser.cpp.

Member Function Documentation

◆ clampDesignRuleSentinels()

void PADS_IO::PARSER::clampDesignRuleSentinels ( )
private

◆ GetBoardOutlines()

const std::vector< POLYLINE > & PADS_IO::PARSER::GetBoardOutlines ( ) const
inline

Definition at line 728 of file pads_parser.h.

References m_board_outlines.

◆ GetClusters()

const std::vector< CLUSTER > & PADS_IO::PARSER::GetClusters ( ) const
inline

Definition at line 738 of file pads_parser.h.

References m_clusters.

◆ GetCopperShapes()

const std::vector< COPPER_SHAPE > & PADS_IO::PARSER::GetCopperShapes ( ) const
inline

Definition at line 746 of file pads_parser.h.

References m_copper_shapes.

◆ GetDesignRules()

const DESIGN_RULES & PADS_IO::PARSER::GetDesignRules ( ) const
inline

Definition at line 741 of file pads_parser.h.

References m_design_rules.

◆ GetDiffPairs()

const std::vector< DIFF_PAIR_DEF > & PADS_IO::PARSER::GetDiffPairs ( ) const
inline

Definition at line 743 of file pads_parser.h.

References m_diff_pairs.

◆ GetDimensions()

const std::vector< DIMENSION > & PADS_IO::PARSER::GetDimensions ( ) const
inline

Definition at line 740 of file pads_parser.h.

References m_dimensions.

◆ GetFileHeader()

const FILE_HEADER & PADS_IO::PARSER::GetFileHeader ( ) const
inline

Definition at line 748 of file pads_parser.h.

References m_file_header.

◆ GetGraphicLines()

const std::vector< GRAPHIC_LINE > & PADS_IO::PARSER::GetGraphicLines ( ) const
inline

Definition at line 747 of file pads_parser.h.

References m_graphic_lines.

◆ GetJumperDefs()

const std::vector< JUMPER_DEF > & PADS_IO::PARSER::GetJumperDefs ( ) const
inline

Definition at line 745 of file pads_parser.h.

References m_jumper_defs.

◆ GetKeepouts()

const std::vector< KEEPOUT > & PADS_IO::PARSER::GetKeepouts ( ) const
inline

Definition at line 744 of file pads_parser.h.

References m_keepouts.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetLayerInfos()

std::vector< LAYER_INFO > PADS_IO::PARSER::GetLayerInfos ( ) const

Get layer information for layer mapping dialog.

This generates layer info based on the parsed file header information. Call after Parse() to get accurate layer information.

Definition at line 4782 of file pads_parser.cpp.

References PADS_IO::ASSEMBLY, info, m_layer_defs, m_parameters, PADS_IO::PASTE_MASK, PADS_IO::ROUTING, PADS_IO::SILK_SCREEN, and PADS_IO::SOLDER_MASK.

◆ GetLines()

const std::vector< LINE > & PADS_IO::PARSER::GetLines ( ) const
inline

Definition at line 727 of file pads_parser.h.

References m_lines.

◆ GetNetClasses()

const std::vector< NET_CLASS_DEF > & PADS_IO::PARSER::GetNetClasses ( ) const
inline

Definition at line 742 of file pads_parser.h.

References m_net_classes.

◆ GetNets()

const std::vector< NET > & PADS_IO::PARSER::GetNets ( ) const
inline

Definition at line 724 of file pads_parser.h.

References m_nets.

◆ GetParameters()

const PARAMETERS & PADS_IO::PARSER::GetParameters ( ) const
inline

Definition at line 722 of file pads_parser.h.

References m_parameters.

◆ GetPartDecals()

const std::map< std::string, PART_DECAL > & PADS_IO::PARSER::GetPartDecals ( ) const
inline

Definition at line 731 of file pads_parser.h.

References m_decals.

◆ GetPartInstanceAttrs()

const std::map< std::string, std::map< std::string, std::string > > & PADS_IO::PARSER::GetPartInstanceAttrs ( ) const
inline

Definition at line 733 of file pads_parser.h.

References m_part_instance_attrs.

◆ GetParts()

const std::vector< PART > & PADS_IO::PARSER::GetParts ( ) const
inline

Definition at line 723 of file pads_parser.h.

References m_parts.

◆ GetPartTypes()

const std::map< std::string, PART_TYPE > & PADS_IO::PARSER::GetPartTypes ( ) const
inline

Definition at line 732 of file pads_parser.h.

References m_part_types.

◆ GetPours()

const std::vector< POUR > & PADS_IO::PARSER::GetPours ( ) const
inline

Definition at line 729 of file pads_parser.h.

References m_pours.

◆ GetReuseBlocks()

const std::map< std::string, REUSE_BLOCK > & PADS_IO::PARSER::GetReuseBlocks ( ) const
inline

Definition at line 737 of file pads_parser.h.

References m_reuse_blocks.

◆ GetRoutes()

const std::vector< ROUTE > & PADS_IO::PARSER::GetRoutes ( ) const
inline

Definition at line 725 of file pads_parser.h.

References m_routes.

◆ GetTestPoints()

const std::vector< TEST_POINT > & PADS_IO::PARSER::GetTestPoints ( ) const
inline

Definition at line 739 of file pads_parser.h.

References m_test_points.

◆ GetTexts()

const std::vector< TEXT > & PADS_IO::PARSER::GetTexts ( ) const
inline

Definition at line 726 of file pads_parser.h.

References m_texts.

◆ GetViaDefs()

const std::map< std::string, VIA_DEF > & PADS_IO::PARSER::GetViaDefs ( ) const
inline

Definition at line 730 of file pads_parser.h.

References m_via_defs.

◆ IsBasicUnits()

bool PADS_IO::PARSER::IsBasicUnits ( ) const
inline

Definition at line 749 of file pads_parser.h.

References m_is_basic_units.

◆ Parse()

◆ parseLine()

void PADS_IO::PARSER::parseLine ( const std::string & aLine)
private

◆ parseSectionBOARD()

void PADS_IO::PARSER::parseSectionBOARD ( std::ifstream & aStream)
private

◆ parseSectionCLUSTER()

void PADS_IO::PARSER::parseSectionCLUSTER ( std::ifstream & aStream)
private

◆ parseSectionDIFFPAIR()

void PADS_IO::PARSER::parseSectionDIFFPAIR ( std::ifstream & aStream)
private

◆ parseSectionJUMPER()

◆ parseSectionLAYERDEFS()

◆ parseSectionLINES()

void PADS_IO::PARSER::parseSectionLINES ( std::ifstream & aStream)
private

Definition at line 2662 of file pads_parser.cpp.

References std::abs(), PADS_IO::ALL, PADS_IO::GRAPHIC_LINE::closed, PADS_IO::POLYLINE::closed, PADS_IO::DIMENSION::crossbar_pos, PADS_IO::ARC::cx, PADS_IO::COPPER_SHAPE::filled, PADS_IO::KEEPOUT::height_restriction, PADS_IO::COPPER_SHAPE::is_cutout, PADS_IO::DIMENSION::is_horizontal, PADS_IO::COPPER_SHAPE::layer, PADS_IO::DIMENSION::layer, PADS_IO::GRAPHIC_LINE::layer, PADS_IO::POLYLINE::layer, PADS_IO::KEEPOUT::layers, m_board_outlines, m_copper_shapes, m_dimensions, m_graphic_lines, m_keepouts, M_PI, m_texts, PADS_IO::KEEPOUT::max_height, name, PADS_IO::COPPER_SHAPE::name, PADS_IO::DIMENSION::name, PADS_IO::GRAPHIC_LINE::name, PADS_IO::COPPER_SHAPE::net_name, PADS_IO::KEEPOUT::no_accordion, PADS_IO::KEEPOUT::no_components, PADS_IO::KEEPOUT::no_copper, PADS_IO::KEEPOUT::no_test_points, PADS_IO::KEEPOUT::no_traces, PADS_IO::KEEPOUT::no_vias, PADS_IO::COPPER_SHAPE::outline, PADS_IO::KEEPOUT::outline, PADS_IO::PLACEMENT, PADS_IO::DIMENSION::points, PADS_IO::GRAPHIC_LINE::points, PADS_IO::POLYLINE::points, pushBackLine(), radius, readLine(), PADS_IO::GRAPHIC_LINE::reuse_instance, PADS_IO::DIMENSION::rotation, PADS_IO::ROUTE, text, PADS_IO::DIMENSION::text, PADS_IO::DIMENSION::text_height, PADS_IO::DIMENSION::text_width, PADS_IO::KEEPOUT::type, PADS_IO::VIA, PADS_IO::COPPER_SHAPE::width, PADS_IO::GRAPHIC_LINE::width, PADS_IO::POLYLINE::width, PADS_IO::DIMENSION::x, PADS_IO::POINT::x, and PADS_IO::DIMENSION::y.

Referenced by Parse().

◆ parseSectionMISC()

◆ parseSectionNETCLASS()

◆ parseSectionNETS()

void PADS_IO::PARSER::parseSectionNETS ( std::ifstream & aStream)
private

◆ parseSectionPARTDECAL()

void PADS_IO::PARSER::parseSectionPARTDECAL ( std::ifstream & aStream)
private

Definition at line 1336 of file pads_parser.cpp.

References PADS_IO::PART_DECAL::attributes, PADS_IO::PAD_STACK_LAYER::chamfered, PADS_IO::PAD_STACK_LAYER::corner_radius, PADS_IO::ARC::cx, PADS_IO::PAD_STACK_LAYER::drill, PADS_IO::PAD_STACK_LAYER::finger_offset, PADS_IO::ATTRIBUTE::font_info, PADS_IO::ATTRIBUTE::height, PADS_IO::ATTRIBUTE::hjust, PADS_IO::PAD_STACK_LAYER::inner_diameter, PADS_IO::DECAL_ITEM::is_tag_close, PADS_IO::DECAL_ITEM::is_tag_open, PADS_IO::PART_DECAL::items, PADS_IO::DECAL_ITEM::layer, PADS_IO::PAD_STACK_LAYER::layer, PADS_IO::ATTRIBUTE::level, m_decals, M_PI, PADS_IO::ATTRIBUTE::mirrored, name, PADS_IO::ATTRIBUTE::name, PADS_IO::PART_DECAL::name, PADS_IO::TERMINAL::name, PADS_IO::ATTRIBUTE::orientation, PADS_IO::PART_DECAL::pad_stacks, PADS_COMMON::ParseDouble(), PADS_IO::DECAL_ITEM::pinnum, PADS_IO::PAD_STACK_LAYER::plated, PADS_IO::DECAL_ITEM::points, pushBackLine(), radius, readLine(), PADS_IO::DECAL_ITEM::restrictions, PADS_IO::ATTRIBUTE::right_reading, PADS_IO::PAD_STACK_LAYER::rotation, PADS_IO::PAD_STACK_LAYER::shape, PADS_IO::PAD_STACK_LAYER::sizeA, PADS_IO::PAD_STACK_LAYER::sizeB, PADS_IO::PAD_STACK_LAYER::slot_length, PADS_IO::PAD_STACK_LAYER::slot_offset, PADS_IO::PAD_STACK_LAYER::slot_orientation, PADS_IO::PART_DECAL::terminals, PADS_IO::PAD_STACK_LAYER::thermal_outer_diameter, PADS_IO::PAD_STACK_LAYER::thermal_spoke_count, PADS_IO::PAD_STACK_LAYER::thermal_spoke_orientation, PADS_IO::PAD_STACK_LAYER::thermal_spoke_width, PADS_IO::DECAL_ITEM::type, PADS_IO::PART_DECAL::units, PADS_IO::ATTRIBUTE::visible, PADS_IO::ATTRIBUTE::vjust, PADS_IO::ATTRIBUTE::width, PADS_IO::DECAL_ITEM::width, PADS_IO::ATTRIBUTE::x, PADS_IO::TERMINAL::x, PADS_IO::ATTRIBUTE::y, and PADS_IO::TERMINAL::y.

Referenced by Parse().

◆ parseSectionPARTS()

◆ parseSectionPARTTYPE()

◆ parseSectionPCB()

void PADS_IO::PARSER::parseSectionPCB ( std::ifstream & aStream)
private

◆ parseSectionPOUR()

◆ parseSectionREUSE()

◆ parseSectionROUTES()

◆ parseSectionTESTPOINT()

void PADS_IO::PARSER::parseSectionTESTPOINT ( std::ifstream & aStream)
private

Definition at line 4111 of file pads_parser.cpp.

References m_test_points, pushBackLine(), readLine(), and tp.

Referenced by Parse().

◆ parseSectionTEXT()

void PADS_IO::PARSER::parseSectionTEXT ( std::ifstream & aStream)
private

◆ parseSectionVIA()

◆ pushBackLine()

◆ readLine()

Member Data Documentation

◆ m_board_outlines

std::vector<POLYLINE> PADS_IO::PARSER::m_board_outlines
private

Definition at line 792 of file pads_parser.h.

Referenced by GetBoardOutlines(), parseSectionBOARD(), and parseSectionLINES().

◆ m_clusters

std::vector<CLUSTER> PADS_IO::PARSER::m_clusters
private

Definition at line 801 of file pads_parser.h.

Referenced by GetClusters(), and parseSectionCLUSTER().

◆ m_copper_shapes

std::vector<COPPER_SHAPE> PADS_IO::PARSER::m_copper_shapes
private

Copper shapes from LINES section.

Definition at line 809 of file pads_parser.h.

Referenced by GetCopperShapes(), and parseSectionLINES().

◆ m_current_section

std::string PADS_IO::PARSER::m_current_section
private

Definition at line 815 of file pads_parser.h.

◆ m_decals

std::map<std::string, PART_DECAL> PADS_IO::PARSER::m_decals
private

Definition at line 795 of file pads_parser.h.

Referenced by GetPartDecals(), and parseSectionPARTDECAL().

◆ m_design_rules

DESIGN_RULES PADS_IO::PARSER::m_design_rules
private

◆ m_diff_pairs

std::vector<DIFF_PAIR_DEF> PADS_IO::PARSER::m_diff_pairs
private

Definition at line 806 of file pads_parser.h.

Referenced by GetDiffPairs(), parseSectionDIFFPAIR(), and parseSectionMISC().

◆ m_dimensions

std::vector<DIMENSION> PADS_IO::PARSER::m_dimensions
private

Definition at line 803 of file pads_parser.h.

Referenced by GetDimensions(), and parseSectionLINES().

◆ m_file_header

FILE_HEADER PADS_IO::PARSER::m_file_header
private

Parsed file header info.

Definition at line 812 of file pads_parser.h.

Referenced by GetFileHeader(), Parse(), and parseSectionTEXT().

◆ m_graphic_lines

std::vector<GRAPHIC_LINE> PADS_IO::PARSER::m_graphic_lines
private

2D graphic lines from LINES section

Definition at line 810 of file pads_parser.h.

Referenced by GetGraphicLines(), and parseSectionLINES().

◆ m_is_basic_units

bool PADS_IO::PARSER::m_is_basic_units = false
private

Definition at line 813 of file pads_parser.h.

Referenced by IsBasicUnits(), and Parse().

◆ m_jumper_defs

std::vector<JUMPER_DEF> PADS_IO::PARSER::m_jumper_defs
private

Jumper definitions from JUMPER section.

Definition at line 808 of file pads_parser.h.

Referenced by GetJumperDefs(), and parseSectionJUMPER().

◆ m_keepouts

std::vector<KEEPOUT> PADS_IO::PARSER::m_keepouts
private

Definition at line 807 of file pads_parser.h.

Referenced by GetKeepouts(), and parseSectionLINES().

◆ m_layer_defs

std::map<int, LAYER_INFO> PADS_IO::PARSER::m_layer_defs
private

Parsed layer definitions by layer number.

Definition at line 811 of file pads_parser.h.

Referenced by GetLayerInfos(), and parseSectionLAYERDEFS().

◆ m_lines

std::vector<LINE> PADS_IO::PARSER::m_lines
private

Definition at line 791 of file pads_parser.h.

Referenced by GetLines().

◆ m_net_classes

std::vector<NET_CLASS_DEF> PADS_IO::PARSER::m_net_classes
private

Definition at line 805 of file pads_parser.h.

Referenced by GetNetClasses(), parseSectionMISC(), and parseSectionNETCLASS().

◆ m_nets

std::vector<NET> PADS_IO::PARSER::m_nets
private

Definition at line 788 of file pads_parser.h.

Referenced by GetNets(), and parseSectionNETS().

◆ m_parameters

PARAMETERS PADS_IO::PARSER::m_parameters
private

◆ m_part_instance_attrs

std::map<std::string, std::map<std::string, std::string> > PADS_IO::PARSER::m_part_instance_attrs
private

Definition at line 799 of file pads_parser.h.

Referenced by GetPartInstanceAttrs(), and parseSectionMISC().

◆ m_part_types

std::map<std::string, PART_TYPE> PADS_IO::PARSER::m_part_types
private

Per-instance attribute overrides from PART <name> {...} blocks in PARTTYPE section.

Definition at line 796 of file pads_parser.h.

Referenced by GetPartTypes(), and parseSectionPARTTYPE().

◆ m_parts

std::vector<PART> PADS_IO::PARSER::m_parts
private

Definition at line 787 of file pads_parser.h.

Referenced by GetParts(), and parseSectionPARTS().

◆ m_pours

std::vector<POUR> PADS_IO::PARSER::m_pours
private

Definition at line 793 of file pads_parser.h.

Referenced by GetPours(), and parseSectionPOUR().

◆ m_pushed_line

std::optional<std::string> PADS_IO::PARSER::m_pushed_line
private

Definition at line 816 of file pads_parser.h.

Referenced by pushBackLine(), and readLine().

◆ m_reuse_blocks

std::map<std::string, REUSE_BLOCK> PADS_IO::PARSER::m_reuse_blocks
private

Definition at line 800 of file pads_parser.h.

Referenced by GetReuseBlocks(), and parseSectionREUSE().

◆ m_routes

std::vector<ROUTE> PADS_IO::PARSER::m_routes
private

Definition at line 789 of file pads_parser.h.

Referenced by GetRoutes(), and parseSectionROUTES().

◆ m_test_points

std::vector<TEST_POINT> PADS_IO::PARSER::m_test_points
private

Definition at line 802 of file pads_parser.h.

Referenced by GetTestPoints(), and parseSectionTESTPOINT().

◆ m_texts

std::vector<TEXT> PADS_IO::PARSER::m_texts
private

Definition at line 790 of file pads_parser.h.

Referenced by GetTexts(), parseSectionLINES(), and parseSectionTEXT().

◆ m_via_defs

std::map<std::string, VIA_DEF> PADS_IO::PARSER::m_via_defs
private

Definition at line 794 of file pads_parser.h.

Referenced by GetViaDefs(), parseSectionROUTES(), and parseSectionVIA().


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