KiCad PCB EDA Suite
|
#include <map>
#include <memory>
#include <unordered_map>
#include <wx/xml/xml.h>
#include <wx/string.h>
#include <wx/filename.h>
#include <layer_ids.h>
#include <trigo.h>
#include <core/wx_stl_compat.h>
Go to the source code of this file.
Classes | |
struct | XML_PARSER_ERROR |
Implement a simple wrapper around runtime_error to isolate the errors thrown by the Eagle XML parser. More... | |
struct | TRIPLET |
segment (element) of our XPATH into the Eagle XML document tree in PTREE form. More... | |
class | XPATH |
Keep track of what we are working on within a PTREE. More... | |
class | OPTIONAL_XML_ATTRIBUTE< T > |
Model an optional XML attribute. More... | |
struct | ECOORD |
struct | ENET |
Eagle net. More... | |
struct | EROT |
Eagle rotation. More... | |
struct | EWIRE |
Eagle wire. More... | |
struct | EJUNCTION |
Eagle Junction. More... | |
struct | ELABEL |
Eagle label. More... | |
struct | EVIA |
Eagle via. More... | |
struct | ECIRCLE |
Eagle circle. More... | |
struct | ERECT |
Eagle XML rectangle in binary. More... | |
struct | EATTR |
Parse an Eagle "attribute" XML element. More... | |
struct | EDIMENSION |
Eagle dimension element. More... | |
struct | ETEXT |
Eagle text element. More... | |
struct | EFRAME |
Parse an Eagle frame element. More... | |
struct | EPAD_COMMON |
Structure holding common properties for through-hole and SMD pads. More... | |
struct | EPAD |
Eagle thru hole pad. More... | |
struct | ESMD |
Eagle SMD pad. More... | |
struct | EPIN |
Eagle pin element. More... | |
struct | EVERTEX |
Eagle vertex. More... | |
struct | EPOLYGON |
Eagle polygon, without vertices which are parsed as needed. More... | |
struct | EHOLE |
Eagle hole element. More... | |
struct | EELEMENT |
Eagle element element. More... | |
struct | ELAYER |
struct | EAGLE_LAYER |
struct | EPART |
struct | EINSTANCE |
struct | EGATE |
struct | ECONNECT |
struct | EDEVICE |
struct | EDEVICE_SET |
struct | ECLASS |
Typedefs | |
typedef std::unordered_map< wxString, wxXmlNode * > | NODE_MAP |
typedef std::map< wxString, EINSTANCE * > | EINSTANCE_MAP |
typedef std::map< wxString, std::unique_ptr< EPART > > | EPART_MAP |
Translates Eagle special characters to their counterparts in KiCad. More... | |
typedef OPTIONAL_XML_ATTRIBUTE< wxString > | opt_wxString |
typedef OPTIONAL_XML_ATTRIBUTE< int > | opt_int |
typedef OPTIONAL_XML_ATTRIBUTE< double > | opt_double |
typedef OPTIONAL_XML_ATTRIBUTE< bool > | opt_bool |
typedef OPTIONAL_XML_ATTRIBUTE< EROT > | opt_erot |
typedef OPTIONAL_XML_ATTRIBUTE< ECOORD > | opt_ecoord |
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) |
static wxXmlNode * | getChildrenNodes (NODE_MAP &aMap, const wxString &aName) |
template<typename T > | |
T | Convert (const wxString &aValue) |
Convert a wxString to a generic type T. More... | |
template<> | |
wxString | Convert< wxString > (const wxString &aValue) |
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) |
typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP |
Definition at line 50 of file eagle_parser.h.
Translates Eagle special characters to their counterparts in KiCad.
Definition at line 51 of file eagle_parser.h.
typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP |
Definition at line 49 of file eagle_parser.h.
typedef OPTIONAL_XML_ATTRIBUTE<bool> opt_bool |
Definition at line 374 of file eagle_parser.h.
typedef OPTIONAL_XML_ATTRIBUTE<double> opt_double |
Definition at line 373 of file eagle_parser.h.
typedef OPTIONAL_XML_ATTRIBUTE<ECOORD> opt_ecoord |
Definition at line 376 of file eagle_parser.h.
typedef OPTIONAL_XML_ATTRIBUTE<EROT> opt_erot |
Definition at line 375 of file eagle_parser.h.
typedef OPTIONAL_XML_ATTRIBUTE<int> opt_int |
Definition at line 372 of file eagle_parser.h.
typedef OPTIONAL_XML_ATTRIBUTE<wxString> opt_wxString |
Definition at line 371 of file eagle_parser.h.
T Convert | ( | const wxString & | aValue | ) |
Convert a wxString to a generic type T.
aValue | is a wxString containing the value that will be converted to type T. |
XML_PARSER_ERROR | - an exception is thrown if the parsing fails or if the conversion to type T is unknown. |
Definition at line 178 of file eagle_parser.h.
wxString Convert< wxString > | ( | const wxString & | aValue | ) |
Definition at line 234 of file eagle_parser.cpp.
Definition at line 368 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 escapeName | ( | const wxString & | aNetName | ) |
Interprets special characters in Eagle text and converts them to KiCAD notation.
Definition at line 40 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().
|
inlinestatic |
Definition at line 62 of file eagle_parser.h.
Referenced by SCH_EAGLE_PLUGIN::countNets(), EDEVICE::EDEVICE(), SCH_EAGLE_PLUGIN::loadLibrary(), SCH_EAGLE_PLUGIN::loadSchematic(), and SCH_EAGLE_PLUGIN::loadSheet().
wxString interpretText | ( | const wxString & | aText | ) |
Translates Eagle special text reference to a KiCad variable reference.
Definition at line 50 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 344 of file eagle_parser.cpp.
Referenced by EAGLE_PLUGIN::cacheLib(), SCH_EAGLE_PLUGIN::countNets(), EDEVICE::EDEVICE(), SCH_EAGLE_PLUGIN::Load(), EAGLE_PLUGIN::loadAllSections(), SCH_EAGLE_PLUGIN::loadDrawing(), EAGLE_PLUGIN::loadLibrary(), SCH_EAGLE_PLUGIN::loadLibrary(), SCH_EAGLE_PLUGIN::loadSchematic(), SCH_EAGLE_PLUGIN::loadSegments(), and SCH_EAGLE_PLUGIN::loadSheet().
bool substituteVariable | ( | wxString * | aText | ) |
Definition at line 117 of file eagle_parser.cpp.
Referenced by interpretText().