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 The 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 <optional>
35#include <unordered_map>
36
37#include <wx/xml/xml.h>
38#include <wx/string.h>
39#include <wx/filename.h>
40
41#include <layer_ids.h>
42#include <trigo.h>
43#include <core/wx_stl_compat.h>
45
46class FOOTPRINT;
47class IO_BASE;
48
49struct EINSTANCE;
50struct EPART;
51struct ETEXT;
52struct ESEGMENT;
53
54typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
55typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
56typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
57
59wxString escapeName( const wxString& aNetName );
60
62wxString interpretText( const wxString& aText );
63
65bool substituteVariable( wxString* aText );
66
68wxString convertDescription( wxString aDescr );
69
70static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
71{
72 auto it = aMap.find( aName );
73 return it == aMap.end() ? nullptr : it->second->GetChildren();
74}
75
76
81struct XML_PARSER_ERROR : std::runtime_error
82{
89 XML_PARSER_ERROR( const wxString& aMessage ) noexcept :
90 std::runtime_error( "XML parser failed - " + aMessage.ToStdString() )
91 {}
92};
93
94
96struct TRIPLET
97{
98 const char* element;
99 const char* attribute;
100 const char* value;
101
102 TRIPLET( const char* aElement, const char* aAttribute = "", const char* aValue = "" ) :
103 element( aElement ),
104 attribute( aAttribute ),
105 value( aValue )
106 {}
107};
108
109
123class XPATH
124{
125 std::vector<TRIPLET> p;
126
127public:
128 void push( const char* aPathSegment, const char* aAttribute="" )
129 {
130 p.emplace_back( aPathSegment, aAttribute );
131 }
132
133 void clear() { p.clear(); }
134
135 void pop() { p.pop_back(); }
136
138 void Value( const char* aValue )
139 {
140 p.back().value = aValue;
141 }
142
144 void Attribute( const char* aAttribute )
145 {
146 p.back().attribute = aAttribute;
147 }
148
150 wxString Contents()
151 {
152 typedef std::vector<TRIPLET>::const_iterator CITER_TRIPLET;
153
154 wxString ret;
155
156 for( CITER_TRIPLET it = p.begin(); it != p.end(); ++it )
157 {
158 if( it != p.begin() )
159 ret += '.';
160
161 ret += it->element;
162
163 if( it->attribute[0] && it->value[0] )
164 {
165 ret += '[';
166 ret += it->attribute;
167 ret += '=';
168 ret += it->value;
169 ret += ']';
170 }
171 }
172
173 return ret;
174 }
175};
176
177
185template<typename T>
186T Convert( const wxString& aValue )
187{
188 throw XML_PARSER_ERROR( "Conversion failed. Unknown type." );
189}
190
191template <>
192wxString Convert<wxString>( const wxString& aValue );
193
200template <typename T>
202{
203private:
206
209
210public:
215 m_isAvailable( false ),
216 m_data( T() )
217 {}
218
224 OPTIONAL_XML_ATTRIBUTE( const wxString& aData )
225 {
226 m_data = T();
227 m_isAvailable = !aData.IsEmpty();
228
229 if( m_isAvailable )
230 Set( aData );
231 }
232
237 template<typename V = T>
239 m_isAvailable( true ),
240 m_data( aData )
241 {}
242
246 operator bool() const
247 {
248 return m_isAvailable;
249 }
250
257 OPTIONAL_XML_ATTRIBUTE<T>& operator =( const wxString& aData )
258 {
259 m_isAvailable = !aData.IsEmpty();
260
261 if( m_isAvailable )
262 Set( aData );
263
264 return *this;
265 }
266
274 {
275 m_data = aData;
276 m_isAvailable = true;
277
278 return *this;
279 }
280
284 bool operator ==( const T& aOther ) const
285 {
286 return m_isAvailable && ( aOther == m_data );
287 }
288
294 void Set( const wxString& aString )
295 {
296 m_data = Convert<T>( aString );
297 m_isAvailable = !aString.IsEmpty();
298 }
299
306 {
307 assert( m_isAvailable );
308 return m_data;
309 }
310
316 const T& CGet() const
317 {
318 assert( m_isAvailable );
319 return m_data;
320 }
321
328 {
329 return Get();
330 }
331
337 const T& operator*() const
338 {
339 return CGet();
340 }
341
348 {
349 return &Get();
350 }
351
357 const T* operator->() const
358 {
359 return &CGet();
360 }
361};
362
363
371size_t GetNodeCount( const wxXmlNode* aNode );
372
373
381NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
382
384VECTOR2I ConvertArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle );
385
386// Pre-declare for typedefs
387struct EROT;
388struct ECOORD;
389struct EURN;
390
398
399
401{
402 EAGLE_BASE( IO_BASE* aIo = nullptr ) :
403 io( aIo ) {}
404
406
412 void Report( const wxString& aMsg, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED );
413
415};
416
417
435struct EURN : public EAGLE_BASE
436{
437 EURN() {}
438
440 EURN( const wxString& aUrn );
441
442 void Parse( const wxString& aUrn );
443
450 bool IsValid() const;
451
452 wxString host;
453 wxString path;
454 wxString assetType;
455 wxString assetId;
456 wxString assetVersion;
457};
458
459
460// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
461// For maintenance and troubleshooting purposes, it was thought that we'd need to
462// separate the conversion process into distinct steps. There is no intent to have KiCad
463// forms of information in these 'E'STRUCTS. They are only binary forms
464// of the Eagle information in the corresponding Eagle XML nodes.
465
466
468{
469 /*
470 * <!ELEMENT description (#PCDATA)>
471 * <!ATTLIST description
472 * language %String; "en"
473 * >
474 */
475
476 wxString text;
478
479 EDESCRIPTION( wxXmlNode* aDescription, IO_BASE* aIo = nullptr );
480};
481
482
483// Eagle coordinates
484struct ECOORD : public EAGLE_BASE
485{
493
495 long long int value;
496
498 static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
499
501 : value( 0 )
502 {
503 }
504
505 ECOORD( int aValue, enum EAGLE_UNIT aUnit )
506 : value( ConvertToNm( aValue, aUnit ) )
507 {
508 }
509
510 ECOORD( const wxString& aValue, enum EAGLE_UNIT aUnit );
511
512 int ToMils() const
513 {
514 return value / 25400;
515 }
516
517 int To100NanoMeters() const
518 {
519 return value / 100;
520 }
521
522 int ToNanoMeters() const
523 {
524 return value;
525 }
526
527 float ToMm() const
528 {
529 return value / 1000000.0;
530 }
531
532 int ToSchUnits() const { return To100NanoMeters(); }
533 int ToPcbUnits() const { return ToNanoMeters(); }
534
535 ECOORD operator+( const ECOORD& aOther ) const
536 {
537 return ECOORD( value + aOther.value, ECOORD_UNIT );
538 }
539
540 ECOORD operator-( const ECOORD& aOther ) const
541 {
542 return ECOORD( value - aOther.value, ECOORD_UNIT );
543 }
544
545 bool operator==( const ECOORD& aOther ) const
546 {
547 return value == aOther.value;
548 }
549
551 static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
552};
553
554
556struct ENET : public EAGLE_BASE
557{
558 /*
559 * <!ELEMENT net (segment)*>
560 * <!ATTLIST net
561 * name %String; #REQUIRED
562 * class %Class; "0"
563 * >
564 */
565 wxString netname;
567
568 std::vector<std::unique_ptr<ESEGMENT>> segments;
569
570 ENET( int aNetCode, const wxString& aNetName ) :
571 netname( aNetName ),
572 netcode( aNetCode )
573 {}
574
576 netcode( 0 )
577 {}
578
579 ENET( wxXmlNode* aNet, IO_BASE* aIo = nullptr );
580};
581
582
584struct EROT
585{
586 bool mirror;
587 bool spin;
588 double degrees;
589
591 mirror( false ),
592 spin( false ),
593 degrees( 0 )
594 {}
595
596 EROT( double aDegrees ) :
597 mirror( false ),
598 spin( false ),
599 degrees( aDegrees )
600 {}
601};
602
603
605struct EVERTEX : public EAGLE_BASE
606{
607 /*
608 * <!ELEMENT vertex EMPTY>
609 * <!ATTLIST vertex
610 * x %Coord; #REQUIRED
611 * y %Coord; #REQUIRED
612 * curve %WireCurve; "0"
613 * >
614 * <!-- curve: The curvature from this vertex to the next one -->
615 */
619
620 EVERTEX( wxXmlNode* aVertex, IO_BASE* aIo = nullptr );
621};
622
623
625struct EWIRE : public EAGLE_BASE
626{
627 /*
628 * <!ELEMENT wire EMPTY>
629 * <!ATTLIST wire
630 * x1 %Coord; #REQUIRED
631 * y1 %Coord; #REQUIRED
632 * x2 %Coord; #REQUIRED
633 * y2 %Coord; #REQUIRED
634 * width %Dimension; #REQUIRED
635 * layer %Layer; #REQUIRED
636 * extent %Extent; #IMPLIED
637 * style %WireStyle; "continuous"
638 * curve %WireCurve; "0"
639 * cap %WireCap; "round"
640 * grouprefs IDREFS #IMPLIED
641 * >
642 * <!-- extent: Only applicable for airwires -->
643 * <!-- cap : Only applicable if 'curve' is not zero -->
644 */
650 int layer;
651
652 // for style: (continuous | longdash | shortdash | dashdot)
657
661
662 // for cap: (flat | round)
663 enum { FLAT,
665
667
668 // TODO add grouprefs
669
670 EWIRE( wxXmlNode* aWire, IO_BASE* aIo = nullptr );
671};
672
673
675struct EJUNCTION : public EAGLE_BASE
676{
677 /*
678 * <!ELEMENT junction EMPTY>
679 * <!ATTLIST junction
680 * x %Coord; #REQUIRED
681 * y %Coord; #REQUIRED
682 * grouprefs IDREFS #IMPLIED
683 * >
684 */
685
688
689 EJUNCTION( wxXmlNode* aJunction, IO_BASE* aIo = nullptr );
690};
691
692
694struct ELABEL : public EAGLE_BASE
695{
696 /*
697 * <!ELEMENT label EMPTY>
698 * <!ATTLIST label
699 * x %Coord; #REQUIRED
700 * y %Coord; #REQUIRED
701 * size %Dimension; #REQUIRED
702 * layer %Layer; #REQUIRED
703 * font %TextFont; "proportional"
704 * ratio %Int; "8"
705 * rot %Rotation; "R0"
706 * xref %Bool; "no"
707 * align %Align; "bottom-left"
708 * grouprefs IDREFS #IMPLIED
709 * >
710 * <!-- rot: Only 0, 90, 180 or 270 -->
711 * <!-- xref: Only in <net> context -->
712 */
713
717 int layer;
723
724 // TODO Add grouprefs
725
726 ELABEL( wxXmlNode* aLabel, IO_BASE* aIo = nullptr );
727};
728
729
731struct EVIA : public EAGLE_BASE
732{
733 /*
734 * <!ELEMENT via EMPTY>
735 * <!ATTLIST via
736 * x %Coord; #REQUIRED
737 * y %Coord; #REQUIRED
738 * extent %Extent; #REQUIRED
739 * drill %Dimension; #REQUIRED
740 * diameter %Dimension; "0"
741 * shape %ViaShape; "round"
742 * alwaysstop %Bool; "no"
743 * grouprefs IDREFS #IMPLIED
744 * >
745 */
754
755 // TODO add grouprefs
756
757 EVIA( wxXmlNode* aVia, IO_BASE* aIo = nullptr );
758};
759
760
762struct ECIRCLE : public EAGLE_BASE
763{
764 /*
765 * <!ELEMENT circle EMPTY>
766 * <!ATTLIST circle
767 * x %Coord; #REQUIRED
768 * y %Coord; #REQUIRED
769 * radius %Coord; #REQUIRED
770 * width %Dimension; #REQUIRED
771 * layer %Layer; #REQUIRED
772 * grouprefs IDREFS #IMPLIED
773 * >
774 */
779 int layer;
780
781 // TODO add grouprefs
782
783 ECIRCLE( wxXmlNode* aCircle, IO_BASE* aIo = nullptr );
784};
785
786
788struct ERECT : public EAGLE_BASE
789{
790 /*
791 * <!ELEMENT rectangle EMPTY>
792 * <!ATTLIST rectangle
793 * x1 %Coord; #REQUIRED
794 * y1 %Coord; #REQUIRED
795 * x2 %Coord; #REQUIRED
796 * y2 %Coord; #REQUIRED
797 * layer %Layer; #REQUIRED
798 * rot %Rotation; "R0"
799 * grouprefs IDREFS #IMPLIED
800 * >
801 */
806 int layer;
808
809 ERECT( wxXmlNode* aRect, IO_BASE* aIo = nullptr );
810};
811
812
813struct ESPLINE : public EAGLE_BASE
814{
815 /*
816 * <!ELEMENT spline (vertex)*>
817 * <!-- Four simple (non-curve) vertices define the control points of a degree-3
818 * spline curve -->
819 * <!ATTLIST spline
820 * width %Dimension; #REQUIRED
821 * >
822 */
823 std::vector<std::unique_ptr<EVERTEX>> vertices;
824 double width;
825
826 ESPLINE( wxXmlNode* aSpline, IO_BASE* aIo = nullptr );
827};
828
829
836struct EATTR : public EAGLE_BASE
837{
838 /*
839 * <!ELEMENT attribute EMPTY>
840 * <!ATTLIST attribute
841 * name %String; #REQUIRED
842 * value %String; #IMPLIED
843 * x %Coord; #IMPLIED
844 * y %Coord; #IMPLIED
845 * size %Dimension; #IMPLIED
846 * layer %Layer; #IMPLIED
847 * font %TextFont; #IMPLIED
848 * ratio %Int; #IMPLIED
849 * rot %Rotation; "R0"
850 * display %AttributeDisplay; "value"
851 * constant %Bool; "no"
852 * align %Align; "bottom-left"
853 * grouprefs IDREFS #IMPLIED
854 * >
855 * <!-- display: Only in <element> or <instance> context -->
856 * <!-- constant:Only in <device> context -->
857 */
858 wxString name;
867
868 enum { // for 'display'
873 };
874
878
879 // TODO add groupdefs
880
881 EATTR( wxXmlNode* aTree, IO_BASE* aIo = nullptr );
882 EATTR() {}
883};
884
885
887struct EDIMENSION : public EAGLE_BASE
888{
889 /*
890 * <!ELEMENT dimension EMPTY>
891 * <!ATTLIST dimension
892 * x1 %Coord; #REQUIRED
893 * y1 %Coord; #REQUIRED
894 * x2 %Coord; #REQUIRED
895 * y2 %Coord; #REQUIRED
896 * x3 %Coord; #REQUIRED
897 * y3 %Coord; #REQUIRED
898 * layer %Layer; #REQUIRED
899 * dtype %DimensionType; "parallel"
900 * width %Dimension; "0.13"
901 * extwidth %Dimension; "0"
902 * extlength %Dimension; "0"
903 * extoffset %Dimension; "0"
904 * textsize %Dimension; #REQUIRED
905 * textratio %Int; "8"
906 * unit %GridUnit; "mm"
907 * precision %Int; "2"
908 * visible %Bool; "no"
909 * grouprefs IDREFS #IMPLIED
910 * >
911 */
919 int layer;
929
930 // TODO add grouprefs
931
932 EDIMENSION( wxXmlNode* aDimension, IO_BASE* aIo = nullptr );
933};
934
935
937struct ETEXT : public EAGLE_BASE
938{
939 /*
940 * <!ELEMENT text (#PCDATA)>
941 * <!ATTLIST text
942 * x %Coord; #REQUIRED
943 * y %Coord; #REQUIRED
944 * size %Dimension; #REQUIRED
945 * layer %Layer; #REQUIRED
946 * font %TextFont; "proportional"
947 * ratio %Int; "8"
948 * rot %Rotation; "R0"
949 * align %Align; "bottom-left"
950 * distance %Int; "50"
951 * grouprefs IDREFS #IMPLIED
952 * >
953 */
954 wxString text;
958 int layer;
962
963 enum { // for align
969
970 // opposites are -1 x above, used by code tricks in here
975 };
976
979
980 // TODO add grouprefs
981
982 ETEXT( wxXmlNode* aText, IO_BASE* aIo = nullptr );
983
985 VECTOR2I ConvertSize() const;
986};
987
988
992struct EFRAME : public EAGLE_BASE
993{
994 /*
995 * <!ELEMENT frame EMPTY>
996 * <!ATTLIST frame
997 * x1 %Coord; #REQUIRED
998 * y1 %Coord; #REQUIRED
999 * x2 %Coord; #REQUIRED
1000 * y2 %Coord; #REQUIRED
1001 * columns %Int; #REQUIRED
1002 * rows %Int; #REQUIRED
1003 * layer %Layer; #REQUIRED
1004 * border-left %Bool; "yes"
1005 * border-top %Bool; "yes"
1006 * border-right %Bool; "yes"
1007 * border-bottom %Bool; "yes"
1008 * grouprefs IDREFS #IMPLIED
1009 * >
1010 */
1016 int rows;
1022
1023 EFRAME( wxXmlNode* aFrameNode, IO_BASE* aIo = nullptr );
1024};
1025
1026
1029{
1030 wxString name;
1035
1036 EPAD_COMMON( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1037};
1038
1039
1041struct EPAD : public EPAD_COMMON
1042{
1043 /*
1044 * <!ELEMENT pad EMPTY>
1045 * <!ATTLIST pad
1046 * name %String; #REQUIRED
1047 * x %Coord; #REQUIRED
1048 * y %Coord; #REQUIRED
1049 * drill %Dimension; #REQUIRED
1050 * diameter %Dimension; "0"
1051 * shape %PadShape; "round"
1052 * rot %Rotation; "R0"
1053 * stop %Bool; "yes"
1054 * thermals %Bool; "yes"
1055 * first %Bool; "no"
1056 * >
1057 */
1060
1061 // for shape: (square | round | octagon | long | offset)
1062 enum {
1063 UNDEF = -1,
1069 };
1070
1073
1074 EPAD( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1075};
1076
1077
1079struct ESMD : public EPAD_COMMON
1080{
1081 /*
1082 * <!ELEMENT smd EMPTY>
1083 * <!ATTLIST smd
1084 * name %String; #REQUIRED
1085 * x %Coord; #REQUIRED
1086 * y %Coord; #REQUIRED
1087 * dx %Dimension; #REQUIRED
1088 * dy %Dimension; #REQUIRED
1089 * layer %Layer; #REQUIRED
1090 * roundness %Int; "0"
1091 * rot %Rotation; "R0"
1092 * stop %Bool; "yes"
1093 * thermals %Bool; "yes"
1094 * cream %Bool; "yes"
1095 * >
1096 */
1102
1103 ESMD( wxXmlNode* aSMD, IO_BASE* aIo = nullptr );
1104};
1105
1106
1108struct EPIN : public EAGLE_BASE
1109{
1110 /*
1111 * <!ELEMENT pin EMPTY>
1112 * <!ATTLIST pin
1113 * name %String; #REQUIRED
1114 * x %Coord; #REQUIRED
1115 * y %Coord; #REQUIRED
1116 * visible %PinVisible; "both"
1117 * length %PinLength; "long"
1118 * direction %PinDirection; "io"
1119 * function %PinFunction; "none"
1120 * swaplevel %Int; "0"
1121 * rot %Rotation; "R0"
1122 * >
1123 */
1124 wxString name;
1127
1134
1135 EPIN( wxXmlNode* aPin, IO_BASE* aIo = nullptr );
1136};
1137
1138
1140struct EPOLYGON : public EAGLE_BASE
1141{
1142 /*
1143 * <!ELEMENT polygon (vertex)*>
1144 * <!-- the vertices must define a valid polygon; if the last vertex is the same
1145 * as the first one, it is ignored -->
1146 * <!ATTLIST polygon
1147 * width %Dimension; #REQUIRED
1148 * layer %Layer; #REQUIRED
1149 * spacing %Dimension; #IMPLIED
1150 * pour %PolygonPour; "solid"
1151 * isolate %Dimension; #IMPLIED
1152 * orphans %Bool; "no"
1153 * thermals %Bool; "yes"
1154 * rank %Int; "0"
1155 * grouprefs IDREFS #IMPLIED
1156 * >
1157 * <!-- isolate: Only in <signal> or <package> context -->
1158 * <!-- orphans: Only in <signal> context -->
1159 * <!-- thermals:Only in <signal> context -->
1160 * <!-- rank: 1..6 in <signal> context, 0 or 7 in <package> context -->
1161 */
1165
1166 // KiCad priority is opposite of Eagle rank, that is:
1167 // - Eagle Low rank drawn first
1168 // - KiCad high priority drawn first
1169 // So since Eagle has an upper limit we define this, used for the cases
1170 // where no rank is specified.
1171 static const int max_priority = 6;
1172
1173 enum { // for pour
1177 };
1178
1179 int pour;
1184
1185 std::vector<std::unique_ptr<EVERTEX>> vertices;
1186
1187 // TODO add grouprefs
1188
1189 EPOLYGON( wxXmlNode* aPolygon, IO_BASE* aIo = nullptr );
1190};
1191
1192
1194struct EHOLE : public EAGLE_BASE
1195{
1196 /*
1197 * <!ELEMENT hole EMPTY>
1198 * <!ATTLIST hole
1199 * x %Coord; #REQUIRED
1200 * y %Coord; #REQUIRED
1201 * drill %Dimension; #REQUIRED
1202 * grouprefs IDREFS #IMPLIED
1203 * >
1204 */
1208
1209 EHOLE( wxXmlNode* aHole, IO_BASE* aIo = nullptr );
1210};
1211
1212
1213struct EVARIANT : public EAGLE_BASE
1214{
1215 /*
1216 * <!ELEMENT variant EMPTY>
1217 * <!ATTLIST variant
1218 * name %String; #REQUIRED
1219 * populate %Bool; "yes"
1220 * value %String; #IMPLIED
1221 * technology %String; #IMPLIED
1222 * >
1223 * <!-- technology: Only in part context -->
1224 */
1225 wxString name;
1229
1230 EVARIANT( wxXmlNode* aVariant, IO_BASE* aIo = nullptr );
1231};
1232
1233
1234struct EPINMAP : public EAGLE_BASE
1235{
1236 /*
1237 * <!ELEMENT pinmap EMPTY>
1238 * <!ATTLIST pinmap
1239 * gate %String; #REQUIRED
1240 * pin %String; #REQUIRED
1241 * pinorder %String; #REQUIRED
1242 * >
1243 */
1244 wxString gate;
1245 wxString pin;
1246 wxString pinorder;
1247
1248 EPINMAP( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1249};
1250
1251
1253{
1254 /*
1255 * <!ELEMENT pinmapping (pinmap+)>
1256 * <!ATTLIST pinmapping
1257 * isusermap %Bool; "no"
1258 * iddevicewide %Bool; "yes"
1259 * spiceprefix %String; ""
1260 * >
1261 */
1262 std::vector<std::unique_ptr<EPINMAP>> pinmaps;
1266
1267 EPINMAPPING( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1268};
1269
1270
1271struct EMODEL : public EAGLE_BASE
1272{
1273 /*
1274 * <!ELEMENT model (#PCDATA)>
1275 * <!ATTLIST model
1276 * name %String; #REQUIRED
1277 * >
1278 */
1279 wxString name;
1280 wxString model;
1281
1282 EMODEL( wxXmlNode* aModel, IO_BASE* aIo = nullptr );
1283};
1284
1285
1286struct ESPICE : public EAGLE_BASE
1287{
1288 /*
1289 * <!ELEMENT spice (pinmapping, model)>
1290 */
1291 std::unique_ptr<EPINMAPPING> pinmapping;
1292 std::unique_ptr<EMODEL> model;
1293
1294 ESPICE( wxXmlNode* aSpice, IO_BASE* aIo = nullptr );
1295};
1296
1297
1299struct EELEMENT : public EAGLE_BASE
1300{
1301 /*
1302 * <!ELEMENT element (attribute*, variant*)>
1303 * <!-- variant* is accepted only for compatibility with EAGLE 6.x files -->
1304 * <!ATTLIST element
1305 * name %String; #REQUIRED
1306 * library %String; #REQUIRED
1307 * library_urn %Urn; ""
1308 * package %String; #REQUIRED
1309 * package3d_urn %Urn; ""
1310 * override_package3d_urn %Urn; ""
1311 * override_package_urn %Urn; ""
1312 * override_locally_modified %Bool; "no"
1313 * value %String; #REQUIRED
1314 * x %Coord; #REQUIRED
1315 * y %Coord; #REQUIRED
1316 * locked %Bool; "no"
1317 * populate %Bool; "yes"
1318 * smashed %Bool; "no"
1319 * rot %Rotation; "R0"
1320 * grouprefs IDREFS #IMPLIED
1321 * >
1322 * <!-- library_urn: Only in parts from online libraries -->
1323 */
1324 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1325 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1326
1327 wxString name;
1328 wxString library;
1330 wxString package;
1334 wxString value;
1340
1341 // TODO add grouprefs
1342
1343 EELEMENT( wxXmlNode* aElement, IO_BASE* aIo = nullptr );
1344};
1345
1346
1347struct ELAYER : public EAGLE_BASE
1348{
1349 /*
1350 * <!ELEMENT layer EMPTY>
1351 * <!ATTLIST layer
1352 * number %Layer; #REQUIRED
1353 * name %String; #REQUIRED
1354 * color %Int; #REQUIRED
1355 * fill %Int; #REQUIRED
1356 * visible %Bool; "yes"
1357 * active %Bool; "yes"
1358 * >
1359 */
1361 wxString name;
1363 int fill;
1366
1367 ELAYER( wxXmlNode* aLayer, IO_BASE* aIo = nullptr );
1368};
1369
1370
1439
1440
1441struct EGATE : public EAGLE_BASE
1442{
1443 /*
1444 * <!ELEMENT gate EMPTY>
1445 * <!ATTLIST gate
1446 * name %String; #REQUIRED
1447 * symbol %String; #REQUIRED
1448 * x %Coord; #REQUIRED
1449 * y %Coord; #REQUIRED
1450 * addlevel %GateAddLevel; "next"
1451 * swaplevel %Int; "0"
1452 * >
1453 */
1454
1455 wxString name;
1456 wxString symbol;
1457
1460
1463
1464 enum
1465 {
1471 };
1472
1473 EGATE( wxXmlNode* aGate, IO_BASE* aIo = nullptr );
1474};
1475
1476
1477struct EPART : public EAGLE_BASE
1478{
1479 /*
1480 * <!ELEMENT part (attribute*, variant*, spice?)>
1481 * <!ATTLIST part
1482 * name %String; #REQUIRED
1483 * library %String; #REQUIRED
1484 * library_urn %Urn; ""
1485 * deviceset %String; #REQUIRED
1486 * device %String; #REQUIRED
1487 * package3d_urn %Urn; ""
1488 * override_package3d_urn %Urn; ""
1489 * override_package_urn %Urn; ""
1490 * override_locally_modified %Bool; "no"
1491 * technology %String; ""
1492 * value %String; #IMPLIED
1493 * >
1494 * <!-- library_urn: Only in parts from online libraries -->
1495 */
1496 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1497 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1498 std::unique_ptr<ESPICE> spice;
1499
1500 wxString name;
1501 wxString library;
1503 wxString deviceset;
1504 wxString device;
1511
1512 EPART( wxXmlNode* aPart, IO_BASE* aIo = nullptr );
1513};
1514
1515
1516struct EINSTANCE : public EAGLE_BASE
1517{
1518 /*
1519 * <!ELEMENT instance (attribute)*>
1520 * <!ATTLIST instance
1521 * part %String; #REQUIRED
1522 * gate %String; #REQUIRED
1523 * x %Coord; #REQUIRED
1524 * y %Coord; #REQUIRED
1525 * smashed %Bool; "no"
1526 * rot %Rotation; "R0"
1527 * grouprefs IDREFS #IMPLIED
1528 * >
1529 * <!-- rot: Only 0, 90, 180 or 270 -->
1530 */
1531
1532 wxString part;
1533 wxString gate;
1538
1539 // TODO: add grouprefs
1540
1541 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1542
1543 EINSTANCE( wxXmlNode* aInstance, IO_BASE* aIo = nullptr );
1544};
1545
1546
1547struct ECONNECT : public EAGLE_BASE
1548{
1549 /*
1550 * <!ELEMENT connect EMPTY>
1551 * <!ATTLIST connect
1552 * gate %String; #REQUIRED
1553 * pin %String; #REQUIRED
1554 * pad %String; #REQUIRED
1555 * route %ContactRoute; "all"
1556 * >
1557 */
1558 wxString gate;
1559 wxString pin;
1560 wxString pad;
1562
1563 ECONNECT( wxXmlNode* aConnect, IO_BASE* aIo = nullptr );
1564};
1565
1566
1568{
1569 /*
1570 * <!ELEMENT technology (attribute)*>
1571 * <!ATTLIST technology
1572 * name %String; #REQUIRED
1573 * >
1574 */
1575 wxString name;
1576
1577 std::vector<std::unique_ptr<EATTR>> attributes;
1578
1579 ETECHNOLOGY( wxXmlNode* aTechnology, IO_BASE* aIo = nullptr );
1580};
1581
1582
1584{
1585 /*
1586 * <!ELEMENT package3dinstance EMPTY>
1587 * <!ATTLIST package3dinstance
1588 * package3d_urn %Urn; #REQUIRED
1589 * >
1590 */
1592
1593 EPACKAGE3DINST( wxXmlNode* aPackage3dInst, IO_BASE* aIo = nullptr );
1594};
1595
1596
1597struct EDEVICE : public EAGLE_BASE
1598{
1599 /*
1600 * <!ELEMENT device (connects?, package3dinstances?, technologies?)>
1601 * <!ATTLIST device
1602 * name %String; ""
1603 * package %String; #IMPLIED
1604 * >
1605 */
1606 wxString name;
1608
1609 std::vector<std::unique_ptr<ECONNECT>> connects;
1610 std::vector < std::unique_ptr<EPACKAGE3DINST>> package3dinstances;
1611 std::vector < std::unique_ptr<ETECHNOLOGY>> technologies;
1612
1613 EDEVICE( wxXmlNode* aDevice, IO_BASE* aIo = nullptr );
1614};
1615
1616
1618{
1619 /*
1620 * <!ELEMENT deviceset (description?, gates, devices, spice?)>
1621 * <!ATTLIST deviceset
1622 * name %String; #REQUIRED
1623 * urn %Urn; ""
1624 * locally_modified %Bool; "no"
1625 * prefix %String; ""
1626 * uservalue %Bool; "no"
1627 * library_version %Int; ""
1628 * library_locally_modified %Bool; "no"
1629 * >
1630 * <!-- library_version and library_locally_modified: Only in managed libraries
1631 * inside boards or schematics -->
1632 */
1633
1634 wxString name;
1641
1642 std::optional<EDESCRIPTION> description;
1643 std::map<wxString, std::unique_ptr<EGATE>> gates;
1644 std::vector<std::unique_ptr<EDEVICE>> devices;
1645 std::optional<ESPICE> spice;
1646
1647 EDEVICE_SET( wxXmlNode* aDeviceSet, IO_BASE* aIo = nullptr );
1648};
1649
1650
1651struct ECLASS : public EAGLE_BASE
1652{
1653 /*
1654 * <!ELEMENT class (clearance)*>
1655 * <!ATTLIST class
1656 * number %Class; #REQUIRED
1657 * name %String; #REQUIRED
1658 * width %Dimension; "0"
1659 * drill %Dimension; "0"
1660 * >
1661 */
1662
1663 wxString number;
1664 wxString name;
1667
1668 std::map<wxString, ECOORD> clearanceMap;
1669
1670 ECLASS( wxXmlNode* aClass, IO_BASE* aIo = nullptr );
1671};
1672
1673
1674struct EPORT : public EAGLE_BASE
1675{
1676 /*
1677 * <!ELEMENT port EMPTY>
1678 * <!ATTLIST port
1679 * name %String; #REQUIRED
1680 * side %String; #REQUIRED
1681 * coord %Coord; #REQUIRED
1682 * direction %PortDirection; "io"
1683 * >
1684 *
1685 * The eagle.dtd is incorrect for the EPORT side attribute. It is not an integer, it is a
1686 * string that defines the side of the module rectangle the port is located. Valid values
1687 * are "top", "bottom", "right", and "left".
1688 */
1689 wxString name;
1690 wxString side;
1693
1694 EPORT( wxXmlNode* aPort, IO_BASE* aIo = nullptr );
1695};
1696
1697
1699{
1700 /*
1701 * <!ELEMENT variantdef EMPTY>
1702 * <!ATTLIST variantdef
1703 * name %String; #REQUIRED
1704 * current %Bool; "no"
1705 * >
1706 */
1707 wxString name;
1709
1710 EVARIANTDEF( wxXmlNode* aVariantDef, IO_BASE* aIo = nullptr );
1711};
1712
1713
1715{
1716 /*
1717 * <!ELEMENT schematic_group (attribute*, description?)>
1718 * <!ATTLIST schematic_group
1719 * name ID #REQUIRED
1720 * selectable %Bool; #IMPLIED
1721 * width %Dimension; #IMPLIED
1722 * titleSize %Dimension; #IMPLIED
1723 * titleFont %TextFont; #IMPLIED
1724 * style %WireStyle; #IMPLIED
1725 * showAnnotations %Bool; #IMPLIED
1726 * layer %Layer; #IMPLIED
1727 * grouprefs IDREFS #IMPLIED
1728 * >
1729 */
1730 wxString name;
1739
1740 std::optional<EDESCRIPTION> description;
1741 std::vector<std::unique_ptr<EATTR>> attributes;
1742
1743 ESCHEMATIC_GROUP( wxXmlNode* aSchematicGroup, IO_BASE* aIo = nullptr );
1744};
1745
1746
1747struct EPLAIN : public EAGLE_BASE
1748{
1749 /*
1750 * <!ELEMENT plain (polygon | wire | text | dimension | circle | spline | rectangle |
1751 * frame | hole)*>
1752 */
1753
1754 std::vector<std::unique_ptr<EPOLYGON>> polygons;
1755 std::vector<std::unique_ptr<EWIRE>> wires;
1756 std::vector<std::unique_ptr<ETEXT>> texts;
1757 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
1758 std::vector<std::unique_ptr<ECIRCLE>> circles;
1759 std::vector<std::unique_ptr<ESPLINE>> splines;
1760 std::vector<std::unique_ptr<ERECT>> rectangles;
1761 std::vector<std::unique_ptr<EFRAME>> frames;
1762 std::vector<std::unique_ptr<EHOLE>> holes;
1763
1764 EPLAIN( wxXmlNode* aPlain, IO_BASE* aIo = nullptr );
1765};
1766
1767
1769{
1770 /*
1771 * <!ELEMENT moduleinst (attribute)*>
1772 * <!ATTLIST moduleinst
1773 * name %String; #REQUIRED
1774 * module %String; #REQUIRED
1775 * modulevariant %String; ""
1776 * x %Coord; #REQUIRED
1777 * y %Coord; #REQUIRED
1778 * offset %Int; "0"
1779 * smashed %Bool; "no"
1780 * rot %Rotation; "R0"
1781 * >
1782 * <!-- rot: Only 0, 90, 180 or 270 -->
1783 */
1784
1785 wxString name;
1786 wxString moduleinst;
1793
1794 EMODULEINST( wxXmlNode* aModuleInst, IO_BASE* aIo = nullptr );
1795};
1796
1797
1798struct EPINREF : public EAGLE_BASE
1799{
1800 /*
1801 * <!ELEMENT pinref EMPTY>
1802 * <!ATTLIST pinref
1803 * part %String; #REQUIRED
1804 * gate %String; #REQUIRED
1805 * pin %String; #REQUIRED
1806 * >
1807 */
1808 wxString part;
1809 wxString gate;
1810 wxString pin;
1811
1812 EPINREF( wxXmlNode* aPinRef, IO_BASE* aIo = nullptr );
1813};
1814
1815
1816struct EPORTREF : public EAGLE_BASE
1817{
1818 /*
1819 * <!ELEMENT portref EMPTY>
1820 * <!ATTLIST portref
1821 * moduleinst %String; #REQUIRED
1822 * port %String; #REQUIRED
1823 * >
1824 */
1825 wxString moduleinst;
1826 wxString port;
1827
1828 EPORTREF( wxXmlNode* aPortRef, IO_BASE* aIo = nullptr );
1829};
1830
1831
1832struct EPROBE : public EAGLE_BASE
1833{
1834 /*
1835 * <!ELEMENT probe EMPTY>
1836 * <!ATTLIST probe
1837 * x %Coord; #REQUIRED
1838 * y %Coord; #REQUIRED
1839 * size %Dimension; #REQUIRED
1840 * layer %Layer; #REQUIRED
1841 * font %TextFont; "proportional"
1842 * ratio %Int; "8"
1843 * rot %Rotation; "R0"
1844 * xref %Bool; "no"
1845 * grouprefs IDREFS #IMPLIED
1846 * >
1847 * <!-- rot: Only 0, 90, 180 or 270 -->
1848 * <!-- xref: Only in <net> context -->
1849 */
1852 double size;
1858
1859 // TODO add grouprefs
1860
1861 EPROBE( wxXmlNode* aProbe, IO_BASE* aIo = nullptr );
1862};
1863
1864
1865struct ESEGMENT : public EAGLE_BASE
1866{
1867 /*
1868 * <!ELEMENT segment (pinref | portref | wire | junction | label | probe)*>
1869 * <!-- 'pinref' and 'junction' are only valid in a <net> context -->
1870 */
1871 std::vector<std::unique_ptr<EPINREF>> pinRefs;
1872 std::vector<std::unique_ptr<EPORTREF>> portRefs;
1873 std::vector<std::unique_ptr<EWIRE>> wires;
1874 std::vector<std::unique_ptr<EJUNCTION>> junctions;
1875 std::vector<std::unique_ptr<ELABEL>> labels;
1876 std::vector<std::unique_ptr<EPROBE>> probes;
1877
1878 ESEGMENT( wxXmlNode* aSegment, IO_BASE* aIo = nullptr );
1879};
1880
1881
1882struct EBUS : public EAGLE_BASE
1883{
1884 /*
1885 * <!ELEMENT bus (segment)*>
1886 * <!ATTLIST bus
1887 * name %String; #REQUIRED
1888 * >
1889 */
1890
1891 wxString name;
1892 std::vector<std::unique_ptr<ESEGMENT>> segments;
1893
1894 EBUS( wxXmlNode* aBus, IO_BASE* aIo = nullptr );
1895};
1896
1897
1898struct ESHEET : public EAGLE_BASE
1899{
1900 /*
1901 * <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
1902 */
1903
1904 std::optional<EDESCRIPTION> description;
1905 std::unique_ptr<EPLAIN> plain;
1906 std::map<wxString, std::unique_ptr<EMODULEINST>> moduleinsts;
1907 std::vector<std::unique_ptr<EINSTANCE>> instances;
1908 std::vector<std::unique_ptr<EBUS>> busses;
1909 std::vector<std::unique_ptr<ENET>> nets;
1910
1911 ESHEET( wxXmlNode* aSheet, IO_BASE* aIo = nullptr );
1912};
1913
1914
1915struct EMODULE : public EAGLE_BASE
1916{
1917 /*
1918 * <!ELEMENT module (description?, ports?, variantdefs?, groups?, parts?, sheets?)>
1919 * <!ATTLIST module
1920 * name %String; #REQUIRED
1921 * prefix %String; ""
1922 * dx %Coord; #REQUIRED
1923 * dy %Coord; #REQUIRED
1924 * >
1925 */
1926 wxString name;
1930
1931 std::optional<EDESCRIPTION> description;
1932 std::map<wxString, std::unique_ptr<EPORT>> ports;
1933 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
1934 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
1935 std::map<wxString, std::unique_ptr<EPART>> parts;
1936 std::vector<std::unique_ptr<ESHEET>> sheets;
1937
1938 EMODULE( wxXmlNode* aModule, IO_BASE* aIo = nullptr );
1939};
1940
1941
1942struct ENOTE : public EAGLE_BASE
1943{
1944 /*
1945 * <!ELEMENT note (#PCDATA)>
1946 * <!ATTLIST note
1947 * version %Real; #REQUIRED
1948 * severity %Severity; #REQUIRED
1949 * >
1950 * <!-- version: The EAGLE program version that introduced this compatibility note -->
1951 */
1952 double version;
1953 wxString severity;
1954 wxString note;
1955
1956 ENOTE( wxXmlNode* aNote, IO_BASE* aIo = nullptr );
1957};
1958
1959
1961{
1962 /*
1963 * <!ELEMENT compatibility (note)*>
1964 */
1965 std::vector<std::unique_ptr<ENOTE>> notes;
1966
1967 ECOMPATIBILITY( wxXmlNode* aCompatibility, IO_BASE* aIo = nullptr );
1968};
1969
1970
1971struct ESETTING : public EAGLE_BASE
1972{
1973 /*
1974 * <!ELEMENT setting EMPTY>
1975 * <!ATTLIST setting
1976 * alwaysvectorfont %Bool; #IMPLIED
1977 * verticaltext %VerticalText; "up"
1978 * keepoldvectorfont %Bool; "no"
1979 * >
1980 */
1984
1985 ESETTING( wxXmlNode* aSetting, IO_BASE* aIo = nullptr );
1986};
1987
1988
1989struct EGRID : public EAGLE_BASE
1990{
1991 /*
1992 * <!ELEMENT grid EMPTY>
1993 * <!ATTLIST grid
1994 * distance %Real; #IMPLIED
1995 * unitdist %GridUnit; #IMPLIED
1996 * unit %GridUnit; #IMPLIED
1997 * style %GridStyle; "lines"
1998 * multiple %Int; "1"
1999 * display %Bool; "no"
2000 * altdistance %Real; #IMPLIED
2001 * altunitdist %GridUnit; #IMPLIED
2002 * altunit %GridUnit; #IMPLIED
2003 * >
2004 */
2014
2015 EGRID( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2016};
2017
2018
2019struct EFILTER : public EAGLE_BASE
2020{
2021 /*
2022 * <!ELEMENT filter EMPTY>
2023 * <!ATTLIST filter
2024 * name %String; #REQUIRED
2025 * expression %String; #REQUIRED
2026 * >
2027 */
2028 wxString name;
2029 wxString expression;
2030
2031 EFILTER( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2032};
2033
2034
2035struct EPACKAGE : public EAGLE_BASE
2036{
2037 /*
2038 * <!ELEMENT package (description?, (polygon | wire | text | dimension | circle |
2039 * rectangle | frame | hole | pad | smd)*)>
2040 * <!ATTLIST package
2041 * name %String; #REQUIRED
2042 * urn %Urn; ""
2043 * locally_modified %Bool; "no"
2044 * library_version %Int; ""
2045 * library_locally_modified %Bool; "no"
2046 * >
2047 * <!-- library_version and library_locally_modified: Only in managed libraries
2048 * inside boards or schematics -->
2049 */
2050 wxString name;
2055
2056 std::optional<EDESCRIPTION> description;
2057 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2058 std::vector<std::unique_ptr<EWIRE>> wires;
2059 std::vector<std::unique_ptr<ETEXT>> texts;
2060 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2061 std::vector<std::unique_ptr<ECIRCLE>> circles;
2062 std::vector<std::unique_ptr<ERECT>> rectangles;
2063 std::vector<std::unique_ptr<EFRAME>> frames;
2064 std::vector<std::unique_ptr<EHOLE>> holes;
2065 std::vector<std::unique_ptr<EPAD>> thtpads;
2066 std::vector<std::unique_ptr<ESMD>> smdpads;
2067
2068 EPACKAGE( wxXmlNode* aPackage, IO_BASE* aIo = nullptr );
2069};
2070
2071
2073{
2074 /*
2075 * <!ELEMENT packageinstance EMPTY>
2076 * <!ATTLIST packageinstance
2077 * name %String; #REQUIRED
2078 * >
2079 */
2080 wxString name;
2081
2082 EPACKAGEINSTANCE( wxXmlNode* aPackageInstance, IO_BASE* aIo = nullptr );
2083};
2084
2085
2086struct EPACKAGE3D : public EAGLE_BASE
2087{
2088 /*
2089 * <!ELEMENT package3d (description?, packageinstances?)>
2090 * <!ATTLIST package3d
2091 * name %String; ""
2092 * urn %Urn; #REQUIRED
2093 * type %Package3dType; #REQUIRED
2094 * library_version %Int; ""
2095 * library_locally_modified %Bool; "no"
2096 * >
2097 * <!-- library_version and library_locally_modified: Only in managed libraries
2098 * inside boards or schematics -->
2099 */
2100 wxString name;
2102 wxString type;
2105
2106 std::optional<EDESCRIPTION> description;
2107 std::vector<std::unique_ptr<EPACKAGEINSTANCE>> packageinstances;
2108
2109 EPACKAGE3D( wxXmlNode* aPackage3d, IO_BASE* aIo = nullptr );
2110};
2111
2112
2113struct ESYMBOL : public EAGLE_BASE
2114{
2115 /*
2116 * <!ELEMENT symbol (description?, (polygon | wire | text | dimension | pin | circle |
2117 * rectangle | frame)*)>
2118 * <!ATTLIST symbol
2119 * name %String; #REQUIRED
2120 * urn %Urn; ""
2121 * locally_modified %Bool; "no"
2122 * library_version %Int; ""
2123 * library_locally_modified %Bool; "no"
2124 * >
2125 * <!-- library_version and library_locally_modified: Only in managed libraries
2126 * inside boards or schematics -->
2127 */
2128
2129 wxString name;
2134
2135 std::optional<EDESCRIPTION> description;
2136 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2137 std::vector<std::unique_ptr<EWIRE>> wires;
2138 std::vector<std::unique_ptr<ETEXT>> texts;
2139 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2140 std::vector<std::unique_ptr<EPIN>> pins;
2141 std::vector<std::unique_ptr<ECIRCLE>> circles;
2142 std::vector<std::unique_ptr<ERECT>> rectangles;
2143 std::vector<std::unique_ptr<EFRAME>> frames;
2144
2145 ESYMBOL( wxXmlNode* aSymbol, IO_BASE* aIo = nullptr );
2146};
2147
2148
2149struct ELIBRARY : public EAGLE_BASE
2150{
2151 /*
2152 * <!ELEMENT library (description?, packages?, packages3d?, symbols?, devicesets?)>
2153 * <!ATTLIST library
2154 * name %String; #REQUIRED
2155 * urn %Urn; ""
2156 * >
2157 * <!-- name: Only in libraries used inside boards or schematics -->
2158 * <!-- urn: Only in online libraries used inside boards or schematics -->
2159 */
2160 wxString name;
2162
2163 std::optional<EDESCRIPTION> description;
2164 std::map<wxString, std::unique_ptr<EPACKAGE>> packages;
2165 std::map<wxString, std::unique_ptr<EPACKAGE3D>> packages3d;
2166 std::map<wxString, std::unique_ptr<ESYMBOL>> symbols;
2167 std::map<wxString, std::unique_ptr<EDEVICE_SET>> devicesets;
2168
2174 wxString GetName() const;
2175 ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo = nullptr );
2176};
2177
2178
2179struct EAPPROVED : public EAGLE_BASE
2180{
2181 /*
2182 * <!ELEMENT approved EMPTY>
2183 * <!ATTLIST approved
2184 * hash %String; #REQUIRED
2185 * >
2186 */
2187 wxString hash;
2188
2189 EAPPROVED( wxXmlNode* aApproved, IO_BASE* aIo = nullptr );
2190};
2191
2192
2193struct ESCHEMATIC : public EAGLE_BASE
2194{
2195 /*
2196 * <!ELEMENT schematic (description?, libraries?, attributes?, variantdefs?, classes?,
2197 * modules?, groups?, parts?, sheets?, errors?)>
2198 * <!ATTLIST schematic
2199 * xreflabel %String; #IMPLIED
2200 * xrefpart %String; #IMPLIED
2201 * >
2202 */
2205
2206 std::optional<EDESCRIPTION> description;
2207 std::map<wxString, std::unique_ptr<ELIBRARY>> libraries;
2208 std::map<wxString, std::unique_ptr<EATTR>> attributes;
2209 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
2210 std::map<wxString, std::unique_ptr<ECLASS>> classes;
2211 std::map<wxString, std::unique_ptr<EMODULE>> modules;
2212 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
2213 std::map<wxString, std::unique_ptr<EPART>> parts;
2214 std::vector<std::unique_ptr<ESHEET>> sheets;
2215 std::vector<std::unique_ptr<EAPPROVED>> errors;
2216
2217 ESCHEMATIC( wxXmlNode* aSchematic, IO_BASE* aIo = nullptr );
2218};
2219
2220
2221struct EDRAWING : public EAGLE_BASE
2222{
2223 /*
2224 * <!ELEMENT drawing (settings?, grid?, filters?, layers, (library | schematic | board))>
2225 */
2226 std::vector<std::unique_ptr<ESETTING>> settings;
2227 std::optional<EGRID> grid;
2228 std::vector<std::unique_ptr<EFILTER>> filters;
2229 std::vector<std::unique_ptr<ELAYER>> layers;
2230 std::optional<ESCHEMATIC> schematic;
2231 std::optional<ELIBRARY> library;
2232 // std::optional<std::unique_ptr<EBOARD>> board;
2233
2234 EDRAWING( wxXmlNode* aDrawing, IO_BASE* aIo = nullptr );
2235};
2236
2237
2238struct EAGLE_DOC : public EAGLE_BASE
2239{
2240 /*
2241 * <!ELEMENT eagle (compatibility?, drawing, compatibility?)>
2242 * <!ATTLIST eagle
2243 * version %Real; #REQUIRED
2244 * >
2245 * <!-- version: The EAGLE program version that generated this file, in the
2246 * form V.RR -->
2247 */
2248
2256 wxString version;
2257
2258 std::unique_ptr<EDRAWING> drawing;
2259 std::optional<ECOMPATIBILITY> compatibility;
2260
2261 EAGLE_DOC( wxXmlNode* aEagleDoc, IO_BASE* aIo = nullptr );
2262};
2263
2264
2265#endif // _EAGLE_PARSER_H_
Model an optional XML attribute.
bool operator==(const T &aOther) const
const T * operator->() const
Return a constant pointer to the value of the attribute assuming it is available.
OPTIONAL_XML_ATTRIBUTE< T > & operator=(const wxString &aData)
Assign to a string (optionally) containing the data.
T * operator->()
Return a pointer to the value of the attribute assuming it is available.
const T & operator*() const
Return a constant reference to the value of the attribute assuming it is available.
OPTIONAL_XML_ATTRIBUTE(const wxString &aData)
const T & CGet() const
Return a constant reference to the value of the attribute assuming it is available.
void Set(const wxString &aString)
Attempt to convert a string to the base type.
T & operator*()
Return a reference to the value of the attribute assuming it is available.
T & Get()
Return a reference to the value of the attribute assuming it is available.
OPTIONAL_XML_ATTRIBUTE()
Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
Keep track of what we are working on within a PTREE.
void pop()
void clear()
void Value(const char *aValue)
modify the last path node's value
std::vector< TRIPLET > p
void Attribute(const char *aAttribute)
Modify the last path node's attribute.
void push(const char *aPathSegment, const char *aAttribute="")
wxString Contents()
Return the contents of the XPATH as a single string.
OPTIONAL_XML_ATTRIBUTE< EURN > opt_eurn
OPTIONAL_XML_ATTRIBUTE< ECOORD > opt_ecoord
T Convert(const wxString &aValue)
Convert a wxString to a generic type T.
OPTIONAL_XML_ATTRIBUTE< int > opt_int
static wxXmlNode * getChildrenNodes(NODE_MAP &aMap, const wxString &aName)
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
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 Convert< wxString >(const wxString &aValue)
size_t GetNodeCount(const wxXmlNode *aNode)
Fetch the number of XML nodes within aNode.
OPTIONAL_XML_ATTRIBUTE< wxString > opt_wxString
std::map< wxString, EINSTANCE * > EINSTANCE_MAP
std::unordered_map< wxString, wxXmlNode * > NODE_MAP
OPTIONAL_XML_ATTRIBUTE< bool > opt_bool
OPTIONAL_XML_ATTRIBUTE< double > opt_double
VECTOR2I ConvertArcCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle)
Convert an Eagle curve end to a KiCad center for S_ARC.
wxString convertDescription(wxString aDescr)
Converts Eagle's HTML description into KiCad description format.
std::map< wxString, std::unique_ptr< EPART > > EPART_MAP
SEVERITY
@ RPT_SEVERITY_UNDEFINED
EAGLE_BASE(IO_BASE *aIo=nullptr)
IO_BASE * io
void AdvanceProgressPhase()
void Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Send a message to the IO_BASE REPORTER object if one exists.
EAGLE_DOC(wxXmlNode *aEagleDoc, IO_BASE *aIo=nullptr)
std::optional< ECOMPATIBILITY > compatibility
wxString version
The Eagle XML file version.
std::unique_ptr< EDRAWING > drawing
EAPPROVED(wxXmlNode *aApproved, IO_BASE *aIo=nullptr)
wxString hash
opt_wxString font
opt_double ratio
opt_wxString value
opt_ecoord size
opt_ecoord y
wxString name
opt_erot rot
opt_int align
opt_int display
opt_ecoord x
opt_bool constant
opt_int layer
EATTR(wxXmlNode *aTree, IO_BASE *aIo=nullptr)
EBUS(wxXmlNode *aBus, IO_BASE *aIo=nullptr)
wxString name
std::vector< std::unique_ptr< ESEGMENT > > segments
ECOORD x
ECOORD radius
ECOORD y
ECIRCLE(wxXmlNode *aCircle, IO_BASE *aIo=nullptr)
ECOORD width
wxString number
opt_ecoord drill
std::map< wxString, ECOORD > clearanceMap
opt_ecoord width
ECLASS(wxXmlNode *aClass, IO_BASE *aIo=nullptr)
wxString name
std::vector< std::unique_ptr< ENOTE > > notes
ECOMPATIBILITY(wxXmlNode *aCompatibility, IO_BASE *aIo=nullptr)
opt_wxString contactroute
wxString pad
ECONNECT(wxXmlNode *aConnect, IO_BASE *aIo=nullptr)
wxString gate
wxString pin
int ToNanoMeters() const
ECOORD operator+(const ECOORD &aOther) const
@ EU_NM
nanometers
@ EU_MM
millimeters
@ EU_MIL
mils/thous
@ EU_INCH
inches
int ToSchUnits() const
float ToMm() const
ECOORD operator-(const ECOORD &aOther) const
int ToMils() const
int To100NanoMeters() const
ECOORD(int aValue, enum EAGLE_UNIT aUnit)
long long int value
Value expressed in nanometers.
bool operator==(const ECOORD &aOther) const
static long long int ConvertToNm(int aValue, enum EAGLE_UNIT aUnit)
Converts a size expressed in a certain unit to nanometers.
int ToPcbUnits() const
static constexpr EAGLE_UNIT ECOORD_UNIT
Unit used for the value field.
opt_wxString language
wxString text
EDESCRIPTION(wxXmlNode *aDescription, IO_BASE *aIo=nullptr)
opt_bool uservalue
opt_bool library_locally_modified
std::vector< std::unique_ptr< EDEVICE > > devices
opt_bool locally_modified
std::optional< EDESCRIPTION > description
opt_int library_version
opt_wxString prefix
EDEVICE_SET(wxXmlNode *aDeviceSet, IO_BASE *aIo=nullptr)
std::map< wxString, std::unique_ptr< EGATE > > gates
std::optional< ESPICE > spice
wxString name
std::vector< std::unique_ptr< EPACKAGE3DINST > > package3dinstances
wxString name
std::vector< std::unique_ptr< ECONNECT > > connects
EDEVICE(wxXmlNode *aDevice, IO_BASE *aIo=nullptr)
opt_wxString package
std::vector< std::unique_ptr< ETECHNOLOGY > > technologies
opt_double extwidth
opt_int precision
opt_wxString dimensionType
opt_int textratio
opt_double width
opt_double extoffset
opt_ecoord textsize
EDIMENSION(wxXmlNode *aDimension, IO_BASE *aIo=nullptr)
opt_double extlength
opt_wxString unit
opt_bool visible
std::optional< ESCHEMATIC > schematic
std::optional< ELIBRARY > library
EDRAWING(wxXmlNode *aDrawing, IO_BASE *aIo=nullptr)
std::vector< std::unique_ptr< ESETTING > > settings
std::vector< std::unique_ptr< ELAYER > > layers
std::optional< EGRID > grid
std::vector< std::unique_ptr< EFILTER > > filters
EELEMENT(wxXmlNode *aElement, IO_BASE *aIo=nullptr)
opt_erot rot
wxString name
wxString library
wxString package
opt_wxString package3d_urn
opt_bool smashed
opt_wxString override_package3d_urn
wxString value
opt_bool override_locally_modified
opt_bool locked
std::map< wxString, std::unique_ptr< EATTR > > attributes
std::map< wxString, std::unique_ptr< EVARIANT > > variants
opt_eurn library_urn
wxString expression
EFILTER(wxXmlNode *aGrid, IO_BASE *aIo=nullptr)
wxString name
ECOORD x1
opt_bool border_bottom
opt_bool border_left
opt_bool border_right
ECOORD y1
opt_bool border_top
ECOORD y2
EFRAME(wxXmlNode *aFrameNode, IO_BASE *aIo=nullptr)
ECOORD x2
opt_int swaplevel
ECOORD x
ECOORD y
wxString symbol
EGATE(wxXmlNode *aGate, IO_BASE *aIo=nullptr)
wxString name
opt_int addlevel
opt_wxString style
opt_int multiple
opt_wxString unit
opt_bool display
EGRID(wxXmlNode *aGrid, IO_BASE *aIo=nullptr)
opt_wxString altunit
opt_wxString unitdist
opt_wxString altunitdist
opt_double altdistance
opt_double distance
ECOORD y
ECOORD drill
ECOORD x
EHOLE(wxXmlNode *aHole, IO_BASE *aIo=nullptr)
wxString part
std::map< wxString, std::unique_ptr< EATTR > > attributes
opt_erot rot
wxString gate
opt_bool smashed
EINSTANCE(wxXmlNode *aInstance, IO_BASE *aIo=nullptr)
EJUNCTION(wxXmlNode *aJunction, IO_BASE *aIo=nullptr)
opt_erot rot
opt_wxString font
opt_int ratio
ELABEL(wxXmlNode *aLabel, IO_BASE *aIo=nullptr)
ECOORD size
opt_wxString align
opt_bool xref
ECOORD y
ECOORD x
wxString name
opt_bool visible
opt_bool active
ELAYER(wxXmlNode *aLayer, IO_BASE *aIo=nullptr)
std::map< wxString, std::unique_ptr< EDEVICE_SET > > devicesets
wxString GetName() const
Fetch the fully unique library name.
std::map< wxString, std::unique_ptr< EPACKAGE3D > > packages3d
std::map< wxString, std::unique_ptr< EPACKAGE > > packages
wxString name
std::optional< EDESCRIPTION > description
std::map< wxString, std::unique_ptr< ESYMBOL > > symbols
opt_eurn urn
ELIBRARY(wxXmlNode *aLibrary, IO_BASE *aIo=nullptr)
wxString name
wxString model
EMODEL(wxXmlNode *aModel, IO_BASE *aIo=nullptr)
opt_bool smashed
wxString name
EMODULEINST(wxXmlNode *aModuleInst, IO_BASE *aIo=nullptr)
opt_erot rotation
opt_wxString moduleVariant
wxString moduleinst
std::map< wxString, std::unique_ptr< EPART > > parts
ECOORD dy
std::map< wxString, std::unique_ptr< ESCHEMATIC_GROUP > > groups
std::vector< std::unique_ptr< ESHEET > > sheets
std::optional< EDESCRIPTION > description
EMODULE(wxXmlNode *aModule, IO_BASE *aIo=nullptr)
opt_wxString prefix
std::map< wxString, std::unique_ptr< EVARIANTDEF > > variantdefs
ECOORD dx
wxString name
std::map< wxString, std::unique_ptr< EPORT > > ports
int netcode
wxString netname
std::vector< std::unique_ptr< ESEGMENT > > segments
ENET(int aNetCode, const wxString &aNetName)
ENOTE(wxXmlNode *aNote, IO_BASE *aIo=nullptr)
wxString note
double version
wxString severity
EPACKAGE3DINST(wxXmlNode *aPackage3dInst, IO_BASE *aIo=nullptr)
wxString package3d_urn
opt_bool library_locally_modified
wxString name
std::optional< EDESCRIPTION > description
opt_int library_version
std::vector< std::unique_ptr< EPACKAGEINSTANCE > > packageinstances
wxString type
EPACKAGE3D(wxXmlNode *aPackage3d, IO_BASE *aIo=nullptr)
EPACKAGEINSTANCE(wxXmlNode *aPackageInstance, IO_BASE *aIo=nullptr)
std::vector< std::unique_ptr< EPOLYGON > > polygons
std::vector< std::unique_ptr< EPAD > > thtpads
std::vector< std::unique_ptr< ECIRCLE > > circles
std::vector< std::unique_ptr< ESMD > > smdpads
std::vector< std::unique_ptr< EDIMENSION > > dimensions
opt_bool library_locally_modified
std::vector< std::unique_ptr< EHOLE > > holes
opt_int library_version
wxString name
std::vector< std::unique_ptr< EFRAME > > frames
std::vector< std::unique_ptr< ERECT > > rectangles
std::vector< std::unique_ptr< ETEXT > > texts
std::vector< std::unique_ptr< EWIRE > > wires
std::optional< EDESCRIPTION > description
EPACKAGE(wxXmlNode *aPackage, IO_BASE *aIo=nullptr)
opt_eurn urn
opt_bool locally_modified
opt_bool thermals
EPAD_COMMON(wxXmlNode *aPad, IO_BASE *aIo=nullptr)
opt_bool stop
wxString name
opt_ecoord diameter
opt_bool first
opt_ecoord drill
opt_int shape
EPAD(wxXmlNode *aPad, IO_BASE *aIo=nullptr)
wxString device
std::unique_ptr< ESPICE > spice
opt_bool override_locally_modified
wxString library
opt_wxString override_package_urn
opt_wxString technology
std::map< wxString, std::unique_ptr< EATTR > > attributes
opt_eurn libraryUrn
opt_wxString override_package3d_urn
EPART(wxXmlNode *aPart, IO_BASE *aIo=nullptr)
wxString deviceset
opt_wxString package3d_urn
opt_wxString value
std::map< wxString, std::unique_ptr< EVARIANT > > variants
wxString name
EPINMAPPING(wxXmlNode *aPinMap, IO_BASE *aIo=nullptr)
opt_bool iddevicewide
opt_wxString spiceprefix
opt_bool isusermap
std::vector< std::unique_ptr< EPINMAP > > pinmaps
wxString pinorder
wxString gate
wxString pin
EPINMAP(wxXmlNode *aPinMap, IO_BASE *aIo=nullptr)
wxString gate
EPINREF(wxXmlNode *aPinRef, IO_BASE *aIo=nullptr)
wxString pin
wxString part
EPIN(wxXmlNode *aPin, IO_BASE *aIo=nullptr)
ECOORD x
wxString name
opt_int swaplevel
opt_wxString visible
opt_wxString direction
opt_wxString length
opt_wxString function
opt_erot rot
ECOORD y
std::vector< std::unique_ptr< EWIRE > > wires
std::vector< std::unique_ptr< EPOLYGON > > polygons
std::vector< std::unique_ptr< ETEXT > > texts
std::vector< std::unique_ptr< ECIRCLE > > circles
EPLAIN(wxXmlNode *aPlain, IO_BASE *aIo=nullptr)
std::vector< std::unique_ptr< EFRAME > > frames
std::vector< std::unique_ptr< ESPLINE > > splines
std::vector< std::unique_ptr< ERECT > > rectangles
std::vector< std::unique_ptr< EDIMENSION > > dimensions
std::vector< std::unique_ptr< EHOLE > > holes
opt_bool orphans
opt_int rank
opt_bool thermals
opt_ecoord spacing
static const int max_priority
std::vector< std::unique_ptr< EVERTEX > > vertices
EPOLYGON(wxXmlNode *aPolygon, IO_BASE *aIo=nullptr)
ECOORD width
opt_ecoord isolate
wxString port
EPORTREF(wxXmlNode *aPortRef, IO_BASE *aIo=nullptr)
wxString moduleinst
opt_wxString direction
wxString name
EPORT(wxXmlNode *aPort, IO_BASE *aIo=nullptr)
wxString side
ECOORD coord
double size
ECOORD y
opt_erot rot
opt_wxString font
ECOORD x
EPROBE(wxXmlNode *aProbe, IO_BASE *aIo=nullptr)
opt_bool xref
ECOORD x2
ECOORD y1
opt_erot rot
int layer
ERECT(wxXmlNode *aRect, IO_BASE *aIo=nullptr)
ECOORD y2
ECOORD x1
Eagle rotation.
double degrees
bool spin
EROT(double aDegrees)
bool mirror
std::vector< std::unique_ptr< EATTR > > attributes
ESCHEMATIC_GROUP(wxXmlNode *aSchematicGroup, IO_BASE *aIo=nullptr)
opt_bool showAnnotations
std::optional< EDESCRIPTION > description
opt_wxString titleFont
opt_wxString grouprefs
opt_wxString wireStyle
opt_ecoord titleSize
std::map< wxString, std::unique_ptr< EMODULE > > modules
opt_wxString xreflabel
opt_wxString xrefpart
std::map< wxString, std::unique_ptr< EATTR > > attributes
std::vector< std::unique_ptr< EAPPROVED > > errors
std::optional< EDESCRIPTION > description
std::map< wxString, std::unique_ptr< ECLASS > > classes
std::vector< std::unique_ptr< ESHEET > > sheets
std::map< wxString, std::unique_ptr< EPART > > parts
ESCHEMATIC(wxXmlNode *aSchematic, IO_BASE *aIo=nullptr)
std::map< wxString, std::unique_ptr< ELIBRARY > > libraries
std::map< wxString, std::unique_ptr< EVARIANTDEF > > variantdefs
std::map< wxString, std::unique_ptr< ESCHEMATIC_GROUP > > groups
std::vector< std::unique_ptr< EPORTREF > > portRefs
std::vector< std::unique_ptr< EPROBE > > probes
std::vector< std::unique_ptr< EPINREF > > pinRefs
ESEGMENT(wxXmlNode *aSegment, IO_BASE *aIo=nullptr)
std::vector< std::unique_ptr< EWIRE > > wires
std::vector< std::unique_ptr< EJUNCTION > > junctions
std::vector< std::unique_ptr< ELABEL > > labels
opt_bool alwaysvectorfont
opt_bool keepoldvectorfont
opt_wxString verticaltext
ESETTING(wxXmlNode *aSetting, IO_BASE *aIo=nullptr)
ESHEET(wxXmlNode *aSheet, IO_BASE *aIo=nullptr)
std::unique_ptr< EPLAIN > plain
std::vector< std::unique_ptr< ENET > > nets
std::vector< std::unique_ptr< EBUS > > busses
std::vector< std::unique_ptr< EINSTANCE > > instances
std::optional< EDESCRIPTION > description
std::map< wxString, std::unique_ptr< EMODULEINST > > moduleinsts
opt_int roundness
ECOORD dx
int layer
opt_bool cream
ECOORD dy
ESMD(wxXmlNode *aSMD, IO_BASE *aIo=nullptr)
ESPICE(wxXmlNode *aSpice, IO_BASE *aIo=nullptr)
std::unique_ptr< EMODEL > model
std::unique_ptr< EPINMAPPING > pinmapping
std::vector< std::unique_ptr< EVERTEX > > vertices
double width
ESPLINE(wxXmlNode *aSpline, IO_BASE *aIo=nullptr)
std::vector< std::unique_ptr< EFRAME > > frames
opt_int library_version
std::optional< EDESCRIPTION > description
std::vector< std::unique_ptr< EPIN > > pins
std::vector< std::unique_ptr< ECIRCLE > > circles
opt_bool library_locally_modified
std::vector< std::unique_ptr< ETEXT > > texts
std::vector< std::unique_ptr< EPOLYGON > > polygons
opt_eurn urn
std::vector< std::unique_ptr< ERECT > > rectangles
std::vector< std::unique_ptr< EWIRE > > wires
ESYMBOL(wxXmlNode *aSymbol, IO_BASE *aIo=nullptr)
opt_bool locally_modified
wxString name
std::vector< std::unique_ptr< EDIMENSION > > dimensions
wxString name
std::vector< std::unique_ptr< EATTR > > attributes
ETECHNOLOGY(wxXmlNode *aTechnology, IO_BASE *aIo=nullptr)
Eagle text element.
opt_double ratio
wxString text
@ BOTTOM_CENTER
@ BOTTOM_RIGHT
@ CENTER_RIGHT
@ CENTER_LEFT
@ BOTTOM_LEFT
ECOORD y
opt_int distance
ECOORD size
ETEXT(wxXmlNode *aText, IO_BASE *aIo=nullptr)
opt_erot rot
opt_int align
ECOORD x
VECTOR2I ConvertSize() const
Calculate text size based on font type and size.
opt_wxString font
int layer
Container that parses Eagle library file "urn" definitions.
bool IsValid() const
Check if the string passed to the ctor was a valid Eagle urn.
wxString host
Should always be "urn".
void Parse(const wxString &aUrn)
wxString assetVersion
May be empty depending on the asset type.
wxString assetId
The unique asset identifier for the asset type.
wxString assetType
Must be "symbol", "footprint", "package", "component", or "library".
wxString path
Path to the asset type below.
EVARIANTDEF(wxXmlNode *aVariantDef, IO_BASE *aIo=nullptr)
opt_bool current
wxString name
opt_bool populate
opt_wxString technology
EVARIANT(wxXmlNode *aVariant, IO_BASE *aIo=nullptr)
wxString name
opt_wxString value
EVERTEX(wxXmlNode *aVertex, IO_BASE *aIo=nullptr)
ECOORD y
ECOORD x
opt_double curve
range is -359.9..359.9
opt_ecoord diam
ECOORD drill
< inclusive
ECOORD y
EVIA(wxXmlNode *aVia, IO_BASE *aIo=nullptr)
opt_wxString shape
int layer_front_most
int layer_back_most
< extent
ECOORD x
opt_bool alwaysStop
ECOORD width
int layer
EWIRE(wxXmlNode *aWire, IO_BASE *aIo=nullptr)
opt_wxString extent
ECOORD x2
opt_int cap
opt_int style
ECOORD y2
ECOORD x1
ECOORD y1
opt_double curve
range is -359.9..359.9
TRIPLET(const char *aElement, const char *aAttribute="", const char *aValue="")
const char * value
const char * attribute
const char * element
Implement a simple wrapper around runtime_error to isolate the errors thrown by the Eagle XML parser.
XML_PARSER_ERROR(const wxString &aMessage) noexcept
Build an XML error by just calling its parent class constructor, std::runtime_error,...
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695