KiCad PCB EDA Suite
|
#include <plugins/eagle/eagle_parser.h>
#include <string_utils.h>
#include <richio.h>
#include <wx/log.h>
#include <wx/regex.h>
#include <functional>
#include <cstdio>
Go to the source code of this file.
Functions | |
wxString | escapeName (const wxString &aNetName) |
Interprets special characters in Eagle text and converts them to KiCAD notation. More... | |
wxString | interpretText (const wxString &aText) |
Translates Eagle special text reference to a KiCad variable reference. More... | |
bool | substituteVariable (wxString *aText) |
Converts Eagle's HTML description into KiCad description format. More... | |
wxString | convertDescription (wxString aDescr) |
template<> | |
wxString | Convert< wxString > (const wxString &aValue) |
template<> | |
std::string | Convert< std::string > (const wxString &aValue) |
template<> | |
double | Convert< double > (const wxString &aValue) |
template<> | |
int | Convert< int > (const wxString &aValue) |
template<> | |
bool | Convert< bool > (const wxString &aValue) |
template<> | |
EROT | Convert< EROT > (const wxString &aRot) |
parse an Eagle XML "rot" field. More... | |
template<> | |
ECOORD | Convert< ECOORD > (const wxString &aCoord) |
template<typename T > | |
T | parseRequiredAttribute (wxXmlNode *aNode, const wxString &aAttribute) |
Parse aAttribute of the XML node aNode. More... | |
template<typename T > | |
OPTIONAL_XML_ATTRIBUTE< T > | parseOptionalAttribute (wxXmlNode *aNode, const wxString &aAttribute) |
Parse option aAttribute of the XML node aNode. More... | |
NODE_MAP | MapChildren (wxXmlNode *aCurrentNode) |
Provide an easy access to the children of an XML node via their names. More... | |
VECTOR2I | ConvertArcCenter (const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle) |
static int | parseAlignment (const wxString &aAlignment) |
Variables | |
constexpr auto | DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT |
bool Convert< bool > | ( | const wxString & | aValue | ) |
Definition at line 302 of file eagle_parser.cpp.
double Convert< double > | ( | const wxString & | aValue | ) |
Definition at line 279 of file eagle_parser.cpp.
Definition at line 333 of file eagle_parser.cpp.
References ECOORD::EU_MM.
parse an Eagle XML "rot" field.
Unfortunately the DTD seems not to explain this format very well. [S][M]R<degrees>. Examples: "R90", "MR180", "SR180"
Definition at line 316 of file eagle_parser.cpp.
References EROT::degrees, EROT::mirror, and EROT::spin.
int Convert< int > | ( | const wxString & | aValue | ) |
Definition at line 292 of file eagle_parser.cpp.
std::string Convert< std::string > | ( | const wxString & | aValue | ) |
Definition at line 272 of file eagle_parser.cpp.
wxString Convert< wxString > | ( | const wxString & | aValue | ) |
Definition at line 265 of file eagle_parser.cpp.
Definition at line 399 of file eagle_parser.cpp.
References _, DEG2RAD(), THROW_IO_ERROR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), SCH_EAGLE_PLUGIN::loadSymbolWire(), SCH_EAGLE_PLUGIN::loadWire(), EAGLE_PLUGIN::packagePolygon(), and EAGLE_PLUGIN::packageWire().
wxString convertDescription | ( | wxString | aDescr | ) |
Definition at line 149 of file eagle_parser.cpp.
References RemoveHTMLTags().
Referenced by SCH_EAGLE_PLUGIN::loadLibrary(), and EAGLE_PLUGIN::makeFootprint().
wxString escapeName | ( | const wxString & | aNetName | ) |
Interprets special characters in Eagle text and converts them to KiCAD notation.
Definition at line 41 of file eagle_parser.cpp.
References ConvertToNewOverbarNotation().
Referenced by SCH_EAGLE_PLUGIN::loadLabel(), SCH_EAGLE_PLUGIN::loadPlainText(), SCH_EAGLE_PLUGIN::loadSegments(), EAGLE_PLUGIN::loadSignals(), and SCH_EAGLE_PLUGIN::loadSymbol().
wxString interpretText | ( | const wxString & | aText | ) |
Translates Eagle special text reference to a KiCad variable reference.
Definition at line 51 of file eagle_parser.cpp.
References substituteVariable(), and text.
Referenced by EAGLE_PLUGIN::loadPlain(), SCH_EAGLE_PLUGIN::loadPlainText(), SCH_EAGLE_PLUGIN::loadSymbolText(), and EAGLE_PLUGIN::packageText().
NODE_MAP MapChildren | ( | wxXmlNode * | aCurrentNode | ) |
Provide an easy access to the children of an XML node via their names.
currentNode | is a pointer to a wxXmlNode, whose children will be mapped. |
Definition at line 375 of file eagle_parser.cpp.
Referenced by EAGLE_PLUGIN::cacheLib(), SCH_EAGLE_PLUGIN::countNets(), EDEVICE::EDEVICE(), SCH_EAGLE_PLUGIN::ensureLoadedLibrary(), EAGLE_PLUGIN::loadAllSections(), SCH_EAGLE_PLUGIN::loadDrawing(), EAGLE_PLUGIN::loadLibrary(), SCH_EAGLE_PLUGIN::loadLibrary(), SCH_EAGLE_PLUGIN::loadSchematic(), SCH_EAGLE_PLUGIN::LoadSchematicFile(), SCH_EAGLE_PLUGIN::loadSegments(), and SCH_EAGLE_PLUGIN::loadSheet().
|
static |
Definition at line 426 of file eagle_parser.cpp.
References ETEXT::BOTTOM_CENTER, ETEXT::BOTTOM_LEFT, ETEXT::BOTTOM_RIGHT, ETEXT::CENTER, ETEXT::CENTER_LEFT, ETEXT::CENTER_RIGHT, DEFAULT_ALIGNMENT, ETEXT::TOP_CENTER, ETEXT::TOP_LEFT, and ETEXT::TOP_RIGHT.
Referenced by EATTR::EATTR(), and ETEXT::ETEXT().
OPTIONAL_XML_ATTRIBUTE< T > parseOptionalAttribute | ( | wxXmlNode * | aNode, |
const wxString & | aAttribute | ||
) |
Parse option aAttribute of the XML node aNode.
aNode | is the node whose attribute will be parsed. |
aAttribute | is the attribute that will be parsed. |
Definition at line 369 of file eagle_parser.cpp.
T parseRequiredAttribute | ( | wxXmlNode * | aNode, |
const wxString & | aAttribute | ||
) |
Parse aAttribute of the XML node aNode.
aNode | is the node whose attribute will be parsed. |
aAttribute | is the attribute that will be parsed. |
XML_PARSER_ERROR | - exception thrown if the required attribute is missing |
Definition at line 349 of file eagle_parser.cpp.
bool substituteVariable | ( | wxString * | aText | ) |
Converts Eagle's HTML description into KiCad description format.
Definition at line 118 of file eagle_parser.cpp.
Referenced by interpretText().
|
constexpr |
Definition at line 38 of file eagle_parser.cpp.
Referenced by EATTR::EATTR(), ETEXT::ETEXT(), and parseAlignment().