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< int > | m_fieldIDsRead |
Field IDs that have been read so far for the current symbol. | |
std::set< KIID > | m_uuids |
std::map< EDA_TEXT *, std::tuple< wxString, bool, bool > > | m_fontTextMap |
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(), ParseSchematic(), parseSchematicSymbol(), parseSchTable(), parseSchText(), parseSchTextBoxContent(), parseSheet(), and parseSymbolPin().
|
private |
Definition at line 4690 of file sch_io_kicad_sexpr_parser.cpp.
References SCH_SCREEN::AddBusAlias(), ConvertToNewOverbarNotation(), and m_requiredVersion.
Referenced by ParseSchematic().
|
private |
Definition at line 3739 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 689 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_fontTextMap, 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::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 634 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 831 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 3342 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 601 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 614 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 3646 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 294 of file sch_io_kicad_sexpr_parser.cpp.
References _, m_bodyStyle, m_fieldIDsRead, m_symbolName, m_unit, MANDATORY_FIELDS, 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 3858 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 3702 of file sch_io_kicad_sexpr_parser.cpp.
References parseKIID(), and parseXY().
Referenced by ParseSchematic().
|
private |
Definition at line 2012 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 852 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 900 of file sch_io_kicad_sexpr_parser.cpp.
References parseBool().
Referenced by parseLibSymbol().
|
private |
Definition at line 943 of file sch_io_kicad_sexpr_parser.cpp.
References _, DEGREES_T, GetCanonicalFieldName(), SCH_FIELD::GetCanonicalName(), m_fieldIDsRead, MANDATORY_FIELDS, name, parseDouble(), parseEDA_TEXT(), parseInt(), parseMaybeAbsentBool(), parseXY(), THROW_PARSE_ERROR, UnescapeString(), and VALUE_FIELD.
Referenced by parseLibSymbol().
|
private |
Definition at line 3927 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 4150 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 3992 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseInternalUnits(), parseStroke(), parseXY(), schIUScale, 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 2571 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(), KIFONT::FONT::GetFont(), EMBEDDED_FILES::GetFontFiles(), EDA_SHAPE::GetPointCount(), EDA_SHAPE::GetPolyShape(), SCH_SHEET::GetScreen(), SCH_SHAPE::GetStroke(), SCH_SCREEN::GetUuid(), KI_FALLTHROUGH, LAYER_NOTES, m_fontTextMap, 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, text, THROW_PARSE_ERROR, LIB_SYMBOL::UpdateFieldOrdinals(), EMBEDDED_FILES::UpdateFontFiles(), 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 2951 of file sch_io_kicad_sexpr_parser.cpp.
References _, SCH_FIELD::GetCanonicalName(), SCH_FIELD::GetId(), EDA_TEXT::GetText(), m_fieldIDsRead, SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_ProjectName, SCH_SYMBOL_INSTANCE::m_Reference, m_requiredVersion, SCH_SYMBOL_INSTANCE::m_Unit, MANDATORY_FIELDS, name, LIB_ID::Parse(), parseBool(), parseDouble(), parseInt(), parseKIID(), parseMaybeAbsentBool(), parseSchField(), parseXY(), REFERENCE_FIELD, removeEntryInFontTextMap(), SCH_FIELD::SetId(), 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 2168 of file sch_io_kicad_sexpr_parser.cpp.
References _, DEGREES_T, GetCanonicalFieldName(), SCH_SHEET::GetDefaultFieldName(), MANDATORY_FIELDS, name, parseDouble(), parseEDA_TEXT(), parseInt(), parseMaybeAbsentBool(), parseXY(), SCH_SHEET_T, SCH_SYMBOL_T, SHEET_MANDATORY_FIELDS, SHEETFILENAME, SHEETNAME, THROW_PARSE_ERROR, EDA_ITEM::Type(), and VALUE_FIELD.
Referenced by parseSchematicSymbol(), parseSchText(), and parseSheet().
|
private |
Definition at line 3793 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, 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 4052 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, FILL_PARAMS::m_Color, FILL_PARAMS::m_FillType, EDA_IU_SCALE::MilsToIU(), parseFill(), parseStroke(), parseXY(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 4107 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 2397 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 2311 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 2494 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_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 4554 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, EDA_IU_SCALE::MilsToIU(), parseBool(), parseInt(), parseInternalUnits(), parseSchTableCell(), parseStroke(), and schIUScale.
Referenced by ParseSchematic().
|
private |
Definition at line 4411 of file sch_io_kicad_sexpr_parser.cpp.
References parseSchTextBoxContent().
Referenced by parseSchTable().
|
private |
Definition at line 4225 of file sch_io_kicad_sexpr_parser.cpp.
References SPIN_STYLE::BOTTOM, DEGREES_T, SCH_LABEL_BASE::GetFields(), SCH_FIELD::GetInternalName(), SPIN_STYLE::LEFT, parseBool(), parseDouble(), parseEDA_TEXT(), parseInternalUnits(), parseKIID(), parseMaybeAbsentBool(), parseSchField(), parseXY(), removeEntryInFontTextMap(), SPIN_STYLE::RIGHT, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_LABEL_T, SCH_TEXT_T, SCH_ITEM::SetFieldsAutoplaced(), SCH_FIELD::SetId(), 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 4398 of file sch_io_kicad_sexpr_parser.cpp.
References parseSchTextBoxContent().
Referenced by ParseSchematic().
|
private |
Definition at line 4424 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, DEGREES_T, 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 3424 of file sch_io_kicad_sexpr_parser.cpp.
References DEFAULT_LINE_WIDTH_MILS, STROKE_PARAMS::GetColor(), SCH_FIELD::GetId(), 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(), removeEntryInFontTextMap(), schIUScale, SCH_FIELD::SetId(), SHEET_MANDATORY_FIELDS, SHEETFILENAME, SHEETNAME, 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 624 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(), KIFONT::FONT::GetFont(), m_fontTextMap, m_requiredVersion, parseLibSymbol(), text, THROW_PARSE_ERROR, and EMBEDDED_FILES::UpdateFontFiles().
Referenced by SCH_IO_KICAD_SEXPR::ParseLibSymbols().
|
private |
Definition at line 1153 of file sch_io_kicad_sexpr_parser.cpp.
References ANGLE_0, ANGLE_180, ANGLE_360, ANGLE_90, CalcArcCenter(), 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 1340 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 1421 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(), parseInternalUnits(), parseStroke(), parseXY(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseSymbolDrawItem().
SCH_ITEM * SCH_IO_KICAD_SEXPR_PARSER::ParseSymbolDrawItem | ( | ) |
Definition at line 582 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 1487 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 1705 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 1773 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 1833 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 1889 of file sch_io_kicad_sexpr_parser.cpp.
References _, DEFAULT_LINE_WIDTH_MILS, DEGREES_T, 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 2064 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 |
Remove aEntry from m_fontTextMap.
If aCandidate is not null, set the aCandidate font from the font of aEntry if aReplaceInList is true, aCandidate will replace aEntry in m_fontTextMap
Definition at line 4739 of file sch_io_kicad_sexpr_parser.cpp.
References KIFONT::FONT::GetFont(), m_fontTextMap, and EDA_TEXT::SetFont().
Referenced by parseSchematicSymbol(), parseSchText(), and parseSheet().
|
private |
Appending load status.
Definition at line 248 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseSchSheetInstances(), and parseSchSymbolInstances().
|
private |
The current body style being parsed.
Definition at line 246 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseLib(), parseLibSymbol(), parseSymbolArc(), parseSymbolBezier(), parseSymbolCircle(), parseSymbolPin(), parseSymbolPolyLine(), parseSymbolRectangle(), parseSymbolText(), and parseSymbolTextBox().
|
private |
Field IDs that have been read so far for the current symbol.
Definition at line 251 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseLibSymbol(), parseProperty(), and parseSchematicSymbol().
|
private |
Definition at line 255 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseEDA_TEXT(), ParseSchematic(), ParseSymbol(), and removeEntryInFontTextMap().
|
private |
Definition at line 244 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseLib(), and ParseSchematic().
|
private |
Definition at line 259 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Definition at line 260 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Definition at line 258 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Definition at line 257 of file sch_io_kicad_sexpr_parser.h.
Referenced by checkpoint().
|
private |
Set to the symbol library file version required.
Definition at line 243 of file sch_io_kicad_sexpr_parser.h.
Referenced by GetParsedRequiredVersion(), parseBusAlias(), parseEDA_TEXT(), parseHeader(), parseImage(), ParseLib(), parsePAGE_INFO(), ParseSchematic(), parseSchematicSymbol(), parseSchPolyLine(), parseSheet(), ParseSymbol(), parseSymbolArc(), and parseSymbolPin().
|
private |
The rootsheet for full project loads or null for importing a schematic.
Definition at line 265 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseSchematic().
|
private |
Definition at line 262 of file sch_io_kicad_sexpr_parser.h.
Referenced by ParseSchematic(), parseSchSheetInstances(), and parseSchSymbolInstances().
|
private |
The current symbol name.
Definition at line 247 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseLibSymbol().
|
private |
The current unit being parsed.
Definition at line 245 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 253 of file sch_io_kicad_sexpr_parser.h.
Referenced by parseKIID().