| 
    KiCad PCB EDA Suite
    
   | 
 
#include <io/eagle/eagle_parser.h>#include <core/profile.h>#include <io/io_base.h>#include <string_utils.h>#include <richio.h>#include <trace_helpers.h>#include <wx/log.h>#include <wx/regex.h>#include <wx/tokenzr.h>#include <functional>#include <cstdio>#include <array>Go to the source code of this file.
Functions | |
| wxString | escapeName (const wxString &aNetName) | 
| Translates Eagle special characters to their counterparts in KiCad.   | |
| wxString | interpretText (const wxString &aText) | 
| Interprets special characters in Eagle text and converts them to KiCAD notation.   | |
| bool | substituteVariable (wxString *aText) | 
| Translates Eagle special text reference to a KiCad variable reference.   | |
| wxString | convertDescription (wxString aDescr) | 
| Converts Eagle's HTML description into KiCad description format.   | |
| size_t | GetNodeCount (const wxXmlNode *aNode) | 
| Fetch the number of XML nodes within aNode.   | |
| 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.   | |
| template<> | |
| ECOORD | Convert< ECOORD > (const wxString &aCoord) | 
| template<> | |
| EURN | Convert< EURN > (const wxString &aUrn) | 
| template<typename T> | |
| T | parseRequiredAttribute (wxXmlNode *aNode, const wxString &aAttribute) | 
| Parse aAttribute of the XML node aNode.   | |
| template<typename T> | |
| OPTIONAL_XML_ATTRIBUTE< T > | parseOptionalAttribute (wxXmlNode *aNode, const wxString &aAttribute) | 
| Parse option aAttribute of the XML node aNode.   | |
| NODE_MAP | MapChildren (wxXmlNode *aCurrentNode) | 
| Provide an easy access to the children of an XML node via their names.   | |
| VECTOR2I | ConvertArcCenter (const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle) | 
| Convert an Eagle curve end to a KiCad center for S_ARC.   | |
| static int | parseAlignment (const wxString &aAlignment) | 
Variables | |
| constexpr auto | DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT | 
| bool Convert< bool > | ( | const wxString & | aValue | ) | 
Definition at line 390 of file eagle_parser.cpp.
| double Convert< double > | ( | const wxString & | aValue | ) | 
Definition at line 367 of file eagle_parser.cpp.
Definition at line 439 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 404 of file eagle_parser.cpp.
References EROT::degrees, EROT::mirror, and EROT::spin.
Definition at line 447 of file eagle_parser.cpp.
| int Convert< int > | ( | const wxString & | aValue | ) | 
Definition at line 380 of file eagle_parser.cpp.
| std::string Convert< std::string > | ( | const wxString & | aValue | ) | 
Definition at line 360 of file eagle_parser.cpp.
| wxString Convert< wxString > | ( | const wxString & | aValue | ) | 
Definition at line 353 of file eagle_parser.cpp.
Convert an Eagle curve end to a KiCad center for S_ARC.
Definition at line 514 of file eagle_parser.cpp.
References _, center, DEG2RAD(), THROW_IO_ERROR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_IO_EAGLE::loadPlain(), PCB_IO_EAGLE::loadPolygon(), PCB_IO_EAGLE::loadSignals(), SCH_IO_EAGLE::loadSymbolWire(), SCH_IO_EAGLE::loadWire(), PCB_IO_EAGLE::packagePolygon(), and PCB_IO_EAGLE::packageWire().
| wxString convertDescription | ( | wxString | aDescr | ) | 
Converts Eagle's HTML description into KiCad description format.
Definition at line 155 of file eagle_parser.cpp.
References RemoveHTMLTags().
Referenced by SCH_IO_EAGLE::loadLibrary(), and PCB_IO_EAGLE::makeFootprint().
| wxString escapeName | ( | const wxString & | aNetName | ) | 
Translates Eagle special characters to their counterparts in KiCad.
Definition at line 47 of file eagle_parser.cpp.
References ConvertToNewOverbarNotation().
Referenced by SCH_IO_EAGLE::loadLabel(), SCH_IO_EAGLE::loadPlainText(), SCH_IO_EAGLE::loadSegments(), PCB_IO_EAGLE::loadSignals(), and SCH_IO_EAGLE::loadSymbol().
| size_t GetNodeCount | ( | const wxXmlNode * | aNode | ) | 
Fetch the number of XML nodes within aNode.
| aNode | is the parent node of the children to count. | 
Definition at line 185 of file eagle_parser.cpp.
References PROF_TIMER::msecs(), PROF_TIMER::Stop(), and traceEagleIo.
Referenced by SCH_IO_EAGLE::LoadSchematicFile().
| wxString interpretText | ( | const wxString & | aText | ) | 
Interprets special characters in Eagle text and converts them to KiCAD notation.
Definition at line 57 of file eagle_parser.cpp.
References substituteVariable(), and text.
Referenced by PCB_IO_EAGLE::loadPlain(), SCH_IO_EAGLE::loadPlainText(), SCH_IO_EAGLE::loadSymbolText(), and PCB_IO_EAGLE::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 490 of file eagle_parser.cpp.
Referenced by PCB_IO_EAGLE::cacheLib(), PCB_IO_EAGLE::loadAllSections(), and PCB_IO_EAGLE::loadLibrary().
      
  | 
  static | 
Definition at line 543 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 484 of file eagle_parser.cpp.
Referenced by EATTR::EATTR(), ECLASS::ECLASS(), ECONNECT::ECONNECT(), EDESCRIPTION::EDESCRIPTION(), EDEVICE::EDEVICE(), EDEVICE_SET::EDEVICE_SET(), EDIMENSION::EDIMENSION(), EELEMENT::EELEMENT(), EFRAME::EFRAME(), EGATE::EGATE(), EGRID::EGRID(), EINSTANCE::EINSTANCE(), ELABEL::ELABEL(), ELAYER::ELAYER(), EMODULE::EMODULE(), EMODULEINST::EMODULEINST(), EPACKAGE::EPACKAGE(), EPACKAGE3D::EPACKAGE3D(), EPAD::EPAD(), EPAD_COMMON::EPAD_COMMON(), EPART::EPART(), EPIN::EPIN(), EPINMAPPING::EPINMAPPING(), EPOLYGON::EPOLYGON(), EPORT::EPORT(), EPROBE::EPROBE(), ERECT::ERECT(), ESCHEMATIC::ESCHEMATIC(), ESCHEMATIC_GROUP::ESCHEMATIC_GROUP(), ESETTING::ESETTING(), ESMD::ESMD(), ESYMBOL::ESYMBOL(), ETEXT::ETEXT(), EVARIANT::EVARIANT(), EVARIANTDEF::EVARIANTDEF(), EVERTEX::EVERTEX(), EVIA::EVIA(), and EWIRE::EWIRE().
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 462 of file eagle_parser.cpp.
Referenced by EAGLE_DOC::EAGLE_DOC(), EAPPROVED::EAPPROVED(), EATTR::EATTR(), EBUS::EBUS(), ECIRCLE::ECIRCLE(), ECLASS::ECLASS(), ECONNECT::ECONNECT(), EDEVICE::EDEVICE(), EDEVICE_SET::EDEVICE_SET(), EDIMENSION::EDIMENSION(), EELEMENT::EELEMENT(), EFILTER::EFILTER(), EFRAME::EFRAME(), EGATE::EGATE(), EHOLE::EHOLE(), EINSTANCE::EINSTANCE(), EJUNCTION::EJUNCTION(), ELABEL::ELABEL(), ELAYER::ELAYER(), EMODEL::EMODEL(), EMODULE::EMODULE(), EMODULEINST::EMODULEINST(), ENET::ENET(), ENOTE::ENOTE(), EPACKAGE::EPACKAGE(), EPACKAGE3D::EPACKAGE3D(), EPACKAGE3DINST::EPACKAGE3DINST(), EPACKAGEINSTANCE::EPACKAGEINSTANCE(), EPAD_COMMON::EPAD_COMMON(), EPART::EPART(), EPIN::EPIN(), EPINMAP::EPINMAP(), EPINREF::EPINREF(), EPOLYGON::EPOLYGON(), EPORT::EPORT(), EPORTREF::EPORTREF(), EPROBE::EPROBE(), ERECT::ERECT(), ESCHEMATIC_GROUP::ESCHEMATIC_GROUP(), ESMD::ESMD(), ESPLINE::ESPLINE(), ESYMBOL::ESYMBOL(), ETECHNOLOGY::ETECHNOLOGY(), ETEXT::ETEXT(), EVARIANT::EVARIANT(), EVARIANTDEF::EVARIANTDEF(), EVERTEX::EVERTEX(), EVIA::EVIA(), and EWIRE::EWIRE().
| bool substituteVariable | ( | wxString * | aText | ) | 
Translates Eagle special text reference to a KiCad variable reference.
Definition at line 124 of file eagle_parser.cpp.
Referenced by interpretText().
      
  | 
  constexpr | 
Definition at line 44 of file eagle_parser.cpp.
Referenced by EATTR::EATTR(), ETEXT::ETEXT(), and parseAlignment().