|
KiCad PCB EDA Suite
|
#include <pcad_sch_parser.h>
Public Member Functions | |
| PCAD_SCH_PARSER ()=default | |
| void | LoadFromFile (const wxString &aFilename, SCHEMATIC &aSchematic) |
Static Public Member Functions | |
| static XNODE * | FindChild (XNODE *aNode, const wxString &aTag) |
| static wxString | NodeText (XNODE *aNode) |
Private Member Functions | |
| void | parseHeader (XNODE *aNode, SCHEMATIC &aSchematic) |
| void | parseLibrary (XNODE *aNode, SCHEMATIC &aSchematic) |
| void | parseTextStyleDef (XNODE *aNode, SCHEMATIC &aSchematic) |
| void | parseSymbolDef (XNODE *aNode, SYMBOL_DEF &aSymDef) |
| void | parseCompDef (XNODE *aNode, COMP_DEF &aCompDef) |
| PIN | parsePin (XNODE *aNode) |
| LINE | parseLine (XNODE *aNode) |
| ARC | parseArc (XNODE *aNode) |
| ARC | parseTriplePointArc (XNODE *aNode) |
| POLY | parsePoly (XNODE *aNode) |
| ATTR | parseAttr (XNODE *aNode) |
| TEXT_ITEM | parseText (XNODE *aNode) |
| IEEE_SYMBOL | parseIeeeSymbol (XNODE *aNode) |
| void | parseNetlist (XNODE *aNode, SCHEMATIC &aSchematic) |
| void | parseSchematicDesign (XNODE *aNode, SCHEMATIC &aSchematic) |
| void | parseFieldSets (XNODE *aNode, SCHEMATIC &aSchematic) |
| void | parseSheet (XNODE *aNode, SHEET &aSheet) |
| WIRE | parseWire (XNODE *aNode) |
| BUS | parseBus (XNODE *aNode) |
| double | toMils (const wxString &aValue) const |
| std::vector< std::pair< double, double > > | collectPts (XNODE *aNode) const |
| bool | parsePt (XNODE *aNode, double &aX, double &aY) const |
| bool | parsePtNode (XNODE *aPtNode, double &aX, double &aY) const |
| double | childDouble (XNODE *aNode, const wxString &aTag, double aDefault=0.0) const |
Static Private Member Functions | |
| static wxString | childStr (XNODE *aNode, const wxString &aTag, const wxString &aDefault=wxEmptyString) |
| static bool | childFlag (XNODE *aNode, const wxString &aTag) |
| static JUSTIFY | parseJustify (const wxString &aValue) |
Private Attributes | |
| bool | m_isMetric = false |
Definition at line 306 of file pcad_sch_parser.h.
|
default |
|
private |
Definition at line 175 of file pcad_sch_parser.cpp.
References FindChild(), NodeText(), PCAD_SCH::splitMeasureTokens(), and toMils().
Referenced by parseArc(), parseIeeeSymbol(), parseLine(), parsePin(), parseTextStyleDef(), and parseTriplePointArc().
|
staticprivate |
Definition at line 85 of file pcad_sch_parser.cpp.
References childStr().
Referenced by parseBus(), parseIeeeSymbol(), parseSheet(), parseText(), parseTextStyleDef(), and parseWire().
|
staticprivate |
Definition at line 73 of file pcad_sch_parser.cpp.
References FindChild(), and NodeText().
Referenced by childFlag(), parseCompDef(), parseHeader(), parseLine(), parseNetlist(), parsePin(), parseSchematicDesign(), parseSheet(), parseSymbolDef(), parseText(), and parseTextStyleDef().
|
private |
Definition at line 205 of file pcad_sch_parser.cpp.
References XNODE::GetChildren(), XNODE::GetNext(), and parsePtNode().
Referenced by parseBus(), parseLine(), parsePoly(), parseTriplePointArc(), and parseWire().
Definition at line 40 of file pcad_sch_parser.cpp.
References XNODE::GetChildren(), and XNODE::GetNext().
Referenced by PCAD_SCH::childAngle(), childDouble(), childStr(), LoadFromFile(), parseBus(), parseCompDef(), parsePin(), parsePt(), parseSchematicDesign(), parseSheet(), and parseWire().
| void PCAD_SCH::PCAD_SCH_PARSER::LoadFromFile | ( | const wxString & | aFilename, |
| SCHEMATIC & | aSchematic ) |
Definition at line 248 of file pcad_sch_parser.cpp.
References _, PCAD_SCH::SCHEMATIC::compDefs, PCAD_SCH::SCHEMATIC::compDefsByName, PCAD_SCH::SCHEMATIC::compInsts, PCAD_SCH::SCHEMATIC::compInstsByRef, FindChild(), XNODE::GetChildren(), XNODE::GetNext(), header, PCAD2KICAD::LoadInputFile(), PCAD_SCH::COMP_DEF::name, PCAD_SCH::SYMBOL_DEF::name, PCAD_SCH::TEXT_STYLE::name, PCAD_SCH::COMP_DEF::originalName, PCAD_SCH::SYMBOL_DEF::originalName, parseFieldSets(), parseHeader(), parseLibrary(), parseNetlist(), parseSchematicDesign(), PCAD_SCH::COMP_INST::refDes, PCAD_SCH::SCHEMATIC::symbolDefs, PCAD_SCH::SCHEMATIC::symbolDefsByName, PCAD_SCH::SCHEMATIC::textStyles, PCAD_SCH::SCHEMATIC::textStylesByName, and THROW_IO_ERROR.
Referenced by SCH_IO_PCAD::ensureLoadedLibrary(), and SCH_IO_PCAD::LoadSchematicFile().
|
static |
Definition at line 59 of file pcad_sch_parser.cpp.
References name.
Referenced by PCAD_SCH::childAngle(), childDouble(), childStr(), parseIeeeSymbol(), parsePtNode(), parseSheet(), and parseWire().
Definition at line 566 of file pcad_sch_parser.cpp.
References PCAD_SCH::childAngle(), childDouble(), parsePt(), PCAD_SCH::ARC::radius, PCAD_SCH::ARC::startAngle, PCAD_SCH::ARC::sweepAngle, PCAD_SCH::ARC::width, PCAD_SCH::ARC::x, and PCAD_SCH::ARC::y.
Referenced by parseSheet(), and parseSymbolDef().
Definition at line 688 of file pcad_sch_parser.cpp.
References PCAD_SCH::ATTR::name, parseText(), PCAD_SCH::ATTR::placement, and PCAD_SCH::TEXT_ITEM::text.
Referenced by parseSheet(), and parseSymbolDef().
Definition at line 891 of file pcad_sch_parser.cpp.
References childFlag(), collectPts(), PCAD_SCH::BUS::dispName, FindChild(), PCAD_SCH::BUS::label, PCAD_SCH::BUS::name, parseText(), PCAD_SCH::BUS::pts, and PCAD_SCH::TEXT_ITEM::text.
Referenced by parseSheet().
Definition at line 423 of file pcad_sch_parser.cpp.
References PCAD_SCH::COMP_DEF::attachedPattern, PCAD_SCH::COMP_DEF::attachedSymbols, childStr(), PCAD_SCH::COMP_DEF::compPins, PCAD_SCH::COMP_DEF::description, FindChild(), XNODE::GetChildren(), XNODE::GetNext(), header, PCAD_SCH::COMP_DEF::isPower, name, PCAD_SCH::COMP_DEF::name, PCAD_SCH::COMP_DEF::numParts, PCAD_SCH::COMP_DEF::originalName, pin, and PCAD_SCH::COMP_DEF::refDesPrefix.
Referenced by parseLibrary().
Definition at line 814 of file pcad_sch_parser.cpp.
References PCAD_SCH::TITLE_SHEET::fields, XNODE::GetChildren(), XNODE::GetNext(), name, parseFieldSets(), PCAD_SCH::splitFieldDef(), and PCAD_SCH::SCHEMATIC::titleSheet.
Referenced by LoadFromFile(), and parseFieldSets().
Definition at line 301 of file pcad_sch_parser.cpp.
References childStr(), and m_isMetric.
Referenced by LoadFromFile().
|
private |
Definition at line 660 of file pcad_sch_parser.cpp.
References PCAD_SCH::ADDER, PCAD_SCH::AMPLIFIER, PCAD_SCH::ASTABLE, PCAD_SCH::childAngle(), childDouble(), childFlag(), PCAD_SCH::COMPLEX, PCAD_SCH::GENERATOR, PCAD_SCH::IEEE_SYMBOL::height, PCAD_SCH::HYSTERESIS, PCAD_SCH::IEEE_SYMBOL::isFlipped, PCAD_SCH::IEEE_SYMBOL::kind, PCAD_SCH::MULTIPLIER, NodeText(), parsePt(), PCAD_SCH::IEEE_SYMBOL::rotation, PCAD_SCH::IEEE_SYMBOL::x, and PCAD_SCH::IEEE_SYMBOL::y.
Referenced by parseSheet(), and parseSymbolDef().
|
staticprivate |
Definition at line 224 of file pcad_sch_parser.cpp.
References PCAD_SCH::CENTER, PCAD_SCH::LEFT, PCAD_SCH::LOWER_CENTER, PCAD_SCH::LOWER_LEFT, PCAD_SCH::LOWER_RIGHT, PCAD_SCH::RIGHT, PCAD_SCH::UPPER_CENTER, PCAD_SCH::UPPER_LEFT, and PCAD_SCH::UPPER_RIGHT.
Referenced by parseText().
Definition at line 311 of file pcad_sch_parser.cpp.
References PCAD_SCH::SCHEMATIC::compAliases, PCAD_SCH::SCHEMATIC::compDefs, XNODE::GetChildren(), XNODE::GetNext(), parseCompDef(), parseSymbolDef(), parseTextStyleDef(), and PCAD_SCH::SCHEMATIC::symbolDefs.
Referenced by LoadFromFile().
Definition at line 544 of file pcad_sch_parser.cpp.
References childDouble(), childStr(), collectPts(), PCAD_SCH::DASHED, PCAD_SCH::DOTTED, PCAD_SCH::LINE::pts, PCAD_SCH::LINE::style, and PCAD_SCH::LINE::width.
Referenced by parseSheet(), and parseSymbolDef().
Definition at line 709 of file pcad_sch_parser.cpp.
References childStr(), PCAD_SCH::SCHEMATIC::compInsts, PCAD_SCH::COMP_INST::compRef, XNODE::GetChildren(), XNODE::GetNext(), PCAD_SCH::COMP_INST::originalName, PCAD_SCH::COMP_INST::refDes, and PCAD_SCH::COMP_INST::value.
Referenced by LoadFromFile().
Definition at line 499 of file pcad_sch_parser.cpp.
References PCAD_SCH::childAngle(), childDouble(), childStr(), FindChild(), name, parsePt(), parseText(), and pin.
Referenced by parseSymbolDef().
Definition at line 625 of file pcad_sch_parser.cpp.
References collectPts(), and PCAD_SCH::POLY::pts.
Referenced by parseSheet(), and parseSymbolDef().
|
private |
Definition at line 169 of file pcad_sch_parser.cpp.
References FindChild(), and parsePtNode().
Referenced by parseArc(), parseIeeeSymbol(), parsePin(), parseSheet(), and parseText().
|
private |
Definition at line 153 of file pcad_sch_parser.cpp.
References NodeText(), PCAD_SCH::splitMeasureTokens(), and toMils().
Referenced by collectPts(), parsePt(), and parseSchematicDesign().
|
private |
Definition at line 731 of file pcad_sch_parser.cpp.
References childStr(), FindChild(), XNODE::GetChildren(), XNODE::GetNext(), header, PCAD_SCH::SHEET::name, parsePtNode(), parseSheet(), PCAD_SCH::SHEET::sheetNum, PCAD_SCH::SCHEMATIC::sheets, PCAD_SCH::SCHEMATIC::workspaceHeight, and PCAD_SCH::SCHEMATIC::workspaceWidth.
Referenced by LoadFromFile().
Definition at line 915 of file pcad_sch_parser.cpp.
References PCAD_SCH::SHEET::arcs, PCAD_SCH::SYMBOL_INST::attrs, PCAD_SCH::SHEET::busEntries, PCAD_SCH::SHEET::buses, PCAD_SCH::BUS_ENTRY::busNameRef, PCAD_SCH::childAngle(), childFlag(), childStr(), PCAD_SCH::SHEET::fields, FindChild(), XNODE::GetChildren(), XNODE::GetNext(), PCAD_SCH::SHEET::ieeeSymbols, PCAD_SCH::PORT::isFlipped, PCAD_SCH::SYMBOL_INST::isFlipped, PCAD_SCH::SHEET::junctions, PCAD_SCH::SHEET::lines, PCAD_SCH::FIELD_PLACEMENT::name, PCAD_SCH::JUNCTION::netName, PCAD_SCH::PORT::netNameRef, NodeText(), PCAD_SCH::BUS_ENTRY::orient, parseArc(), parseAttr(), parseBus(), parseIeeeSymbol(), parseLine(), parsePoly(), parsePt(), parseText(), parseTriplePointArc(), parseWire(), PCAD_SCH::SYMBOL_INST::partNum, PCAD_SCH::FIELD_PLACEMENT::placement, PCAD_SCH::SHEET::polys, PCAD_SCH::SHEET::ports, PCAD_SCH::PORT::portType, PCAD_SCH::BUS::pts, PCAD_SCH::LINE::pts, PCAD_SCH::POLY::pts, PCAD_SCH::WIRE::pts, PCAD_SCH::SYMBOL_INST::refDesRef, PCAD_SCH::PORT::rotation, PCAD_SCH::SYMBOL_INST::rotation, PCAD_SCH::SYMBOL_INST::symbolRef, PCAD_SCH::SHEET::symbols, PCAD_SCH::SHEET::texts, PCAD_SCH::SHEET::wires, PCAD_SCH::BUS_ENTRY::x, PCAD_SCH::JUNCTION::x, PCAD_SCH::PORT::x, PCAD_SCH::SYMBOL_INST::x, PCAD_SCH::BUS_ENTRY::y, PCAD_SCH::JUNCTION::y, PCAD_SCH::PORT::y, and PCAD_SCH::SYMBOL_INST::y.
Referenced by parseSchematicDesign().
|
private |
Definition at line 390 of file pcad_sch_parser.cpp.
References PCAD_SCH::SYMBOL_DEF::arcs, PCAD_SCH::SYMBOL_DEF::attrs, childStr(), XNODE::GetChildren(), XNODE::GetNext(), PCAD_SCH::SYMBOL_DEF::ieeeSymbols, PCAD_SCH::SYMBOL_DEF::lines, PCAD_SCH::SYMBOL_DEF::name, PCAD_SCH::SYMBOL_DEF::originalName, parseArc(), parseAttr(), parseIeeeSymbol(), parseLine(), parsePin(), parsePoly(), parseText(), parseTriplePointArc(), PCAD_SCH::SYMBOL_DEF::pins, PCAD_SCH::SYMBOL_DEF::polys, and PCAD_SCH::SYMBOL_DEF::texts.
Referenced by parseLibrary().
Definition at line 640 of file pcad_sch_parser.cpp.
References PCAD_SCH::childAngle(), childFlag(), childStr(), PCAD_SCH::TEXT_ITEM::isFlipped, PCAD_SCH::TEXT_ITEM::isVisible, PCAD_SCH::TEXT_ITEM::justify, parseJustify(), parsePt(), PCAD_SCH::TEXT_ITEM::rotation, PCAD_SCH::TEXT_ITEM::styleRef, PCAD_SCH::TEXT_ITEM::text, PCAD_SCH::TEXT_ITEM::x, and PCAD_SCH::TEXT_ITEM::y.
Referenced by parseAttr(), parseBus(), parsePin(), parseSheet(), parseSymbolDef(), and parseWire().
Definition at line 348 of file pcad_sch_parser.cpp.
References childDouble(), childFlag(), childStr(), PCAD_SCH::TEXT_STYLE::displayTType, XNODE::GetChildren(), XNODE::GetNext(), PCAD_SCH::TEXT_STYLE::hasTtfFont, PCAD_SCH::FONT::height, PCAD_SCH::FONT::isBold, PCAD_SCH::FONT::isItalic, PCAD_SCH::FONT::isTrueType, PCAD_SCH::TEXT_STYLE::name, PCAD_SCH::TEXT_STYLE::strokeFont, PCAD_SCH::FONT::strokeWidth, PCAD_SCH::SCHEMATIC::textStyles, and PCAD_SCH::TEXT_STYLE::ttfFont.
Referenced by parseLibrary().
Definition at line 585 of file pcad_sch_parser.cpp.
References childDouble(), collectPts(), M_PI, PCAD_SCH::ARC::radius, PCAD_SCH::ARC::startAngle, PCAD_SCH::ARC::sweepAngle, PCAD_SCH::ARC::width, PCAD_SCH::ARC::x, and PCAD_SCH::ARC::y.
Referenced by parseSheet(), and parseSymbolDef().
Definition at line 861 of file pcad_sch_parser.cpp.
References childFlag(), collectPts(), PCAD_SCH::WIRE::dispName, FindChild(), PCAD_SCH::WIRE::label, PCAD_SCH::WIRE::netName, NodeText(), parseText(), PCAD_SCH::WIRE::pts, and PCAD_SCH::TEXT_ITEM::text.
Referenced by parseSheet().
|
private |
Definition at line 97 of file pcad_sch_parser.cpp.
References m_isMetric.
Referenced by childDouble(), and parsePtNode().
|
private |
Definition at line 351 of file pcad_sch_parser.h.
Referenced by parseHeader(), and toMils().