KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eagle_parser.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 2012-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 * Copyright (C) 2017 CERN
7 *
8 * @author Alejandro GarcĂ­a Montoro <[email protected]>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, you may find one here:
22 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
23 * or you may search the http://www.gnu.org website for the version 2 license,
24 * or you may write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 */
27
28
29#ifndef _EAGLE_PARSER_H_
30#define _EAGLE_PARSER_H_
31
32#include <map>
33#include <memory>
34#include <unordered_map>
35
36#include <wx/xml/xml.h>
37#include <wx/string.h>
38#include <wx/filename.h>
39
40#include <layer_ids.h>
41#include <trigo.h>
42#include <core/wx_stl_compat.h>
43
44class FOOTPRINT;
45struct EINSTANCE;
46struct EPART;
47struct ETEXT;
48
49typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
50typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
51typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
52
54wxString escapeName( const wxString& aNetName );
55
57wxString interpretText( const wxString& aText );
58
60bool substituteVariable( wxString* aText );
61
63wxString convertDescription( wxString aDescr );
64
65static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
66{
67 auto it = aMap.find( aName );
68 return it == aMap.end() ? nullptr : it->second->GetChildren();
69}
70
71
76struct XML_PARSER_ERROR : std::runtime_error
77{
84 XML_PARSER_ERROR( const wxString& aMessage ) noexcept :
85 std::runtime_error( "XML parser failed - " + aMessage.ToStdString() )
86 {}
87};
88
89
91struct TRIPLET
92{
93 const char* element;
94 const char* attribute;
95 const char* value;
96
97 TRIPLET( const char* aElement, const char* aAttribute = "", const char* aValue = "" ) :
98 element( aElement ),
99 attribute( aAttribute ),
100 value( aValue )
101 {}
102};
103
104
118class XPATH
119{
120 std::vector<TRIPLET> p;
121
122public:
123 void push( const char* aPathSegment, const char* aAttribute="" )
124 {
125 p.emplace_back( aPathSegment, aAttribute );
126 }
127
128 void clear() { p.clear(); }
129
130 void pop() { p.pop_back(); }
131
133 void Value( const char* aValue )
134 {
135 p.back().value = aValue;
136 }
137
139 void Attribute( const char* aAttribute )
140 {
141 p.back().attribute = aAttribute;
142 }
143
145 wxString Contents()
146 {
147 typedef std::vector<TRIPLET>::const_iterator CITER_TRIPLET;
148
149 wxString ret;
150
151 for( CITER_TRIPLET it = p.begin(); it != p.end(); ++it )
152 {
153 if( it != p.begin() )
154 ret += '.';
155
156 ret += it->element;
157
158 if( it->attribute[0] && it->value[0] )
159 {
160 ret += '[';
161 ret += it->attribute;
162 ret += '=';
163 ret += it->value;
164 ret += ']';
165 }
166 }
167
168 return ret;
169 }
170};
171
172
180template<typename T>
181T Convert( const wxString& aValue )
182{
183 throw XML_PARSER_ERROR( "Conversion failed. Unknown type." );
184}
185
186template <>
187wxString Convert<wxString>( const wxString& aValue );
188
195template <typename T>
197{
198private:
201
204
205public:
210 m_isAvailable( false ),
211 m_data( T() )
212 {}
213
219 OPTIONAL_XML_ATTRIBUTE( const wxString& aData )
220 {
221 m_data = T();
222 m_isAvailable = !aData.IsEmpty();
223
224 if( m_isAvailable )
225 Set( aData );
226 }
227
232 template<typename V = T>
234 m_isAvailable( true ),
235 m_data( aData )
236 {}
237
241 operator bool() const
242 {
243 return m_isAvailable;
244 }
245
252 OPTIONAL_XML_ATTRIBUTE<T>& operator =( const wxString& aData )
253 {
254 m_isAvailable = !aData.IsEmpty();
255
256 if( m_isAvailable )
257 Set( aData );
258
259 return *this;
260 }
261
269 {
270 m_data = aData;
271 m_isAvailable = true;
272
273 return *this;
274 }
275
279 bool operator ==( const T& aOther ) const
280 {
281 return m_isAvailable && ( aOther == m_data );
282 }
283
289 void Set( const wxString& aString )
290 {
291 m_data = Convert<T>( aString );
292 m_isAvailable = !aString.IsEmpty();
293 }
294
300 T& Get()
301 {
302 assert( m_isAvailable );
303 return m_data;
304 }
305
311 const T& CGet() const
312 {
313 assert( m_isAvailable );
314 return m_data;
315 }
316
323 {
324 return Get();
325 }
326
332 const T& operator*() const
333 {
334 return CGet();
335 }
336
343 {
344 return &Get();
345 }
346
352 const T* operator->() const
353 {
354 return &CGet();
355 }
356};
357
358
366NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
367
369VECTOR2I ConvertArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle );
370
371// Pre-declare for typedefs
372struct EROT;
373struct ECOORD;
380
381
382// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
383// For maintenance and troubleshooting purposes, it was thought that we'd need to
384// separate the conversion process into distinct steps. There is no intent to have KiCad
385// forms of information in these 'E'STRUCTS. They are only binary forms
386// of the Eagle information in the corresponding Eagle XML nodes.
387
388// Eagle coordinates
389struct ECOORD
390{
392 {
397 };
398
400 long long int value;
401
403 static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
404
406 : value( 0 )
407 {
408 }
409
410 ECOORD( int aValue, enum EAGLE_UNIT aUnit )
411 : value( ConvertToNm( aValue, aUnit ) )
412 {
413 }
414
415 ECOORD( const wxString& aValue, enum EAGLE_UNIT aUnit );
416
417 int ToMils() const
418 {
419 return value / 25400;
420 }
421
422 int To100NanoMeters() const
423 {
424 return value / 100;
425 }
426
427 int ToNanoMeters() const
428 {
429 return value;
430 }
431
432 float ToMm() const
433 {
434 return value / 1000000.0;
435 }
436
437 int ToSchUnits() const { return To100NanoMeters(); }
438 int ToPcbUnits() const { return ToNanoMeters(); }
439
440 ECOORD operator+( const ECOORD& aOther ) const
441 {
442 return ECOORD( value + aOther.value, ECOORD_UNIT );
443 }
444
445 ECOORD operator-( const ECOORD& aOther ) const
446 {
447 return ECOORD( value - aOther.value, ECOORD_UNIT );
448 }
449
450 bool operator==( const ECOORD& aOther ) const
451 {
452 return value == aOther.value;
453 }
454
456 static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
457};
458
459
461struct ENET
462{
464 wxString netname;
465
466 ENET( int aNetCode, const wxString& aNetName ) :
467 netcode( aNetCode ),
468 netname( aNetName )
469 {}
470
472 netcode( 0 )
473 {}
474};
475
476
478struct EROT
479{
480 bool mirror;
481 bool spin;
482 double degrees;
483
485 mirror( false ),
486 spin( false ),
487 degrees( 0 )
488 {}
489
490 EROT( double aDegrees ) :
491 mirror( false ),
492 spin( false ),
493 degrees( aDegrees )
494 {}
495};
496
497
499struct EWIRE
500{
506 int layer;
507
508 // for style: (continuous | longdash | shortdash | dashdot)
513
516
517 // for cap: (flat | round)
518 enum { FLAT,
520
522
523 EWIRE( wxXmlNode* aWire );
524};
525
526
529{
532
533 EJUNCTION( wxXmlNode* aJunction);
534};
535
536
538struct ELABEL
539{
543 int layer;
546 wxString netname;
547
548 ELABEL( wxXmlNode* aLabel, const wxString& aNetName );
549};
550
551
553struct EVIA
554{
562
563 EVIA( wxXmlNode* aVia );
564};
565
566
569{
574 int layer;
575
576 ECIRCLE( wxXmlNode* aCircle );
577};
578
579
581struct ERECT
582{
587 int layer;
589
590 ERECT( wxXmlNode* aRect );
591};
592
593
600struct EATTR
601{
602 wxString name;
610
611 enum { // for 'display'
616 };
619
620 EATTR( wxXmlNode* aTree );
621 EATTR() {}
622};
623
624
627{
635 int layer;
637
638 EDIMENSION( wxXmlNode* aDimension );
639};
640
641
643struct ETEXT
644{
645 wxString text;
649 int layer;
653
654 enum { // for align
660
661 // opposites are -1 x above, used by code tricks in here
666 };
667
669
670 ETEXT( wxXmlNode* aText );
671
673 VECTOR2I ConvertSize() const;
674};
675
676
680struct EFRAME
681{
687 int rows;
688 int layer;
693
694 EFRAME( wxXmlNode* aFrameNode );
695};
696
697
700{
701 wxString name;
706
707 EPAD_COMMON( wxXmlNode* aPad );
708};
709
710
712struct EPAD : public EPAD_COMMON
713{
716
717 // for shape: (square | round | octagon | long | offset)
718 enum {
719 UNDEF = -1,
725 };
728
729 EPAD( wxXmlNode* aPad );
730};
731
732
734struct ESMD : public EPAD_COMMON
735{
738 int layer;
741
742 ESMD( wxXmlNode* aSMD );
743};
744
745
747struct EPIN
748{
749 wxString name;
752
759
760 EPIN( wxXmlNode* aPin );
761};
762
763
766{
770
771 EVERTEX( wxXmlNode* aVertex );
772};
773
774
777{
779 int layer;
781
782 // KiCad priority is opposite of Eagle rank, that is:
783 // - Eagle Low rank drawn first
784 // - KiCad high priority drawn first
785 // So since Eagle has an upper limit we define this, used for the cases
786 // where no rank is specified.
787 static const int max_priority = 6;
788
789 enum { // for pour
793 };
794 int pour;
799
800 EPOLYGON( wxXmlNode* aPolygon );
801};
802
803
805struct EHOLE
806{
810
811 EHOLE( wxXmlNode* aHole );
812};
813
814
817{
818 wxString name;
819 wxString library;
821 wxString package;
822 wxString value;
828
829 EELEMENT( wxXmlNode* aElement );
830};
831
832
833struct ELAYER
834{
836 wxString name;
837 int color;
838 int fill;
841
842 ELAYER( wxXmlNode* aLayer );
843};
844
845
847{
848 enum
849 {
850 TOP = 1,
865 BOTTOM = 16,
866 PADS = 17,
867 VIAS = 18,
870 TPLACE = 21,
871 BPLACE = 22,
874 TNAMES = 25,
875 BNAMES = 26,
878 TSTOP = 29,
879 BSTOP = 30,
880 TCREAM = 31,
881 BCREAM = 32,
884 TGLUE = 35,
885 BGLUE = 36,
886 TTEST = 37,
887 BTEST = 38,
893 DRILLS = 44,
894 HOLES = 45,
900 TDOCU = 51,
901 BDOCU = 52,
902 NETS = 91,
903 BUSSES = 92,
904 PINS = 93,
906 NAMES = 95,
907 VALUES = 96,
908 INFO = 97,
909 GUIDE = 98,
911 USERLAYER2 = 161
912 };
913};
914
915
916struct EPART
917{
918 /*
919 * <!ELEMENT part (attribute*, variant*)>
920 * <!ATTLIST part
921 * name %String; #REQUIRED
922 * library %String; #REQUIRED
923 * deviceset %String; #REQUIRED
924 * device %String; #REQUIRED
925 * technology %String; ""
926 * value %String; #IMPLIED
927 * >
928 */
929
930 wxString name;
931 wxString library;
932 wxString deviceset;
933 wxString device;
936 std::map<std::string,std::string> attribute;
937 std::map<std::string,std::string> variant;
938
939 EPART( wxXmlNode* aPart );
940};
941
942
944{
945 /*
946 * <!ELEMENT instance (attribute)*>
947 * <!ATTLIST instance
948 * part %String; #REQUIRED
949 * gate %String; #REQUIRED
950 * x %Coord; #REQUIRED
951 * y %Coord; #REQUIRED
952 * smashed %Bool; "no"
953 * rot %Rotation; "R0"
954 * >
955 */
956
957 wxString part;
958 wxString gate;
963
964 EINSTANCE( wxXmlNode* aInstance );
965};
966
967
968struct EGATE
969{
970 /*
971 * <!ELEMENT gate EMPTY>
972 * <!ATTLIST gate
973 * name %String; #REQUIRED
974 * symbol %String; #REQUIRED
975 * x %Coord; #REQUIRED
976 * y %Coord; #REQUIRED
977 * addlevel %GateAddLevel; "next"
978 * swaplevel %Int; "0"
979 * >
980 */
981
982 wxString name;
983 wxString symbol;
984
987
990
991 enum
992 {
997 ALWAYS
998 };
999
1000 EGATE( wxXmlNode* aGate );
1001};
1002
1003
1005{
1006 /*
1007 * <!ELEMENT connect EMPTY>
1008 * <!ATTLIST connect
1009 * gate %String; #REQUIRED
1010 * pin %String; #REQUIRED
1011 * pad %String; #REQUIRED
1012 * route %ContactRoute; "all"
1013 * >
1014 */
1015 wxString gate;
1016 wxString pin;
1017 wxString pad;
1018 //int contactroute; // TODO
1019
1020 ECONNECT( wxXmlNode* aConnect );
1021};
1022
1023
1025{
1026 /*
1027 * <!ELEMENT device (connects?, technologies?)>
1028 * <!ATTLIST device
1029 * name %String; ""
1030 * package %String; #IMPLIED
1031 * >
1032 */
1033 wxString name;
1035
1036 std::vector<ECONNECT> connects;
1037
1038 EDEVICE( wxXmlNode* aDevice );
1039};
1040
1041
1043{
1044 /*
1045 <!ELEMENT deviceset (description?, gates, devices)>
1046 <!ATTLIST deviceset
1047 name %String; #REQUIRED
1048 prefix %String; ""
1049 uservalue %Bool; "no"
1050 >
1051 */
1052
1053 wxString name;
1056 //std::vector<EDEVICE> devices;
1057 //std::vector<EGATE> gates;
1058
1059
1060 EDEVICE_SET( wxXmlNode* aDeviceSet );
1061};
1062
1063
1065{
1066 wxString number;
1067 wxString name;
1068 std::map<wxString, ECOORD> clearanceMap;
1069
1070 ECLASS( wxXmlNode* aClass );
1071};
1072
1073
1074#endif // _EAGLE_PARSER_H_
Model an optional XML attribute.
Definition: eagle_parser.h:197
bool operator==(const T &aOther) const
Definition: eagle_parser.h:279
const T * operator->() const
Return a constant pointer to the value of the attribute assuming it is available.
Definition: eagle_parser.h:352
OPTIONAL_XML_ATTRIBUTE< T > & operator=(const wxString &aData)
Assign to a string (optionally) containing the data.
Definition: eagle_parser.h:252
T * operator->()
Return a pointer to the value of the attribute assuming it is available.
Definition: eagle_parser.h:342
const T & operator*() const
Return a constant reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:332
OPTIONAL_XML_ATTRIBUTE(const wxString &aData)
Definition: eagle_parser.h:219
bool m_isAvailable
A boolean indicating if the data is present or not.
Definition: eagle_parser.h:200
const T & CGet() const
Return a constant reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:311
T m_data
The actual data if m_isAvailable is true; otherwise, garbage.
Definition: eagle_parser.h:203
void Set(const wxString &aString)
Attempt to convert a string to the base type.
Definition: eagle_parser.h:289
T & operator*()
Return a reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:322
T & Get()
Return a reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:300
OPTIONAL_XML_ATTRIBUTE(T aData)
Definition: eagle_parser.h:233
OPTIONAL_XML_ATTRIBUTE()
Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
Definition: eagle_parser.h:209
Keep track of what we are working on within a PTREE.
Definition: eagle_parser.h:119
void pop()
Definition: eagle_parser.h:130
void clear()
Definition: eagle_parser.h:128
void Value(const char *aValue)
modify the last path node's value
Definition: eagle_parser.h:133
std::vector< TRIPLET > p
Definition: eagle_parser.h:120
void Attribute(const char *aAttribute)
modify the last path node's attribute
Definition: eagle_parser.h:139
void push(const char *aPathSegment, const char *aAttribute="")
Definition: eagle_parser.h:123
wxString Contents()
return the contents of the XPATH as a single string
Definition: eagle_parser.h:145
OPTIONAL_XML_ATTRIBUTE< ECOORD > opt_ecoord
Definition: eagle_parser.h:379
T Convert(const wxString &aValue)
Convert a wxString to a generic type T.
Definition: eagle_parser.h:181
OPTIONAL_XML_ATTRIBUTE< int > opt_int
Definition: eagle_parser.h:375
static wxXmlNode * getChildrenNodes(NODE_MAP &aMap, const wxString &aName)
Definition: eagle_parser.h:65
NODE_MAP MapChildren(wxXmlNode *aCurrentNode)
Provide an easy access to the children of an XML node via their names.
OPTIONAL_XML_ATTRIBUTE< EROT > opt_erot
Definition: eagle_parser.h:378
wxString escapeName(const wxString &aNetName)
Interprets special characters in Eagle text and converts them to KiCAD notation.
wxString interpretText(const wxString &aText)
Translates Eagle special text reference to a KiCad variable reference.
bool substituteVariable(wxString *aText)
Converts Eagle's HTML description into KiCad description format.
wxString Convert< wxString >(const wxString &aValue)
OPTIONAL_XML_ATTRIBUTE< wxString > opt_wxString
Definition: eagle_parser.h:374
std::map< wxString, EINSTANCE * > EINSTANCE_MAP
Definition: eagle_parser.h:50
std::unordered_map< wxString, wxXmlNode * > NODE_MAP
Definition: eagle_parser.h:49
OPTIONAL_XML_ATTRIBUTE< bool > opt_bool
Definition: eagle_parser.h:377
OPTIONAL_XML_ATTRIBUTE< double > opt_double
Definition: eagle_parser.h:376
VECTOR2I ConvertArcCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle)
wxString convertDescription(wxString aDescr)
std::map< wxString, std::unique_ptr< EPART > > EPART_MAP
Translates Eagle special characters to their counterparts in KiCad.
Definition: eagle_parser.h:51
Parse an Eagle "attribute" XML element.
Definition: eagle_parser.h:601
opt_double ratio
Definition: eagle_parser.h:608
opt_wxString value
Definition: eagle_parser.h:603
opt_ecoord size
Definition: eagle_parser.h:606
opt_ecoord y
Definition: eagle_parser.h:605
wxString name
Definition: eagle_parser.h:602
opt_erot rot
Definition: eagle_parser.h:609
opt_int align
Definition: eagle_parser.h:618
opt_int display
Definition: eagle_parser.h:617
opt_ecoord x
Definition: eagle_parser.h:604
opt_int layer
Definition: eagle_parser.h:607
Eagle circle.
Definition: eagle_parser.h:569
ECOORD x
Definition: eagle_parser.h:570
ECOORD radius
Definition: eagle_parser.h:572
ECOORD y
Definition: eagle_parser.h:571
ECOORD width
Definition: eagle_parser.h:573
wxString number
std::map< wxString, ECOORD > clearanceMap
wxString name
wxString pad
wxString gate
wxString pin
int ToNanoMeters() const
Definition: eagle_parser.h:427
ECOORD operator+(const ECOORD &aOther) const
Definition: eagle_parser.h:440
@ EU_NM
nanometers
Definition: eagle_parser.h:393
@ EU_MM
millimeters
Definition: eagle_parser.h:394
@ EU_MIL
mils/thous
Definition: eagle_parser.h:396
@ EU_INCH
inches
Definition: eagle_parser.h:395
int ToSchUnits() const
Definition: eagle_parser.h:437
float ToMm() const
Definition: eagle_parser.h:432
ECOORD operator-(const ECOORD &aOther) const
Definition: eagle_parser.h:445
int ToMils() const
Definition: eagle_parser.h:417
int To100NanoMeters() const
Definition: eagle_parser.h:422
ECOORD(int aValue, enum EAGLE_UNIT aUnit)
Definition: eagle_parser.h:410
long long int value
Unit used for the value field.
Definition: eagle_parser.h:400
bool operator==(const ECOORD &aOther) const
Converts a size expressed in a certain unit to nanometers.
Definition: eagle_parser.h:450
static long long int ConvertToNm(int aValue, enum EAGLE_UNIT aUnit)
int ToPcbUnits() const
Definition: eagle_parser.h:438
static constexpr EAGLE_UNIT ECOORD_UNIT
Definition: eagle_parser.h:403
opt_bool uservalue
opt_wxString prefix
wxString name
std::vector< ECONNECT > connects
wxString name
opt_wxString package
Eagle dimension element.
Definition: eagle_parser.h:627
opt_wxString dimensionType
Definition: eagle_parser.h:636
opt_ecoord textsize
Definition: eagle_parser.h:634
Eagle element element.
Definition: eagle_parser.h:817
opt_erot rot
Definition: eagle_parser.h:827
wxString name
Definition: eagle_parser.h:818
wxString library
Definition: eagle_parser.h:819
opt_wxString library_urn
Definition: eagle_parser.h:820
wxString package
Definition: eagle_parser.h:821
ECOORD y
Definition: eagle_parser.h:824
opt_bool smashed
Definition: eagle_parser.h:826
ECOORD x
Definition: eagle_parser.h:823
wxString value
Definition: eagle_parser.h:822
opt_bool locked
Definition: eagle_parser.h:825
Parse an Eagle frame element.
Definition: eagle_parser.h:681
ECOORD x1
Definition: eagle_parser.h:682
opt_bool border_bottom
Definition: eagle_parser.h:692
opt_bool border_left
Definition: eagle_parser.h:689
opt_bool border_right
Definition: eagle_parser.h:691
ECOORD y1
Definition: eagle_parser.h:683
int layer
Definition: eagle_parser.h:688
opt_bool border_top
Definition: eagle_parser.h:690
int columns
Definition: eagle_parser.h:686
ECOORD y2
Definition: eagle_parser.h:685
int rows
Definition: eagle_parser.h:687
ECOORD x2
Definition: eagle_parser.h:684
opt_int swaplevel
Definition: eagle_parser.h:989
ECOORD x
Definition: eagle_parser.h:985
ECOORD y
Definition: eagle_parser.h:986
wxString symbol
Definition: eagle_parser.h:983
wxString name
Definition: eagle_parser.h:982
opt_int addlevel
Definition: eagle_parser.h:988
Eagle hole element.
Definition: eagle_parser.h:806
ECOORD y
Definition: eagle_parser.h:808
ECOORD drill
Definition: eagle_parser.h:809
ECOORD x
Definition: eagle_parser.h:807
wxString part
Definition: eagle_parser.h:957
ECOORD x
Definition: eagle_parser.h:959
opt_erot rot
Definition: eagle_parser.h:962
wxString gate
Definition: eagle_parser.h:958
ECOORD y
Definition: eagle_parser.h:960
opt_bool smashed
Definition: eagle_parser.h:961
Eagle Junction.
Definition: eagle_parser.h:529
ECOORD y
Definition: eagle_parser.h:531
ECOORD x
Definition: eagle_parser.h:530
Eagle label.
Definition: eagle_parser.h:539
opt_erot rot
Definition: eagle_parser.h:544
ECOORD size
Definition: eagle_parser.h:542
wxString netname
Definition: eagle_parser.h:546
opt_wxString xref
Definition: eagle_parser.h:545
int layer
Definition: eagle_parser.h:543
ECOORD y
Definition: eagle_parser.h:541
ECOORD x
Definition: eagle_parser.h:540
wxString name
Definition: eagle_parser.h:836
opt_bool visible
Definition: eagle_parser.h:839
opt_bool active
Definition: eagle_parser.h:840
int color
Definition: eagle_parser.h:837
int fill
Definition: eagle_parser.h:838
int number
Definition: eagle_parser.h:835
Eagle net.
Definition: eagle_parser.h:462
int netcode
Definition: eagle_parser.h:463
wxString netname
Definition: eagle_parser.h:464
ENET(int aNetCode, const wxString &aNetName)
Definition: eagle_parser.h:466
Structure holding common properties for through-hole and SMD pads.
Definition: eagle_parser.h:700
opt_bool thermals
Definition: eagle_parser.h:705
opt_bool stop
Definition: eagle_parser.h:704
wxString name
Definition: eagle_parser.h:701
opt_erot rot
Definition: eagle_parser.h:703
Eagle thru hole pad.
Definition: eagle_parser.h:713
ECOORD drill
Definition: eagle_parser.h:714
@ OCTAGON
Definition: eagle_parser.h:722
@ SQUARE
Definition: eagle_parser.h:720
@ OFFSET
Definition: eagle_parser.h:724
opt_ecoord diameter
Definition: eagle_parser.h:715
opt_bool first
Definition: eagle_parser.h:727
opt_int shape
Definition: eagle_parser.h:726
wxString device
Definition: eagle_parser.h:933
std::map< std::string, std::string > variant
Definition: eagle_parser.h:937
wxString library
Definition: eagle_parser.h:931
opt_wxString technology
Definition: eagle_parser.h:934
wxString deviceset
Definition: eagle_parser.h:932
std::map< std::string, std::string > attribute
Definition: eagle_parser.h:936
opt_wxString value
Definition: eagle_parser.h:935
wxString name
Definition: eagle_parser.h:930
Eagle pin element.
Definition: eagle_parser.h:748
ECOORD x
Definition: eagle_parser.h:750
wxString name
Definition: eagle_parser.h:749
opt_int swaplevel
Definition: eagle_parser.h:757
opt_wxString visible
Definition: eagle_parser.h:753
opt_wxString direction
Definition: eagle_parser.h:755
opt_wxString length
Definition: eagle_parser.h:754
opt_wxString function
Definition: eagle_parser.h:756
opt_erot rot
Definition: eagle_parser.h:758
ECOORD y
Definition: eagle_parser.h:751
Eagle polygon, without vertices which are parsed as needed.
Definition: eagle_parser.h:777
opt_bool orphans
Definition: eagle_parser.h:796
opt_int rank
Definition: eagle_parser.h:798
opt_bool thermals
Definition: eagle_parser.h:797
opt_ecoord spacing
Definition: eagle_parser.h:780
static const int max_priority
Definition: eagle_parser.h:787
ECOORD width
Definition: eagle_parser.h:778
opt_ecoord isolate
Definition: eagle_parser.h:795
Eagle XML rectangle in binary.
Definition: eagle_parser.h:582
ECOORD x2
Definition: eagle_parser.h:585
ECOORD y1
Definition: eagle_parser.h:584
opt_erot rot
Definition: eagle_parser.h:588
int layer
Definition: eagle_parser.h:587
ECOORD y2
Definition: eagle_parser.h:586
ECOORD x1
Definition: eagle_parser.h:583
Eagle rotation.
Definition: eagle_parser.h:479
double degrees
Definition: eagle_parser.h:482
bool spin
Definition: eagle_parser.h:481
EROT(double aDegrees)
Definition: eagle_parser.h:490
bool mirror
Definition: eagle_parser.h:480
Eagle SMD pad.
Definition: eagle_parser.h:735
opt_int roundness
Definition: eagle_parser.h:739
ECOORD dx
Definition: eagle_parser.h:736
int layer
Definition: eagle_parser.h:738
opt_bool cream
Definition: eagle_parser.h:740
ECOORD dy
Definition: eagle_parser.h:737
Eagle text element.
Definition: eagle_parser.h:644
opt_double ratio
Definition: eagle_parser.h:651
@ BOTTOM_CENTER
Definition: eagle_parser.h:663
@ BOTTOM_RIGHT
Definition: eagle_parser.h:665
@ TOP_CENTER
Definition: eagle_parser.h:657
@ TOP_LEFT
Definition: eagle_parser.h:658
@ TOP_RIGHT
Definition: eagle_parser.h:659
@ CENTER_RIGHT
Definition: eagle_parser.h:662
@ CENTER_LEFT
Definition: eagle_parser.h:656
@ BOTTOM_LEFT
Definition: eagle_parser.h:664
wxString text
Definition: eagle_parser.h:645
ECOORD y
Definition: eagle_parser.h:647
ECOORD size
Definition: eagle_parser.h:648
opt_erot rot
Definition: eagle_parser.h:652
opt_int align
Definition: eagle_parser.h:668
ECOORD x
Definition: eagle_parser.h:646
VECTOR2I ConvertSize() const
Calculate text size based on font type and size.
opt_wxString font
Definition: eagle_parser.h:650
int layer
Definition: eagle_parser.h:649
Eagle vertex.
Definition: eagle_parser.h:766
ECOORD y
Definition: eagle_parser.h:768
ECOORD x
Definition: eagle_parser.h:767
opt_double curve
range is -359.9..359.9
Definition: eagle_parser.h:769
Eagle via.
Definition: eagle_parser.h:554
opt_ecoord diam
Definition: eagle_parser.h:560
ECOORD drill
< inclusive
Definition: eagle_parser.h:559
ECOORD y
Definition: eagle_parser.h:556
opt_wxString shape
Definition: eagle_parser.h:561
int layer_front_most
Definition: eagle_parser.h:557
int layer_back_most
< extent
Definition: eagle_parser.h:558
ECOORD x
Definition: eagle_parser.h:555
Eagle wire.
Definition: eagle_parser.h:500
ECOORD width
Definition: eagle_parser.h:505
int layer
Definition: eagle_parser.h:506
ECOORD x2
Definition: eagle_parser.h:503
opt_int cap
Definition: eagle_parser.h:521
@ LONGDASH
Definition: eagle_parser.h:510
@ CONTINUOUS
Definition: eagle_parser.h:509
@ SHORTDASH
Definition: eagle_parser.h:511
opt_int style
Definition: eagle_parser.h:514
ECOORD y2
Definition: eagle_parser.h:504
ECOORD x1
Definition: eagle_parser.h:501
ECOORD y1
Definition: eagle_parser.h:502
opt_double curve
range is -359.9..359.9
Definition: eagle_parser.h:515
segment (element) of our XPATH into the Eagle XML document tree in PTREE form.
Definition: eagle_parser.h:92
TRIPLET(const char *aElement, const char *aAttribute="", const char *aValue="")
Definition: eagle_parser.h:97
const char * value
Definition: eagle_parser.h:95
const char * attribute
Definition: eagle_parser.h:94
const char * element
Definition: eagle_parser.h:93
Implement a simple wrapper around runtime_error to isolate the errors thrown by the Eagle XML parser.
Definition: eagle_parser.h:77
XML_PARSER_ERROR(const wxString &aMessage) noexcept
Build an XML error by just calling its parent class constructor, std::runtime_error,...
Definition: eagle_parser.h:84