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
432struct EURN : public EAGLE_BASE
433{
434 EURN() {}
435
437 EURN( const wxString& aUrn );
438
439 void Parse( const wxString& aUrn );
440
447 bool IsValid() const;
448
449 wxString host;
450 wxString path;
451 wxString assetType;
452 wxString assetId;
453 wxString assetVersion;
454};
455
456
457// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
458// For maintenance and troubleshooting purposes, it was thought that we'd need to
459// separate the conversion process into distinct steps. There is no intent to have KiCad
460// forms of information in these 'E'STRUCTS. They are only binary forms
461// of the Eagle information in the corresponding Eagle XML nodes.
462
463
465{
466 /*
467 * <!ELEMENT description (#PCDATA)>
468 * <!ATTLIST description
469 * language %String; "en"
470 * >
471 */
472
473 wxString text;
475
476 EDESCRIPTION( wxXmlNode* aDescription, IO_BASE* aIo = nullptr );
477};
478
479
480// Eagle coordinates
481struct ECOORD : public EAGLE_BASE
482{
490
492 long long int value;
493
495 static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
496
498 : value( 0 )
499 {
500 }
501
502 ECOORD( int aValue, enum EAGLE_UNIT aUnit )
503 : value( ConvertToNm( aValue, aUnit ) )
504 {
505 }
506
507 ECOORD( const wxString& aValue, enum EAGLE_UNIT aUnit );
508
509 int ToMils() const
510 {
511 return value / 25400;
512 }
513
514 int To100NanoMeters() const
515 {
516 return value / 100;
517 }
518
519 int ToNanoMeters() const
520 {
521 return value;
522 }
523
524 float ToMm() const
525 {
526 return value / 1000000.0;
527 }
528
529 int ToSchUnits() const { return To100NanoMeters(); }
530 int ToPcbUnits() const { return ToNanoMeters(); }
531
532 ECOORD operator+( const ECOORD& aOther ) const
533 {
534 return ECOORD( value + aOther.value, ECOORD_UNIT );
535 }
536
537 ECOORD operator-( const ECOORD& aOther ) const
538 {
539 return ECOORD( value - aOther.value, ECOORD_UNIT );
540 }
541
542 bool operator==( const ECOORD& aOther ) const
543 {
544 return value == aOther.value;
545 }
546
548 static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
549};
550
551
553struct ENET : public EAGLE_BASE
554{
555 /*
556 * <!ELEMENT net (segment)*>
557 * <!ATTLIST net
558 * name %String; #REQUIRED
559 * class %Class; "0"
560 * >
561 */
562 wxString netname;
564
565 std::vector<std::unique_ptr<ESEGMENT>> segments;
566
567 ENET( int aNetCode, const wxString& aNetName ) :
568 netname( aNetName ),
569 netcode( aNetCode )
570 {}
571
573 netcode( 0 )
574 {}
575
576 ENET( wxXmlNode* aNet, IO_BASE* aIo = nullptr );
577};
578
579
581struct EROT
582{
583 bool mirror;
584 bool spin;
585 double degrees;
586
588 mirror( false ),
589 spin( false ),
590 degrees( 0 )
591 {}
592
593 EROT( double aDegrees ) :
594 mirror( false ),
595 spin( false ),
596 degrees( aDegrees )
597 {}
598};
599
600
602struct EVERTEX : public EAGLE_BASE
603{
604 /*
605 * <!ELEMENT vertex EMPTY>
606 * <!ATTLIST vertex
607 * x %Coord; #REQUIRED
608 * y %Coord; #REQUIRED
609 * curve %WireCurve; "0"
610 * >
611 * <!-- curve: The curvature from this vertex to the next one -->
612 */
616
617 EVERTEX( wxXmlNode* aVertex, IO_BASE* aIo = nullptr );
618};
619
620
622struct EWIRE : public EAGLE_BASE
623{
624 /*
625 * <!ELEMENT wire EMPTY>
626 * <!ATTLIST wire
627 * x1 %Coord; #REQUIRED
628 * y1 %Coord; #REQUIRED
629 * x2 %Coord; #REQUIRED
630 * y2 %Coord; #REQUIRED
631 * width %Dimension; #REQUIRED
632 * layer %Layer; #REQUIRED
633 * extent %Extent; #IMPLIED
634 * style %WireStyle; "continuous"
635 * curve %WireCurve; "0"
636 * cap %WireCap; "round"
637 * grouprefs IDREFS #IMPLIED
638 * >
639 * <!-- extent: Only applicable for airwires -->
640 * <!-- cap : Only applicable if 'curve' is not zero -->
641 */
647 int layer;
648
649 // for style: (continuous | longdash | shortdash | dashdot)
654
658
659 // for cap: (flat | round)
660 enum { FLAT,
662
664
665 // TODO add grouprefs
666
667 EWIRE( wxXmlNode* aWire, IO_BASE* aIo = nullptr );
668};
669
670
672struct EJUNCTION : public EAGLE_BASE
673{
674 /*
675 * <!ELEMENT junction EMPTY>
676 * <!ATTLIST junction
677 * x %Coord; #REQUIRED
678 * y %Coord; #REQUIRED
679 * grouprefs IDREFS #IMPLIED
680 * >
681 */
682
685
686 EJUNCTION( wxXmlNode* aJunction, IO_BASE* aIo = nullptr );
687};
688
689
691struct ELABEL : public EAGLE_BASE
692{
693 /*
694 * <!ELEMENT label EMPTY>
695 * <!ATTLIST label
696 * x %Coord; #REQUIRED
697 * y %Coord; #REQUIRED
698 * size %Dimension; #REQUIRED
699 * layer %Layer; #REQUIRED
700 * font %TextFont; "proportional"
701 * ratio %Int; "8"
702 * rot %Rotation; "R0"
703 * xref %Bool; "no"
704 * align %Align; "bottom-left"
705 * grouprefs IDREFS #IMPLIED
706 * >
707 * <!-- rot: Only 0, 90, 180 or 270 -->
708 * <!-- xref: Only in <net> context -->
709 */
710
714 int layer;
720
721 // TODO Add grouprefs
722
723 ELABEL( wxXmlNode* aLabel, IO_BASE* aIo = nullptr );
724};
725
726
728struct EVIA : public EAGLE_BASE
729{
730 /*
731 * <!ELEMENT via EMPTY>
732 * <!ATTLIST via
733 * x %Coord; #REQUIRED
734 * y %Coord; #REQUIRED
735 * extent %Extent; #REQUIRED
736 * drill %Dimension; #REQUIRED
737 * diameter %Dimension; "0"
738 * shape %ViaShape; "round"
739 * alwaysstop %Bool; "no"
740 * grouprefs IDREFS #IMPLIED
741 * >
742 */
751
752 // TODO add grouprefs
753
754 EVIA( wxXmlNode* aVia, IO_BASE* aIo = nullptr );
755};
756
757
759struct ECIRCLE : public EAGLE_BASE
760{
761 /*
762 * <!ELEMENT circle EMPTY>
763 * <!ATTLIST circle
764 * x %Coord; #REQUIRED
765 * y %Coord; #REQUIRED
766 * radius %Coord; #REQUIRED
767 * width %Dimension; #REQUIRED
768 * layer %Layer; #REQUIRED
769 * grouprefs IDREFS #IMPLIED
770 * >
771 */
776 int layer;
777
778 // TODO add grouprefs
779
780 ECIRCLE( wxXmlNode* aCircle, IO_BASE* aIo = nullptr );
781};
782
783
785struct ERECT : public EAGLE_BASE
786{
787 /*
788 * <!ELEMENT rectangle EMPTY>
789 * <!ATTLIST rectangle
790 * x1 %Coord; #REQUIRED
791 * y1 %Coord; #REQUIRED
792 * x2 %Coord; #REQUIRED
793 * y2 %Coord; #REQUIRED
794 * layer %Layer; #REQUIRED
795 * rot %Rotation; "R0"
796 * grouprefs IDREFS #IMPLIED
797 * >
798 */
803 int layer;
805
806 ERECT( wxXmlNode* aRect, IO_BASE* aIo = nullptr );
807};
808
809
810struct ESPLINE : public EAGLE_BASE
811{
812 /*
813 * <!ELEMENT spline (vertex)*>
814 * <!-- Four simple (non-curve) vertices define the control points of a degree-3
815 * spline curve -->
816 * <!ATTLIST spline
817 * width %Dimension; #REQUIRED
818 * >
819 */
820 std::vector<std::unique_ptr<EVERTEX>> vertices;
821 double width;
822
823 ESPLINE( wxXmlNode* aSpline, IO_BASE* aIo = nullptr );
824};
825
826
833struct EATTR : public EAGLE_BASE
834{
835 /*
836 * <!ELEMENT attribute EMPTY>
837 * <!ATTLIST attribute
838 * name %String; #REQUIRED
839 * value %String; #IMPLIED
840 * x %Coord; #IMPLIED
841 * y %Coord; #IMPLIED
842 * size %Dimension; #IMPLIED
843 * layer %Layer; #IMPLIED
844 * font %TextFont; #IMPLIED
845 * ratio %Int; #IMPLIED
846 * rot %Rotation; "R0"
847 * display %AttributeDisplay; "value"
848 * constant %Bool; "no"
849 * align %Align; "bottom-left"
850 * grouprefs IDREFS #IMPLIED
851 * >
852 * <!-- display: Only in <element> or <instance> context -->
853 * <!-- constant:Only in <device> context -->
854 */
855 wxString name;
864
865 enum { // for 'display'
870 };
871
875
876 // TODO add groupdefs
877
878 EATTR( wxXmlNode* aTree, IO_BASE* aIo = nullptr );
879 EATTR() {}
880};
881
882
884struct EDIMENSION : public EAGLE_BASE
885{
886 /*
887 * <!ELEMENT dimension EMPTY>
888 * <!ATTLIST dimension
889 * x1 %Coord; #REQUIRED
890 * y1 %Coord; #REQUIRED
891 * x2 %Coord; #REQUIRED
892 * y2 %Coord; #REQUIRED
893 * x3 %Coord; #REQUIRED
894 * y3 %Coord; #REQUIRED
895 * layer %Layer; #REQUIRED
896 * dtype %DimensionType; "parallel"
897 * width %Dimension; "0.13"
898 * extwidth %Dimension; "0"
899 * extlength %Dimension; "0"
900 * extoffset %Dimension; "0"
901 * textsize %Dimension; #REQUIRED
902 * textratio %Int; "8"
903 * unit %GridUnit; "mm"
904 * precision %Int; "2"
905 * visible %Bool; "no"
906 * grouprefs IDREFS #IMPLIED
907 * >
908 */
916 int layer;
926
927 // TODO add grouprefs
928
929 EDIMENSION( wxXmlNode* aDimension, IO_BASE* aIo = nullptr );
930};
931
932
934struct ETEXT : public EAGLE_BASE
935{
936 /*
937 * <!ELEMENT text (#PCDATA)>
938 * <!ATTLIST text
939 * x %Coord; #REQUIRED
940 * y %Coord; #REQUIRED
941 * size %Dimension; #REQUIRED
942 * layer %Layer; #REQUIRED
943 * font %TextFont; "proportional"
944 * ratio %Int; "8"
945 * rot %Rotation; "R0"
946 * align %Align; "bottom-left"
947 * distance %Int; "50"
948 * grouprefs IDREFS #IMPLIED
949 * >
950 */
951 wxString text;
955 int layer;
959
960 enum { // for align
966
967 // opposites are -1 x above, used by code tricks in here
972 };
973
976
977 // TODO add grouprefs
978
979 ETEXT( wxXmlNode* aText, IO_BASE* aIo = nullptr );
980
982 VECTOR2I ConvertSize() const;
983};
984
985
989struct EFRAME : public EAGLE_BASE
990{
991 /*
992 * <!ELEMENT frame EMPTY>
993 * <!ATTLIST frame
994 * x1 %Coord; #REQUIRED
995 * y1 %Coord; #REQUIRED
996 * x2 %Coord; #REQUIRED
997 * y2 %Coord; #REQUIRED
998 * columns %Int; #REQUIRED
999 * rows %Int; #REQUIRED
1000 * layer %Layer; #REQUIRED
1001 * border-left %Bool; "yes"
1002 * border-top %Bool; "yes"
1003 * border-right %Bool; "yes"
1004 * border-bottom %Bool; "yes"
1005 * grouprefs IDREFS #IMPLIED
1006 * >
1007 */
1013 int rows;
1019
1020 EFRAME( wxXmlNode* aFrameNode, IO_BASE* aIo = nullptr );
1021};
1022
1023
1026{
1027 wxString name;
1032
1033 EPAD_COMMON( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1034};
1035
1036
1038struct EPAD : public EPAD_COMMON
1039{
1040 /*
1041 * <!ELEMENT pad EMPTY>
1042 * <!ATTLIST pad
1043 * name %String; #REQUIRED
1044 * x %Coord; #REQUIRED
1045 * y %Coord; #REQUIRED
1046 * drill %Dimension; #REQUIRED
1047 * diameter %Dimension; "0"
1048 * shape %PadShape; "round"
1049 * rot %Rotation; "R0"
1050 * stop %Bool; "yes"
1051 * thermals %Bool; "yes"
1052 * first %Bool; "no"
1053 * >
1054 */
1057
1058 // for shape: (square | round | octagon | long | offset)
1059 enum {
1060 UNDEF = -1,
1066 };
1067
1070
1071 EPAD( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1072};
1073
1074
1076struct ESMD : public EPAD_COMMON
1077{
1078 /*
1079 * <!ELEMENT smd EMPTY>
1080 * <!ATTLIST smd
1081 * name %String; #REQUIRED
1082 * x %Coord; #REQUIRED
1083 * y %Coord; #REQUIRED
1084 * dx %Dimension; #REQUIRED
1085 * dy %Dimension; #REQUIRED
1086 * layer %Layer; #REQUIRED
1087 * roundness %Int; "0"
1088 * rot %Rotation; "R0"
1089 * stop %Bool; "yes"
1090 * thermals %Bool; "yes"
1091 * cream %Bool; "yes"
1092 * >
1093 */
1099
1100 ESMD( wxXmlNode* aSMD, IO_BASE* aIo = nullptr );
1101};
1102
1103
1105struct EPIN : public EAGLE_BASE
1106{
1107 /*
1108 * <!ELEMENT pin EMPTY>
1109 * <!ATTLIST pin
1110 * name %String; #REQUIRED
1111 * x %Coord; #REQUIRED
1112 * y %Coord; #REQUIRED
1113 * visible %PinVisible; "both"
1114 * length %PinLength; "long"
1115 * direction %PinDirection; "io"
1116 * function %PinFunction; "none"
1117 * swaplevel %Int; "0"
1118 * rot %Rotation; "R0"
1119 * >
1120 */
1121 wxString name;
1124
1131
1132 EPIN( wxXmlNode* aPin, IO_BASE* aIo = nullptr );
1133};
1134
1135
1137struct EPOLYGON : public EAGLE_BASE
1138{
1139 /*
1140 * <!ELEMENT polygon (vertex)*>
1141 * <!-- the vertices must define a valid polygon; if the last vertex is the same
1142 * as the first one, it is ignored -->
1143 * <!ATTLIST polygon
1144 * width %Dimension; #REQUIRED
1145 * layer %Layer; #REQUIRED
1146 * spacing %Dimension; #IMPLIED
1147 * pour %PolygonPour; "solid"
1148 * isolate %Dimension; #IMPLIED
1149 * orphans %Bool; "no"
1150 * thermals %Bool; "yes"
1151 * rank %Int; "0"
1152 * grouprefs IDREFS #IMPLIED
1153 * >
1154 * <!-- isolate: Only in <signal> or <package> context -->
1155 * <!-- orphans: Only in <signal> context -->
1156 * <!-- thermals:Only in <signal> context -->
1157 * <!-- rank: 1..6 in <signal> context, 0 or 7 in <package> context -->
1158 */
1162
1163 // KiCad priority is opposite of Eagle rank, that is:
1164 // - Eagle Low rank drawn first
1165 // - KiCad high priority drawn first
1166 // So since Eagle has an upper limit we define this, used for the cases
1167 // where no rank is specified.
1168 static const int max_priority = 6;
1169
1170 enum { // for pour
1174 };
1175
1176 int pour;
1181
1182 std::vector<std::unique_ptr<EVERTEX>> vertices;
1183
1184 // TODO add grouprefs
1185
1186 EPOLYGON( wxXmlNode* aPolygon, IO_BASE* aIo = nullptr );
1187};
1188
1189
1191struct EHOLE : public EAGLE_BASE
1192{
1193 /*
1194 * <!ELEMENT hole EMPTY>
1195 * <!ATTLIST hole
1196 * x %Coord; #REQUIRED
1197 * y %Coord; #REQUIRED
1198 * drill %Dimension; #REQUIRED
1199 * grouprefs IDREFS #IMPLIED
1200 * >
1201 */
1205
1206 EHOLE( wxXmlNode* aHole, IO_BASE* aIo = nullptr );
1207};
1208
1209
1210struct EVARIANT : public EAGLE_BASE
1211{
1212 /*
1213 * <!ELEMENT variant EMPTY>
1214 * <!ATTLIST variant
1215 * name %String; #REQUIRED
1216 * populate %Bool; "yes"
1217 * value %String; #IMPLIED
1218 * technology %String; #IMPLIED
1219 * >
1220 * <!-- technology: Only in part context -->
1221 */
1222 wxString name;
1226
1227 EVARIANT( wxXmlNode* aVariant, IO_BASE* aIo = nullptr );
1228};
1229
1230
1231struct EPINMAP : public EAGLE_BASE
1232{
1233 /*
1234 * <!ELEMENT pinmap EMPTY>
1235 * <!ATTLIST pinmap
1236 * gate %String; #REQUIRED
1237 * pin %String; #REQUIRED
1238 * pinorder %String; #REQUIRED
1239 * >
1240 */
1241 wxString gate;
1242 wxString pin;
1243 wxString pinorder;
1244
1245 EPINMAP( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1246};
1247
1248
1250{
1251 /*
1252 * <!ELEMENT pinmapping (pinmap+)>
1253 * <!ATTLIST pinmapping
1254 * isusermap %Bool; "no"
1255 * iddevicewide %Bool; "yes"
1256 * spiceprefix %String; ""
1257 * >
1258 */
1259 std::vector<std::unique_ptr<EPINMAP>> pinmaps;
1263
1264 EPINMAPPING( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1265};
1266
1267
1268struct EMODEL : public EAGLE_BASE
1269{
1270 /*
1271 * <!ELEMENT model (#PCDATA)>
1272 * <!ATTLIST model
1273 * name %String; #REQUIRED
1274 * >
1275 */
1276 wxString name;
1277 wxString model;
1278
1279 EMODEL( wxXmlNode* aModel, IO_BASE* aIo = nullptr );
1280};
1281
1282
1283struct ESPICE : public EAGLE_BASE
1284{
1285 /*
1286 * <!ELEMENT spice (pinmapping, model)>
1287 */
1288 std::unique_ptr<EPINMAPPING> pinmapping;
1289 std::unique_ptr<EMODEL> model;
1290
1291 ESPICE( wxXmlNode* aSpice, IO_BASE* aIo = nullptr );
1292};
1293
1294
1296struct EELEMENT : public EAGLE_BASE
1297{
1298 /*
1299 * <!ELEMENT element (attribute*, variant*)>
1300 * <!-- variant* is accepted only for compatibility with EAGLE 6.x files -->
1301 * <!ATTLIST element
1302 * name %String; #REQUIRED
1303 * library %String; #REQUIRED
1304 * library_urn %Urn; ""
1305 * package %String; #REQUIRED
1306 * package3d_urn %Urn; ""
1307 * override_package3d_urn %Urn; ""
1308 * override_package_urn %Urn; ""
1309 * override_locally_modified %Bool; "no"
1310 * value %String; #REQUIRED
1311 * x %Coord; #REQUIRED
1312 * y %Coord; #REQUIRED
1313 * locked %Bool; "no"
1314 * populate %Bool; "yes"
1315 * smashed %Bool; "no"
1316 * rot %Rotation; "R0"
1317 * grouprefs IDREFS #IMPLIED
1318 * >
1319 * <!-- library_urn: Only in parts from online libraries -->
1320 */
1321 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1322 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1323
1324 wxString name;
1325 wxString library;
1327 wxString package;
1331 wxString value;
1337
1338 // TODO add grouprefs
1339
1340 EELEMENT( wxXmlNode* aElement, IO_BASE* aIo = nullptr );
1341};
1342
1343
1344struct ELAYER : public EAGLE_BASE
1345{
1346 /*
1347 * <!ELEMENT layer EMPTY>
1348 * <!ATTLIST layer
1349 * number %Layer; #REQUIRED
1350 * name %String; #REQUIRED
1351 * color %Int; #REQUIRED
1352 * fill %Int; #REQUIRED
1353 * visible %Bool; "yes"
1354 * active %Bool; "yes"
1355 * >
1356 */
1358 wxString name;
1360 int fill;
1363
1364 ELAYER( wxXmlNode* aLayer, IO_BASE* aIo = nullptr );
1365};
1366
1367
1436
1437
1438struct EGATE : public EAGLE_BASE
1439{
1440 /*
1441 * <!ELEMENT gate EMPTY>
1442 * <!ATTLIST gate
1443 * name %String; #REQUIRED
1444 * symbol %String; #REQUIRED
1445 * x %Coord; #REQUIRED
1446 * y %Coord; #REQUIRED
1447 * addlevel %GateAddLevel; "next"
1448 * swaplevel %Int; "0"
1449 * >
1450 */
1451
1452 wxString name;
1453 wxString symbol;
1454
1457
1460
1461 enum
1462 {
1468 };
1469
1470 EGATE( wxXmlNode* aGate, IO_BASE* aIo = nullptr );
1471};
1472
1473
1474struct EPART : public EAGLE_BASE
1475{
1476 /*
1477 * <!ELEMENT part (attribute*, variant*, spice?)>
1478 * <!ATTLIST part
1479 * name %String; #REQUIRED
1480 * library %String; #REQUIRED
1481 * library_urn %Urn; ""
1482 * deviceset %String; #REQUIRED
1483 * device %String; #REQUIRED
1484 * package3d_urn %Urn; ""
1485 * override_package3d_urn %Urn; ""
1486 * override_package_urn %Urn; ""
1487 * override_locally_modified %Bool; "no"
1488 * technology %String; ""
1489 * value %String; #IMPLIED
1490 * >
1491 * <!-- library_urn: Only in parts from online libraries -->
1492 */
1493 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1494 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1495 std::unique_ptr<ESPICE> spice;
1496
1497 wxString name;
1498 wxString library;
1500 wxString deviceset;
1501 wxString device;
1508
1509 EPART( wxXmlNode* aPart, IO_BASE* aIo = nullptr );
1510};
1511
1512
1513struct EINSTANCE : public EAGLE_BASE
1514{
1515 /*
1516 * <!ELEMENT instance (attribute)*>
1517 * <!ATTLIST instance
1518 * part %String; #REQUIRED
1519 * gate %String; #REQUIRED
1520 * x %Coord; #REQUIRED
1521 * y %Coord; #REQUIRED
1522 * smashed %Bool; "no"
1523 * rot %Rotation; "R0"
1524 * grouprefs IDREFS #IMPLIED
1525 * >
1526 * <!-- rot: Only 0, 90, 180 or 270 -->
1527 */
1528
1529 wxString part;
1530 wxString gate;
1535
1536 // TODO: add grouprefs
1537
1538 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1539
1540 EINSTANCE( wxXmlNode* aInstance, IO_BASE* aIo = nullptr );
1541};
1542
1543
1544struct ECONNECT : public EAGLE_BASE
1545{
1546 /*
1547 * <!ELEMENT connect EMPTY>
1548 * <!ATTLIST connect
1549 * gate %String; #REQUIRED
1550 * pin %String; #REQUIRED
1551 * pad %String; #REQUIRED
1552 * route %ContactRoute; "all"
1553 * >
1554 */
1555 wxString gate;
1556 wxString pin;
1557 wxString pad;
1559
1560 ECONNECT( wxXmlNode* aConnect, IO_BASE* aIo = nullptr );
1561};
1562
1563
1565{
1566 /*
1567 * <!ELEMENT technology (attribute)*>
1568 * <!ATTLIST technology
1569 * name %String; #REQUIRED
1570 * >
1571 */
1572 wxString name;
1573
1574 std::vector<std::unique_ptr<EATTR>> attributes;
1575
1576 ETECHNOLOGY( wxXmlNode* aTechnology, IO_BASE* aIo = nullptr );
1577};
1578
1579
1581{
1582 /*
1583 * <!ELEMENT package3dinstance EMPTY>
1584 * <!ATTLIST package3dinstance
1585 * package3d_urn %Urn; #REQUIRED
1586 * >
1587 */
1589
1590 EPACKAGE3DINST( wxXmlNode* aPackage3dInst, IO_BASE* aIo = nullptr );
1591};
1592
1593
1594struct EDEVICE : public EAGLE_BASE
1595{
1596 /*
1597 * <!ELEMENT device (connects?, package3dinstances?, technologies?)>
1598 * <!ATTLIST device
1599 * name %String; ""
1600 * package %String; #IMPLIED
1601 * >
1602 */
1603 wxString name;
1605
1606 std::vector<std::unique_ptr<ECONNECT>> connects;
1607 std::vector < std::unique_ptr<EPACKAGE3DINST>> package3dinstances;
1608 std::vector < std::unique_ptr<ETECHNOLOGY>> technologies;
1609
1610 EDEVICE( wxXmlNode* aDevice, IO_BASE* aIo = nullptr );
1611};
1612
1613
1615{
1616 /*
1617 * <!ELEMENT deviceset (description?, gates, devices, spice?)>
1618 * <!ATTLIST deviceset
1619 * name %String; #REQUIRED
1620 * urn %Urn; ""
1621 * locally_modified %Bool; "no"
1622 * prefix %String; ""
1623 * uservalue %Bool; "no"
1624 * library_version %Int; ""
1625 * library_locally_modified %Bool; "no"
1626 * >
1627 * <!-- library_version and library_locally_modified: Only in managed libraries
1628 * inside boards or schematics -->
1629 */
1630
1631 wxString name;
1638
1639 std::optional<EDESCRIPTION> description;
1640 std::map<wxString, std::unique_ptr<EGATE>> gates;
1641 std::vector<std::unique_ptr<EDEVICE>> devices;
1642 std::optional<ESPICE> spice;
1643
1644 EDEVICE_SET( wxXmlNode* aDeviceSet, IO_BASE* aIo = nullptr );
1645};
1646
1647
1648struct ECLASS : public EAGLE_BASE
1649{
1650 /*
1651 * <!ELEMENT class (clearance)*>
1652 * <!ATTLIST class
1653 * number %Class; #REQUIRED
1654 * name %String; #REQUIRED
1655 * width %Dimension; "0"
1656 * drill %Dimension; "0"
1657 * >
1658 */
1659
1660 wxString number;
1661 wxString name;
1664
1665 std::map<wxString, ECOORD> clearanceMap;
1666
1667 ECLASS( wxXmlNode* aClass, IO_BASE* aIo = nullptr );
1668};
1669
1670
1671struct EPORT : public EAGLE_BASE
1672{
1673 /*
1674 * <!ELEMENT port EMPTY>
1675 * <!ATTLIST port
1676 * name %String; #REQUIRED
1677 * side %String; #REQUIRED
1678 * coord %Coord; #REQUIRED
1679 * direction %PortDirection; "io"
1680 * >
1681 *
1682 * The eagle.dtd is incorrect for the EPORT side attribute. It is not an integer, it is a
1683 * string that defines the side of the module rectangle the port is located. Valid values
1684 * are "top", "bottom", "right", and "left".
1685 */
1686 wxString name;
1687 wxString side;
1690
1691 EPORT( wxXmlNode* aPort, IO_BASE* aIo = nullptr );
1692};
1693
1694
1696{
1697 /*
1698 * <!ELEMENT variantdef EMPTY>
1699 * <!ATTLIST variantdef
1700 * name %String; #REQUIRED
1701 * current %Bool; "no"
1702 * >
1703 */
1704 wxString name;
1706
1707 EVARIANTDEF( wxXmlNode* aVariantDef, IO_BASE* aIo = nullptr );
1708};
1709
1710
1712{
1713 /*
1714 * <!ELEMENT schematic_group (attribute*, description?)>
1715 * <!ATTLIST schematic_group
1716 * name ID #REQUIRED
1717 * selectable %Bool; #IMPLIED
1718 * width %Dimension; #IMPLIED
1719 * titleSize %Dimension; #IMPLIED
1720 * titleFont %TextFont; #IMPLIED
1721 * style %WireStyle; #IMPLIED
1722 * showAnnotations %Bool; #IMPLIED
1723 * layer %Layer; #IMPLIED
1724 * grouprefs IDREFS #IMPLIED
1725 * >
1726 */
1727 wxString name;
1736
1737 std::optional<EDESCRIPTION> description;
1738 std::vector<std::unique_ptr<EATTR>> attributes;
1739
1740 ESCHEMATIC_GROUP( wxXmlNode* aSchematicGroup, IO_BASE* aIo = nullptr );
1741};
1742
1743
1744struct EPLAIN : public EAGLE_BASE
1745{
1746 /*
1747 * <!ELEMENT plain (polygon | wire | text | dimension | circle | spline | rectangle |
1748 * frame | hole)*>
1749 */
1750
1751 std::vector<std::unique_ptr<EPOLYGON>> polygons;
1752 std::vector<std::unique_ptr<EWIRE>> wires;
1753 std::vector<std::unique_ptr<ETEXT>> texts;
1754 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
1755 std::vector<std::unique_ptr<ECIRCLE>> circles;
1756 std::vector<std::unique_ptr<ESPLINE>> splines;
1757 std::vector<std::unique_ptr<ERECT>> rectangles;
1758 std::vector<std::unique_ptr<EFRAME>> frames;
1759 std::vector<std::unique_ptr<EHOLE>> holes;
1760
1761 EPLAIN( wxXmlNode* aPlain, IO_BASE* aIo = nullptr );
1762};
1763
1764
1766{
1767 /*
1768 * <!ELEMENT moduleinst (attribute)*>
1769 * <!ATTLIST moduleinst
1770 * name %String; #REQUIRED
1771 * module %String; #REQUIRED
1772 * modulevariant %String; ""
1773 * x %Coord; #REQUIRED
1774 * y %Coord; #REQUIRED
1775 * offset %Int; "0"
1776 * smashed %Bool; "no"
1777 * rot %Rotation; "R0"
1778 * >
1779 * <!-- rot: Only 0, 90, 180 or 270 -->
1780 */
1781
1782 wxString name;
1783 wxString moduleinst;
1790
1791 EMODULEINST( wxXmlNode* aModuleInst, IO_BASE* aIo = nullptr );
1792};
1793
1794
1795struct EPINREF : public EAGLE_BASE
1796{
1797 /*
1798 * <!ELEMENT pinref EMPTY>
1799 * <!ATTLIST pinref
1800 * part %String; #REQUIRED
1801 * gate %String; #REQUIRED
1802 * pin %String; #REQUIRED
1803 * >
1804 */
1805 wxString part;
1806 wxString gate;
1807 wxString pin;
1808
1809 EPINREF( wxXmlNode* aPinRef, IO_BASE* aIo = nullptr );
1810};
1811
1812
1813struct EPORTREF : public EAGLE_BASE
1814{
1815 /*
1816 * <!ELEMENT portref EMPTY>
1817 * <!ATTLIST portref
1818 * moduleinst %String; #REQUIRED
1819 * port %String; #REQUIRED
1820 * >
1821 */
1822 wxString moduleinst;
1823 wxString port;
1824
1825 EPORTREF( wxXmlNode* aPortRef, IO_BASE* aIo = nullptr );
1826};
1827
1828
1829struct EPROBE : public EAGLE_BASE
1830{
1831 /*
1832 * <!ELEMENT probe EMPTY>
1833 * <!ATTLIST probe
1834 * x %Coord; #REQUIRED
1835 * y %Coord; #REQUIRED
1836 * size %Dimension; #REQUIRED
1837 * layer %Layer; #REQUIRED
1838 * font %TextFont; "proportional"
1839 * ratio %Int; "8"
1840 * rot %Rotation; "R0"
1841 * xref %Bool; "no"
1842 * grouprefs IDREFS #IMPLIED
1843 * >
1844 * <!-- rot: Only 0, 90, 180 or 270 -->
1845 * <!-- xref: Only in <net> context -->
1846 */
1849 double size;
1855
1856 // TODO add grouprefs
1857
1858 EPROBE( wxXmlNode* aProbe, IO_BASE* aIo = nullptr );
1859};
1860
1861
1862struct ESEGMENT : public EAGLE_BASE
1863{
1864 /*
1865 * <!ELEMENT segment (pinref | portref | wire | junction | label | probe)*>
1866 * <!-- 'pinref' and 'junction' are only valid in a <net> context -->
1867 */
1868 std::vector<std::unique_ptr<EPINREF>> pinRefs;
1869 std::vector<std::unique_ptr<EPORTREF>> portRefs;
1870 std::vector<std::unique_ptr<EWIRE>> wires;
1871 std::vector<std::unique_ptr<EJUNCTION>> junctions;
1872 std::vector<std::unique_ptr<ELABEL>> labels;
1873 std::vector<std::unique_ptr<EPROBE>> probes;
1874
1875 ESEGMENT( wxXmlNode* aSegment, IO_BASE* aIo = nullptr );
1876};
1877
1878
1879struct EBUS : public EAGLE_BASE
1880{
1881 /*
1882 * <!ELEMENT bus (segment)*>
1883 * <!ATTLIST bus
1884 * name %String; #REQUIRED
1885 * >
1886 */
1887
1888 wxString name;
1889 std::vector<std::unique_ptr<ESEGMENT>> segments;
1890
1891 EBUS( wxXmlNode* aBus, IO_BASE* aIo = nullptr );
1892};
1893
1894
1895struct ESHEET : public EAGLE_BASE
1896{
1897 /*
1898 * <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
1899 */
1900
1901 std::optional<EDESCRIPTION> description;
1902 std::unique_ptr<EPLAIN> plain;
1903 std::map<wxString, std::unique_ptr<EMODULEINST>> moduleinsts;
1904 std::vector<std::unique_ptr<EINSTANCE>> instances;
1905 std::vector<std::unique_ptr<EBUS>> busses;
1906 std::vector<std::unique_ptr<ENET>> nets;
1907
1908 ESHEET( wxXmlNode* aSheet, IO_BASE* aIo = nullptr );
1909};
1910
1911
1912struct EMODULE : public EAGLE_BASE
1913{
1914 /*
1915 * <!ELEMENT module (description?, ports?, variantdefs?, groups?, parts?, sheets?)>
1916 * <!ATTLIST module
1917 * name %String; #REQUIRED
1918 * prefix %String; ""
1919 * dx %Coord; #REQUIRED
1920 * dy %Coord; #REQUIRED
1921 * >
1922 */
1923 wxString name;
1927
1928 std::optional<EDESCRIPTION> description;
1929 std::map<wxString, std::unique_ptr<EPORT>> ports;
1930 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
1931 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
1932 std::map<wxString, std::unique_ptr<EPART>> parts;
1933 std::vector<std::unique_ptr<ESHEET>> sheets;
1934
1935 EMODULE( wxXmlNode* aModule, IO_BASE* aIo = nullptr );
1936};
1937
1938
1939struct ENOTE : public EAGLE_BASE
1940{
1941 /*
1942 * <!ELEMENT note (#PCDATA)>
1943 * <!ATTLIST note
1944 * version %Real; #REQUIRED
1945 * severity %Severity; #REQUIRED
1946 * >
1947 * <!-- version: The EAGLE program version that introduced this compatibility note -->
1948 */
1949 double version;
1950 wxString severity;
1951 wxString note;
1952
1953 ENOTE( wxXmlNode* aNote, IO_BASE* aIo = nullptr );
1954};
1955
1956
1958{
1959 /*
1960 * <!ELEMENT compatibility (note)*>
1961 */
1962 std::vector<std::unique_ptr<ENOTE>> notes;
1963
1964 ECOMPATIBILITY( wxXmlNode* aCompatibility, IO_BASE* aIo = nullptr );
1965};
1966
1967
1968struct ESETTING : public EAGLE_BASE
1969{
1970 /*
1971 * <!ELEMENT setting EMPTY>
1972 * <!ATTLIST setting
1973 * alwaysvectorfont %Bool; #IMPLIED
1974 * verticaltext %VerticalText; "up"
1975 * keepoldvectorfont %Bool; "no"
1976 * >
1977 */
1981
1982 ESETTING( wxXmlNode* aSetting, IO_BASE* aIo = nullptr );
1983};
1984
1985
1986struct EGRID : public EAGLE_BASE
1987{
1988 /*
1989 * <!ELEMENT grid EMPTY>
1990 * <!ATTLIST grid
1991 * distance %Real; #IMPLIED
1992 * unitdist %GridUnit; #IMPLIED
1993 * unit %GridUnit; #IMPLIED
1994 * style %GridStyle; "lines"
1995 * multiple %Int; "1"
1996 * display %Bool; "no"
1997 * altdistance %Real; #IMPLIED
1998 * altunitdist %GridUnit; #IMPLIED
1999 * altunit %GridUnit; #IMPLIED
2000 * >
2001 */
2011
2012 EGRID( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2013};
2014
2015
2016struct EFILTER : public EAGLE_BASE
2017{
2018 /*
2019 * <!ELEMENT filter EMPTY>
2020 * <!ATTLIST filter
2021 * name %String; #REQUIRED
2022 * expression %String; #REQUIRED
2023 * >
2024 */
2025 wxString name;
2026 wxString expression;
2027
2028 EFILTER( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2029};
2030
2031
2032struct EPACKAGE : public EAGLE_BASE
2033{
2034 /*
2035 * <!ELEMENT package (description?, (polygon | wire | text | dimension | circle |
2036 * rectangle | frame | hole | pad | smd)*)>
2037 * <!ATTLIST package
2038 * name %String; #REQUIRED
2039 * urn %Urn; ""
2040 * locally_modified %Bool; "no"
2041 * library_version %Int; ""
2042 * library_locally_modified %Bool; "no"
2043 * >
2044 * <!-- library_version and library_locally_modified: Only in managed libraries
2045 * inside boards or schematics -->
2046 */
2047 wxString name;
2052
2053 std::optional<EDESCRIPTION> description;
2054 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2055 std::vector<std::unique_ptr<EWIRE>> wires;
2056 std::vector<std::unique_ptr<ETEXT>> texts;
2057 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2058 std::vector<std::unique_ptr<ECIRCLE>> circles;
2059 std::vector<std::unique_ptr<ERECT>> rectangles;
2060 std::vector<std::unique_ptr<EFRAME>> frames;
2061 std::vector<std::unique_ptr<EHOLE>> holes;
2062 std::vector<std::unique_ptr<EPAD>> thtpads;
2063 std::vector<std::unique_ptr<ESMD>> smdpads;
2064
2065 EPACKAGE( wxXmlNode* aPackage, IO_BASE* aIo = nullptr );
2066};
2067
2068
2070{
2071 /*
2072 * <!ELEMENT packageinstance EMPTY>
2073 * <!ATTLIST packageinstance
2074 * name %String; #REQUIRED
2075 * >
2076 */
2077 wxString name;
2078
2079 EPACKAGEINSTANCE( wxXmlNode* aPackageInstance, IO_BASE* aIo = nullptr );
2080};
2081
2082
2083struct EPACKAGE3D : public EAGLE_BASE
2084{
2085 /*
2086 * <!ELEMENT package3d (description?, packageinstances?)>
2087 * <!ATTLIST package3d
2088 * name %String; ""
2089 * urn %Urn; #REQUIRED
2090 * type %Package3dType; #REQUIRED
2091 * library_version %Int; ""
2092 * library_locally_modified %Bool; "no"
2093 * >
2094 * <!-- library_version and library_locally_modified: Only in managed libraries
2095 * inside boards or schematics -->
2096 */
2097 wxString name;
2099 wxString type;
2102
2103 std::optional<EDESCRIPTION> description;
2104 std::vector<std::unique_ptr<EPACKAGEINSTANCE>> packageinstances;
2105
2106 EPACKAGE3D( wxXmlNode* aPackage3d, IO_BASE* aIo = nullptr );
2107};
2108
2109
2110struct ESYMBOL : public EAGLE_BASE
2111{
2112 /*
2113 * <!ELEMENT symbol (description?, (polygon | wire | text | dimension | pin | circle |
2114 * rectangle | frame)*)>
2115 * <!ATTLIST symbol
2116 * name %String; #REQUIRED
2117 * urn %Urn; ""
2118 * locally_modified %Bool; "no"
2119 * library_version %Int; ""
2120 * library_locally_modified %Bool; "no"
2121 * >
2122 * <!-- library_version and library_locally_modified: Only in managed libraries
2123 * inside boards or schematics -->
2124 */
2125
2126 wxString name;
2131
2132 std::optional<EDESCRIPTION> description;
2133 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2134 std::vector<std::unique_ptr<EWIRE>> wires;
2135 std::vector<std::unique_ptr<ETEXT>> texts;
2136 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2137 std::vector<std::unique_ptr<EPIN>> pins;
2138 std::vector<std::unique_ptr<ECIRCLE>> circles;
2139 std::vector<std::unique_ptr<ERECT>> rectangles;
2140 std::vector<std::unique_ptr<EFRAME>> frames;
2141
2142 ESYMBOL( wxXmlNode* aSymbol, IO_BASE* aIo = nullptr );
2143};
2144
2145
2146struct ELIBRARY : public EAGLE_BASE
2147{
2148 /*
2149 * <!ELEMENT library (description?, packages?, packages3d?, symbols?, devicesets?)>
2150 * <!ATTLIST library
2151 * name %String; #REQUIRED
2152 * urn %Urn; ""
2153 * >
2154 * <!-- name: Only in libraries used inside boards or schematics -->
2155 * <!-- urn: Only in online libraries used inside boards or schematics -->
2156 */
2157 wxString name;
2159
2160 std::optional<EDESCRIPTION> description;
2161 std::map<wxString, std::unique_ptr<EPACKAGE>> packages;
2162 std::map<wxString, std::unique_ptr<EPACKAGE3D>> packages3d;
2163 std::map<wxString, std::unique_ptr<ESYMBOL>> symbols;
2164 std::map<wxString, std::unique_ptr<EDEVICE_SET>> devicesets;
2165
2171 wxString GetName() const;
2172 ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo = nullptr );
2173};
2174
2175
2176struct EAPPROVED : public EAGLE_BASE
2177{
2178 /*
2179 * <!ELEMENT approved EMPTY>
2180 * <!ATTLIST approved
2181 * hash %String; #REQUIRED
2182 * >
2183 */
2184 wxString hash;
2185
2186 EAPPROVED( wxXmlNode* aApproved, IO_BASE* aIo = nullptr );
2187};
2188
2189
2190struct ESCHEMATIC : public EAGLE_BASE
2191{
2192 /*
2193 * <!ELEMENT schematic (description?, libraries?, attributes?, variantdefs?, classes?,
2194 * modules?, groups?, parts?, sheets?, errors?)>
2195 * <!ATTLIST schematic
2196 * xreflabel %String; #IMPLIED
2197 * xrefpart %String; #IMPLIED
2198 * >
2199 */
2202
2203 std::optional<EDESCRIPTION> description;
2204 std::map<wxString, std::unique_ptr<ELIBRARY>> libraries;
2205 std::map<wxString, std::unique_ptr<EATTR>> attributes;
2206 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
2207 std::map<wxString, std::unique_ptr<ECLASS>> classes;
2208 std::map<wxString, std::unique_ptr<EMODULE>> modules;
2209 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
2210 std::map<wxString, std::unique_ptr<EPART>> parts;
2211 std::vector<std::unique_ptr<ESHEET>> sheets;
2212 std::vector<std::unique_ptr<EAPPROVED>> errors;
2213
2214 ESCHEMATIC( wxXmlNode* aSchematic, IO_BASE* aIo = nullptr );
2215};
2216
2217
2218struct EDRAWING : public EAGLE_BASE
2219{
2220 /*
2221 * <!ELEMENT drawing (settings?, grid?, filters?, layers, (library | schematic | board))>
2222 */
2223 std::vector<std::unique_ptr<ESETTING>> settings;
2224 std::optional<EGRID> grid;
2225 std::vector<std::unique_ptr<EFILTER>> filters;
2226 std::vector<std::unique_ptr<ELAYER>> layers;
2227 std::optional<ESCHEMATIC> schematic;
2228 std::optional<ELIBRARY> library;
2229 // std::optional<std::unique_ptr<EBOARD>> board;
2230
2231 EDRAWING( wxXmlNode* aDrawing, IO_BASE* aIo = nullptr );
2232};
2233
2234
2235struct EAGLE_DOC : public EAGLE_BASE
2236{
2237 /*
2238 * <!ELEMENT eagle (compatibility?, drawing, compatibility?)>
2239 * <!ATTLIST eagle
2240 * version %Real; #REQUIRED
2241 * >
2242 * <!-- version: The EAGLE program version that generated this file, in the
2243 * form V.RR -->
2244 */
2245
2253 wxString version;
2254
2255 std::unique_ptr<EDRAWING> drawing;
2256 std::optional<ECOMPATIBILITY> compatibility;
2257
2258 EAGLE_DOC( wxXmlNode* aEagleDoc, IO_BASE* aIo = nullptr );
2259};
2260
2261
2262#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