KiCad PCB EDA Suite
|
Object to parser s-expression symbol library and schematic file formats. More...
#include <sch_io_kicad_sexpr_parser.h>
Public Member Functions | |
SCH_IO_KICAD_SEXPR_PARSER (LINE_READER *aLineReader=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr, unsigned aLineCount=0, SCH_SHEET *aRootSheet=nullptr, bool aIsAppending=false) | |
void | ParseLib (LIB_SYMBOL_MAP &aSymbolLibMap) |
LIB_SYMBOL * | ParseSymbol (LIB_SYMBOL_MAP &aSymbolLibMap, int aFileVersion=SEXPR_SYMBOL_LIB_FILE_VERSION) |
Parse internal LINE_READER object into symbols and return all found. | |
SCH_ITEM * | ParseSymbolDrawItem () |
void | ParseSchematic (SCH_SHEET *aSheet, bool aIsCopyablyOnly=false, int aFileVersion=SEXPR_SCHEMATIC_FILE_VERSION) |
Parse the internal LINE_READER object into aSheet. | |
int | GetParsedRequiredVersion () const |
Private Attributes | |
int | m_requiredVersion |
Set to the symbol library file version required. | |
wxString | m_generatorVersion |
int | m_unit |
The current unit being parsed. | |
int | m_bodyStyle |
The current body style being parsed. | |
wxString | m_symbolName |
The current symbol name. | |
bool | m_appending |
Appending load status. | |
std::set< KIID > | m_uuids |
PROGRESS_REPORTER * | m_progressReporter |
const LINE_READER * | m_lineReader |
unsigned | m_lastProgressLine |
unsigned | m_lineCount |
KIID | m_rootUuid |
SCH_SHEET * | m_rootSheet |
The rootsheet for full project loads or null for importing a schematic. | |
Object to parser s-expression symbol library and schematic file formats.
Definition at line 76 of file sch_io_kicad_sexpr_parser.h.
SCH_IO_KICAD_SEXPR_PARSER::SCH_IO_KICAD_SEXPR_PARSER | ( | LINE_READER * | aLineReader = nullptr , |
PROGRESS_REPORTER * | aProgressReporter = nullptr , |
||
unsigned | aLineCount = 0 , |
||
SCH_SHEET * | aRootSheet = nullptr , |
||
bool | aIsAppending = false |
||
) |
Definition at line 75 of file sch_io_kicad_sexpr_parser.cpp.
|
private |
Definition at line 93 of file sch_io_kicad_sexpr_parser.cpp.
References _, PROGRESS_REPORTER::KeepRefreshing(), LINE_READER::LineNumber(), m_lastProgressLine, m_lineCount, m_lineReader, m_progressReporter, PROGRESS_REPORTER::SetCurrentProgress(), and THROW_IO_ERROR.
Referenced by ParseSchematic().
|
inline |
Definition at line 113 of file sch_io_kicad_sexpr_parser.h.
References m_requiredVersion.
Referenced by SCH_IO_KICAD_SEXPR_LIB_CACHE::Load().
|
private |
Definition at line 128 of file sch_io_kicad_sexpr_parser.cpp.
Referenced by parseLibSymbol(), parsePinNames(), parsePinNumbers(), parseProperty(), ParseSchematic(), parseSchematicSymbol(), parseSchField(), parseSchTable(), parseSchText(), parseSchTextBoxContent(), parseSheet(), and parseSymbolPin().
|
private |
Definition at line 4753 of file sch_io_kicad_sexpr_parser.cpp.
References SCH_SCREEN::AddBusAlias(), ConvertToNewOverbarNotation(), and m_requiredVersion.
Referenced by ParseSchematic().
|
private |
Definition at line 3793 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, EDA_IU_SCALE::MilsToIU(), parseInternalUnits(), parseKIID(), parseStroke(), parseXY(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseSchematic().
|
private |
Definition at line 745 of file sch_io_kicad_sexpr_parser.cpp.
References _, color, ConvertToNewOverbarNotation(), EDA_TEXT::GetText(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, m_requiredVersion, parseDouble(), parseInt(), parseInternalUnits(), parseMaybeAbsentBool(), EDA_TEXT::SetBoldFlag(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetHyperlink(), EDA_TEXT::SetItalicFlag(), EDA_TEXT::SetLineSpacing(), EDA_TEXT::SetText(), EDA_TEXT::SetTextColor(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), EDA_TEXT::SetUnresolvedFontName(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), THROW_PARSE_ERROR, EDA_TEXT::ValidateHyperlink(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by parseProperty(), parseSchField(), parseSchSheetPin(), parseSchText(), parseSchTextBoxContent(), parseSymbolPin(), parseSymbolText(), and parseSymbolTextBox().
|
private |
Definition at line 686 of file sch_io_kicad_sexpr_parser.cpp.
References color, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, parseDouble(), and parseInt().
Referenced by parseSchArc(), parseSchBezier(), parseSchCircle(), parseSchPolyLine(), parseSchRectangle(), parseSchTextBoxContent(), parseSheet(), parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPolyLine(), parseSymbolRectangle(), and parseSymbolTextBox().
|
private |
Definition at line 883 of file sch_io_kicad_sexpr_parser.cpp.
References m_requiredVersion, and parseInt().
Referenced by ParseLib(), and ParseSchematic().
|
inlineprivate |
Definition at line 122 of file sch_io_kicad_sexpr_parser.h.
|
private |
Definition at line 3416 of file sch_io_kicad_sexpr_parser.cpp.
References _, REFERENCE_IMAGE::GetImage(), REFERENCE_IMAGE::GetImageScale(), BITMAP_BASE::GetPPI(), m_requiredVersion, parseDouble(), parseKIID(), parseXY(), REFERENCE_IMAGE::ReadImageFile(), scale, REFERENCE_IMAGE::SetImageScale(), and THROW_IO_ERROR.
Referenced by ParseSchematic().
|
inlineprivate |
Definition at line 128 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseEDA_TEXT(), parseFill(), parseHeader(), parseInt(), parseJunction(), parseProperty(), parseSchematicSymbol(), parseSchField(), parseSchSymbolInstances(), parseSchTable(), parseSchTextBoxContent(), parseSymbolPin(), and parseTITLE_BLOCK().
|
inlineprivate |
Definition at line 133 of file sch_io_kicad_sexpr_parser.h.
References parseInt().
|
private |
Definition at line 653 of file sch_io_kicad_sexpr_parser.cpp.
References EDA_IU_SCALE::IU_PER_MM, KiROUND(), parseDouble(), and schIUScale.
Referenced by parseBusEntry(), parseEDA_TEXT(), parseInternalUnits(), parseJunction(), parseMargins(), parsePinNames(), parseSchCircle(), parseSchTable(), parseSchText(), parseSheet(), parseSymbolArc(), parseSymbolCircle(), parseSymbolPin(), and parseXY().
|
private |
Definition at line 666 of file sch_io_kicad_sexpr_parser.cpp.
References EDA_IU_SCALE::IU_PER_MM, KiROUND(), parseDouble(), and schIUScale.
|
inlineprivate |
Definition at line 143 of file sch_io_kicad_sexpr_parser.h.
References parseInternalUnits().
|
private |
Definition at line 3700 of file sch_io_kicad_sexpr_parser.cpp.
References color, parseDouble(), parseInt(), parseInternalUnits(), parseKIID(), and parseXY().
Referenced by ParseSchematic().
|
private |
Definition at line 115 of file sch_io_kicad_sexpr_parser.cpp.
References m_uuids.
Referenced by parseBusEntry(), parseImage(), parseJunction(), parseLine(), parseNoConnect(), ParseSchematic(), parseSchematicSymbol(), parseSchPolyLine(), parseSchSheetPin(), parseSchText(), and parseSheet().
void SCH_IO_KICAD_SEXPR_PARSER::ParseLib | ( | LIB_SYMBOL_MAP & | aSymbolLibMap | ) |
Definition at line 177 of file sch_io_kicad_sexpr_parser.cpp.
References LIB_SYMBOL::GetName(), m_bodyStyle, m_generatorVersion, m_requiredVersion, m_unit, parseHeader(), parseLibSymbol(), and SEXPR_SYMBOL_LIB_FILE_VERSION.
Referenced by SCH_IO_KICAD_SEXPR_LIB_CACHE::Load().
|
private |
Definition at line 298 of file sch_io_kicad_sexpr_parser.cpp.
References _, DSN_STRING, m_bodyStyle, m_symbolName, m_unit, name, LIB_ID::Parse(), parseBool(), EMBEDDED_FILES_PARSER::ParseEmbedded(), parsePinNames(), parsePinNumbers(), parseProperty(), ParseSymbolDrawItem(), EDA_ITEM::SetParent(), THROW_PARSE_ERROR, and IO_ERROR::What().
Referenced by ParseLib(), ParseSchematic(), and ParseSymbol().
|
private |
Definition at line 3923 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, LAYER_BUS, LAYER_NOTES, LAYER_WIRE, EDA_IU_SCALE::MilsToIU(), parseKIID(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
inlineprivate |
Definition at line 184 of file sch_io_kicad_sexpr_parser.h.
References parseInternalUnits().
Referenced by parseSchTextBoxContent(), and parseSymbolTextBox().
|
private |
Parses a boolean flag inside a list that existed before boolean normalization.
For example, this will handle both (legacy_teardrops) and (legacy_teardrops yes). Call this after parsing the T_legacy_teardrops, and aDefaultValue will be returned for the first case, or true will be returned for the second case.
aDefaultValue | will be returned if the end of the list is encountered as the next token |
Definition at line 146 of file sch_io_kicad_sexpr_parser.cpp.
References DSN_RIGHT.
Referenced by parseEDA_TEXT(), parseProperty(), parseSchematicSymbol(), parseSchField(), parseSchText(), and parseSheet().
|
private |
Definition at line 3756 of file sch_io_kicad_sexpr_parser.cpp.
References parseKIID(), and parseXY().
Referenced by ParseSchematic().
|
private |
Definition at line 2069 of file sch_io_kicad_sexpr_parser.cpp.
References _, PAGE_INFO::Custom, m_requiredVersion, MAX_PAGE_SIZE_EESCHEMA_MM, MIN_PAGE_SIZE_MM, parseDouble(), PAGE_INFO::SetHeightMM(), PAGE_INFO::SetPortrait(), PAGE_INFO::SetType(), PAGE_INFO::SetWidthMM(), and THROW_PARSE_ERROR.
Referenced by ParseSchematic().
|
private |
(pin_names (offset 123) ; optional (hide yes/no) ; optional hide ; optional, pre-20241004 )
Definition at line 904 of file sch_io_kicad_sexpr_parser.cpp.
References parseBool(), and parseInternalUnits().
Referenced by parseLibSymbol().
|
private |
(pin_numbers (hide yes/no) ; optional hide ; optional (pre-20241004) )
Definition at line 952 of file sch_io_kicad_sexpr_parser.cpp.
References parseBool().
Referenced by parseLibSymbol().
|
private |
Definition at line 995 of file sch_io_kicad_sexpr_parser.cpp.
References _, DEGREES_T, GetCanonicalFieldName(), SCH_FIELD::GetCanonicalName(), m_requiredVersion, MANDATORY_FIELDS, name, parseBool(), parseDouble(), parseEDA_TEXT(), parseInt(), parseMaybeAbsentBool(), parseXY(), THROW_PARSE_ERROR, and UnescapeString().
Referenced by parseLibSymbol().
|
private |
Definition at line 3992 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, fixupSchFillMode(), FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 4218 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, fixupSchFillMode(), FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 4058 of file sch_io_kicad_sexpr_parser.cpp.
References center, circle(), DEFAULT_LINE_WIDTH_MILS, fixupSchFillMode(), FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseInternalUnits(), parseStroke(), parseXY(), radius, schIUScale, SHAPE_CIRCLE::SetCenter(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseSchematic().
void SCH_IO_KICAD_SEXPR_PARSER::ParseSchematic | ( | SCH_SHEET * | aSheet, |
bool | aIsCopyablyOnly = false , |
||
int | aFileVersion = SEXPR_SCHEMATIC_FILE_VERSION |
||
) |
Parse the internal LINE_READER object into aSheet.
When aIsCopyableOnly is true, only schematic objects that are viewable on the canvas for copy and paste purposes are parsed. Other schematic content such as bus definitions or instance data will throw an IO_ERROR exception.
When aIsCopyableOnly is false, full schematic file parsing is performed.
aSheet | The SCH_SHEET object to store the parsed schematic file. |
aIsCopyableOnly | Load only the schematic objects that can be copied into aSheet if true. Otherwise, load the full schematic file format. |
aFileVersion | The schematic file version to parser. Defaults to the schematic file being parsed when aIsCopyableOnly is false. |
Definition at line 2648 of file sch_io_kicad_sexpr_parser.cpp.
References _, SCH_SCREEN::AddLibSymbol(), SCH_SCREEN::Append(), checkpoint(), SHAPE_LINE_CHAIN::CPoint(), SCH_SCREEN::FixupEmbeddedData(), Fontconfig(), SCHEMATIC::GetEmbeddedFiles(), EMBEDDED_FILES::GetFontFiles(), EDA_SHAPE::GetPointCount(), EDA_SHAPE::GetPolyShape(), SCH_SHEET::GetScreen(), SCH_SHAPE::GetStroke(), SCH_SCREEN::GetUuid(), KI_FALLTHROUGH, LAYER_NOTES, m_generatorVersion, m_requiredVersion, m_rootSheet, m_rootUuid, SCH_SCREEN::m_uuid, EDA_ITEM::m_Uuid, SHAPE_POLY_SET::Outline(), parseBool(), parseBusAlias(), parseBusEntry(), EMBEDDED_FILES_PARSER::ParseEmbedded(), parseHeader(), parseImage(), parseJunction(), parseKIID(), parseLibSymbol(), parseLine(), parseNoConnect(), parsePAGE_INFO(), parseSchArc(), parseSchBezier(), parseSchCircle(), parseSchematicSymbol(), parseSchPolyLine(), parseSchRectangle(), parseSchRuleArea(), parseSchSheetInstances(), parseSchSymbolInstances(), parseSchTable(), parseSchText(), parseSchTextBox(), parseSheet(), parseTITLE_BLOCK(), Pgm(), SCH_SCREEN::Schematic(), EMBEDDED_FILES::SetAreFontsEmbedded(), SCH_LINE::SetEndPoint(), SCH_SCREEN::SetFileFormatVersionAtLoad(), SCH_SCREEN::SetLegacySymbolInstanceData(), SCH_SCREEN::SetPageSettings(), EDA_ITEM::SetParent(), SCH_LINE::SetStartPoint(), SCH_LINE::SetStroke(), SCH_SCREEN::SetTitleBlock(), SEXPR_SCHEMATIC_FILE_VERSION, THROW_PARSE_ERROR, SCH_SCREEN::UpdateLocalLibSymbolLinks(), and IO_ERROR::What().
Referenced by SCH_IO_KICAD_SEXPR::LoadContent(), SCH_IO_KICAD_SEXPR::loadFile(), and KI_TEST::LoadSheetSchematicContents().
|
private |
Definition at line 3020 of file sch_io_kicad_sexpr_parser.cpp.
References _, AUTOPLACE_AUTO, AUTOPLACE_NONE, SCH_FIELD::GetCanonicalName(), SCH_FIELD::GetId(), SCH_FIELD::GetName(), EDA_TEXT::GetText(), SCH_FIELD::IsMandatory(), SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_ProjectName, SCH_SYMBOL_INSTANCE::m_Reference, m_requiredVersion, SCH_SYMBOL_INSTANCE::m_Unit, name, LIB_ID::Parse(), parseBool(), parseDouble(), parseInt(), parseKIID(), parseMaybeAbsentBool(), parseSchField(), parseXY(), SIM_LEGACY_ENABLE_FIELD, SIM_LEGACY_ENABLE_FIELD_V7, SYM_MIRROR_X, SYM_MIRROR_Y, and THROW_PARSE_ERROR.
Referenced by ParseSchematic().
Definition at line 2225 of file sch_io_kicad_sexpr_parser.cpp.
References _, DEGREES_T, GetCanonicalFieldName(), GLOBALLABEL_MANDATORY_FIELDS, m_requiredVersion, MANDATORY_FIELDS, name, parseBool(), parseDouble(), parseEDA_TEXT(), parseInt(), parseMaybeAbsentBool(), parseXY(), SCH_GLOBAL_LABEL_T, SCH_SHEET_T, SCH_SYMBOL_T, SHEET_MANDATORY_FIELDS, THROW_PARSE_ERROR, and EDA_ITEM::Type().
Referenced by parseSchematicSymbol(), parseSchText(), and parseSheet().
|
private |
Definition at line 3857 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, fixupSchFillMode(), STROKE_PARAMS::GetLineStyle(), LAYER_NOTES, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_requiredVersion, EDA_IU_SCALE::MilsToIU(), parseFill(), parseKIID(), parseStroke(), parseXY(), schIUScale, and STROKE_PARAMS::SetLineStyle().
Referenced by ParseSchematic(), and parseSchRuleArea().
|
private |
Definition at line 4119 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, fixupSchFillMode(), FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 4175 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, EDA_IU_SCALE::MilsToIU(), SHAPE_POLY_SET::Outline(), parseSchPolyLine(), schIUScale, and SHAPE_LINE_CHAIN::SetClosed().
Referenced by ParseSchematic().
|
private |
Definition at line 2464 of file sch_io_kicad_sexpr_parser.cpp.
References SCH_SCREEN::GetFileFormatVersionAtLoad(), SCH_SHEET::GetScreen(), m_appending, SCH_SHEET_INSTANCE::m_PageNumber, SCH_SHEET_INSTANCE::m_Path, m_rootUuid, SCH_SCREEN::m_sheetInstances, SCH_SHEET_PATH::push_back(), BASE_SCREEN::SetContentModified(), and SCH_SHEET_PATH::SetPageNumber().
Referenced by ParseSchematic().
|
private |
Definition at line 2378 of file sch_io_kicad_sexpr_parser.cpp.
References _, name, parseDouble(), parseEDA_TEXT(), parseKIID(), parseXY(), and THROW_PARSE_ERROR.
Referenced by parseSheet().
|
private |
Definition at line 2561 of file sch_io_kicad_sexpr_parser.cpp.
References m_appending, SCH_SYMBOL_INSTANCE::m_Footprint, SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_Reference, m_requiredVersion, m_rootUuid, SCH_SCREEN::m_symbolInstances, SCH_SYMBOL_INSTANCE::m_Unit, SCH_SYMBOL_INSTANCE::m_Value, NilUuid(), and parseInt().
Referenced by ParseSchematic().
|
private |
Definition at line 4617 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, EDA_IU_SCALE::MilsToIU(), parseBool(), parseInt(), parseInternalUnits(), parseSchTableCell(), parseStroke(), schIUScale, and table.
Referenced by ParseSchematic().
|
private |
Definition at line 4473 of file sch_io_kicad_sexpr_parser.cpp.
References parseSchTextBoxContent().
Referenced by parseSchTable().
|
private |
Definition at line 4294 of file sch_io_kicad_sexpr_parser.cpp.
References AUTOPLACE_AUTO, AUTOPLACE_NONE, SPIN_STYLE::BOTTOM, DEGREES_T, SCH_GLOBALLABEL::GetField(), SCH_LABEL_BASE::GetFields(), SCH_FIELD::GetId(), SCH_FIELD::IsMandatory(), SPIN_STYLE::LEFT, parseBool(), parseDouble(), parseEDA_TEXT(), parseInternalUnits(), parseKIID(), parseMaybeAbsentBool(), parseSchField(), parseXY(), SPIN_STYLE::RIGHT, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_LABEL_T, SCH_TEXT_T, SCH_ITEM::SetFieldsAutoplaced(), SCH_DIRECTIVE_LABEL::SetPinLength(), SCH_LABEL_BASE::SetShape(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetVisible(), text, and SPIN_STYLE::UP.
Referenced by ParseSchematic().
|
private |
Definition at line 4460 of file sch_io_kicad_sexpr_parser.cpp.
References parseSchTextBoxContent().
Referenced by ParseSchematic().
|
private |
Definition at line 4486 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, DEGREES_T, end, fixupSchFillMode(), SCH_TEXTBOX::GetLegacyTextMargin(), left, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_ITEM::m_Uuid, EDA_IU_SCALE::MilsToIU(), parseBool(), parseDouble(), parseEDA_TEXT(), parseFill(), parseInt(), parseMargins(), parseStroke(), parseXY(), right, schIUScale, EDA_SHAPE::SetEnd(), SCH_TEXTBOX::SetExcludedFromSim(), EDA_SHAPE::SetFillColor(), EDA_SHAPE::SetFillMode(), SCH_TEXTBOX::SetMarginBottom(), SCH_TEXTBOX::SetMarginLeft(), SCH_TEXTBOX::SetMarginRight(), SCH_TEXTBOX::SetMarginTop(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), EDA_TEXT::SetText(), and EDA_TEXT::SetTextAngle().
Referenced by parseSchTableCell(), and parseSchTextBox().
|
private |
Definition at line 3498 of file sch_io_kicad_sexpr_parser.cpp.
References AUTOPLACE_AUTO, AUTOPLACE_NONE, DEFAULT_LINE_WIDTH_MILS, STROKE_PARAMS::GetColor(), STROKE_PARAMS::GetWidth(), FILL_PARAMS::m_Color, SCH_SHEET_INSTANCE::m_PageNumber, SCH_SHEET_INSTANCE::m_Path, SCH_SHEET_INSTANCE::m_ProjectName, m_requiredVersion, EDA_IU_SCALE::MilsToIU(), parseBool(), parseFill(), parseInternalUnits(), parseKIID(), parseMaybeAbsentBool(), parseSchField(), parseSchSheetPin(), parseStroke(), parseXY(), schIUScale, SCH_FIELD::setId(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseSchematic().
|
private |
Parse stroke definition aStroke.
aStrokeDef | A reference to the STROKE_PARAMS structure to write to. |
Definition at line 676 of file sch_io_kicad_sexpr_parser.cpp.
References EDA_IU_SCALE::IU_PER_MM, STROKE_PARAMS_PARSER::ParseStroke(), and schIUScale.
Referenced by parseBusEntry(), parseLine(), parseSchArc(), parseSchBezier(), parseSchCircle(), parseSchPolyLine(), parseSchRectangle(), parseSchTable(), parseSchTextBoxContent(), parseSheet(), parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPolyLine(), parseSymbolRectangle(), and parseSymbolTextBox().
LIB_SYMBOL * SCH_IO_KICAD_SEXPR_PARSER::ParseSymbol | ( | LIB_SYMBOL_MAP & | aSymbolLibMap, |
int | aFileVersion = SEXPR_SYMBOL_LIB_FILE_VERSION |
||
) |
Parse internal LINE_READER object into symbols and return all found.
Definition at line 258 of file sch_io_kicad_sexpr_parser.cpp.
References _, LIB_SYMBOL::GetEmbeddedFiles(), m_requiredVersion, parseLibSymbol(), LIB_SYMBOL::RunOnChildren(), THROW_PARSE_ERROR, and EMBEDDED_FILES::UpdateFontFiles().
Referenced by SCH_IO_KICAD_SEXPR::ParseLibSymbols().
|
private |
Definition at line 1192 of file sch_io_kicad_sexpr_parser.cpp.
References ANGLE_0, ANGLE_180, ANGLE_360, ANGLE_90, CalcArcCenter(), center, DEFAULT_LINE_WIDTH_MILS, DEGREES_T, LAYER_DEVICE, m_bodyStyle, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_requiredVersion, m_unit, EDA_IU_SCALE::MilsToIU(), EDA_ANGLE::Normalize(), parseDouble(), parseFill(), parseInternalUnits(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 1385 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, LAYER_DEVICE, m_bodyStyle, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_unit, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 1466 of file sch_io_kicad_sexpr_parser.cpp.
References center, circle(), DEFAULT_LINE_WIDTH_MILS, LAYER_DEVICE, m_bodyStyle, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_unit, EDA_IU_SCALE::MilsToIU(), parseFill(), parseInternalUnits(), parseStroke(), parseXY(), radius, schIUScale, SHAPE_CIRCLE::SetCenter(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseSymbolDrawItem().
SCH_ITEM * SCH_IO_KICAD_SEXPR_PARSER::ParseSymbolDrawItem | ( | ) |
Definition at line 634 of file sch_io_kicad_sexpr_parser.cpp.
References parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPin(), parseSymbolPolyLine(), parseSymbolRectangle(), parseSymbolText(), and parseSymbolTextBox().
Referenced by parseLibSymbol().
|
private |
Definition at line 1532 of file sch_io_kicad_sexpr_parser.cpp.
References _, ConvertToNewOverbarNotation(), m_bodyStyle, SCH_PIN::ALT::m_Name, m_requiredVersion, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, m_unit, parseBool(), parseEDA_TEXT(), parseInt(), parseInternalUnits(), parseXY(), pin, schIUScale, text, and THROW_PARSE_ERROR.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 1758 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, LAYER_DEVICE, m_bodyStyle, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_unit, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 1826 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, LAYER_DEVICE, m_bodyStyle, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_unit, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 1886 of file sch_io_kicad_sexpr_parser.cpp.
References _, LAYER_DEVICE, m_bodyStyle, m_unit, parseDouble(), parseEDA_TEXT(), parseXY(), TENTHS_OF_A_DEGREE_T, text, and THROW_PARSE_ERROR.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 1946 of file sch_io_kicad_sexpr_parser.cpp.
References _, DEFAULT_LINE_WIDTH_MILS, DEGREES_T, end, LAYER_DEVICE, left, m_bodyStyle, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, m_unit, EDA_IU_SCALE::MilsToIU(), parseDouble(), parseEDA_TEXT(), parseFill(), parseMargins(), parseStroke(), parseXY(), right, schIUScale, and THROW_PARSE_ERROR.
Referenced by ParseSymbolDrawItem().
|
private |
Definition at line 2121 of file sch_io_kicad_sexpr_parser.cpp.
References _, parseInt(), TITLE_BLOCK::SetComment(), TITLE_BLOCK::SetCompany(), TITLE_BLOCK::SetDate(), TITLE_BLOCK::SetRevision(), TITLE_BLOCK::SetTitle(), and THROW_PARSE_ERROR.
Referenced by ParseSchematic().
|
inlineprivate |
Definition at line 148 of file sch_io_kicad_sexpr_parser.h.
References parseInternalUnits(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by parseBusEntry(), parseImage(), parseJunction(), parseLine(), parseNoConnect(), parseProperty(), parseSchArc(), parseSchBezier(), parseSchCircle(), parseSchematicSymbol(), parseSchField(), parseSchPolyLine(), parseSchRectangle(), parseSchSheetPin(), parseSchText(), parseSchTextBoxContent(), parseSheet(), parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPin(), parseSymbolPolyLine(), parseSymbolRectangle(), parseSymbolText(), and parseSymbolTextBox().
|
private |
Appending load status.
Definition at line 241 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseSchSheetInstances(), and parseSchSymbolInstances().
|
private |
The current body style being parsed.
Definition at line 239 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseLib(), parseLibSymbol(), parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPin(), parseSymbolPolyLine(), parseSymbolRectangle(), parseSymbolText(), and parseSymbolTextBox().
|
private |
Definition at line 237 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseLib(), and ParseSchematic().
|
private |
Definition at line 247 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Definition at line 248 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Definition at line 246 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Definition at line 245 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Set to the symbol library file version required.
Definition at line 236 of file sch_io_kicad_sexpr_parser.h.
Referenced by GetParsedRequiredVersion(), parseBusAlias(), parseEDA_TEXT(), parseHeader(), parseImage(), ParseLib(), parsePAGE_INFO(), parseProperty(), ParseSchematic(), parseSchematicSymbol(), parseSchField(), parseSchPolyLine(), parseSchSymbolInstances(), parseSheet(), ParseSymbol(), parseSymbolArc(), and parseSymbolPin().
|
private |
The rootsheet for full project loads or null for importing a schematic.
Definition at line 253 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseSchematic().
|
private |
Definition at line 250 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseSchematic(), parseSchSheetInstances(), and parseSchSymbolInstances().
|
private |
The current symbol name.
Definition at line 240 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseLibSymbol().
|
private |
The current unit being parsed.
Definition at line 238 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseLib(), parseLibSymbol(), parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPin(), parseSymbolPolyLine(), parseSymbolRectangle(), parseSymbolText(), and parseSymbolTextBox().
|
private |
Definition at line 243 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseKIID().