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, see <https://www.gnu.org/licenses/>.
22 */
23
24
25#ifndef _EAGLE_PARSER_H_
26#define _EAGLE_PARSER_H_
27
28#include <map>
29#include <memory>
30#include <optional>
31#include <unordered_map>
32
33#include <wx/xml/xml.h>
34#include <wx/string.h>
35#include <wx/filename.h>
36
37#include <layer_ids.h>
38#include <trigo.h>
39#include <core/wx_stl_compat.h>
41
42class FOOTPRINT;
43class IO_BASE;
44
45struct EINSTANCE;
46struct EPART;
47struct ETEXT;
48struct ESEGMENT;
49
50typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
51typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
52typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
53
55wxString escapeName( const wxString& aNetName );
56
58wxString interpretText( const wxString& aText );
59
61bool substituteVariable( wxString* aText );
62
64wxString convertDescription( wxString aDescr );
65
66static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
67{
68 auto it = aMap.find( aName );
69 return it == aMap.end() ? nullptr : it->second->GetChildren();
70}
71
72
77struct XML_PARSER_ERROR : std::runtime_error
78{
85 XML_PARSER_ERROR( const wxString& aMessage ) noexcept :
86 std::runtime_error( "XML parser failed - " + aMessage.ToStdString() )
87 {}
88};
89
90
92struct TRIPLET
93{
94 const char* element;
95 const char* attribute;
96 const char* value;
97
98 TRIPLET( const char* aElement, const char* aAttribute = "", const char* aValue = "" ) :
99 element( aElement ),
100 attribute( aAttribute ),
101 value( aValue )
102 {}
103};
104
105
119class XPATH
120{
121 std::vector<TRIPLET> p;
122
123public:
124 void push( const char* aPathSegment, const char* aAttribute="" )
125 {
126 p.emplace_back( aPathSegment, aAttribute );
127 }
128
129 void clear() { p.clear(); }
130
131 void pop() { p.pop_back(); }
132
134 void Value( const char* aValue )
135 {
136 p.back().value = aValue;
137 }
138
140 void Attribute( const char* aAttribute )
141 {
142 p.back().attribute = aAttribute;
143 }
144
146 wxString Contents()
147 {
148 typedef std::vector<TRIPLET>::const_iterator CITER_TRIPLET;
149
150 wxString ret;
151
152 for( CITER_TRIPLET it = p.begin(); it != p.end(); ++it )
153 {
154 if( it != p.begin() )
155 ret += '.';
156
157 ret += it->element;
158
159 if( it->attribute[0] && it->value[0] )
160 {
161 ret += '[';
162 ret += it->attribute;
163 ret += '=';
164 ret += it->value;
165 ret += ']';
166 }
167 }
168
169 return ret;
170 }
171};
172
173
181template<typename T>
182T Convert( const wxString& aValue )
183{
184 throw XML_PARSER_ERROR( "Conversion failed. Unknown type." );
185}
186
187template <>
188wxString Convert<wxString>( const wxString& aValue );
189
196template <typename T>
198{
199private:
202
205
206public:
211 m_isAvailable( false ),
212 m_data( T() )
213 {}
214
220 OPTIONAL_XML_ATTRIBUTE( const wxString& aData )
221 {
222 m_data = T();
223 m_isAvailable = !aData.IsEmpty();
224
225 if( m_isAvailable )
226 Set( aData );
227 }
228
233 template<typename V = T>
235 m_isAvailable( true ),
236 m_data( aData )
237 {}
238
242 operator bool() const
243 {
244 return m_isAvailable;
245 }
246
253 OPTIONAL_XML_ATTRIBUTE<T>& operator =( const wxString& aData )
254 {
255 m_isAvailable = !aData.IsEmpty();
256
257 if( m_isAvailable )
258 Set( aData );
259
260 return *this;
261 }
262
270 {
271 m_data = aData;
272 m_isAvailable = true;
273
274 return *this;
275 }
276
280 bool operator ==( const T& aOther ) const
281 {
282 return m_isAvailable && ( aOther == m_data );
283 }
284
290 void Set( const wxString& aString )
291 {
292 m_data = Convert<T>( aString );
293 m_isAvailable = !aString.IsEmpty();
294 }
295
302 {
303 assert( m_isAvailable );
304 return m_data;
305 }
306
312 const T& CGet() const
313 {
314 assert( m_isAvailable );
315 return m_data;
316 }
317
324 {
325 return Get();
326 }
327
333 const T& operator*() const
334 {
335 return CGet();
336 }
337
344 {
345 return &Get();
346 }
347
353 const T* operator->() const
354 {
355 return &CGet();
356 }
357};
358
359
367size_t GetNodeCount( const wxXmlNode* aNode );
368
369
377NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
378
380VECTOR2I ConvertArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle );
381
382// Pre-declare for typedefs
383struct EROT;
384struct ECOORD;
385struct EURN;
386
394
396VECTOR2I ConvertEagleTextSize( const opt_wxString& font, const ECOORD& size );
397
399{
400 EAGLE_BASE( IO_BASE* aIo = nullptr ) :
401 io( aIo ) {}
402
404
410 void Report( const wxString& aMsg, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED );
411
413};
414
415
433struct EURN : public EAGLE_BASE
434{
435 EURN() {}
436
438 EURN( const wxString& aUrn );
439
440 void Parse( const wxString& aUrn );
441
448 bool IsValid() const;
449
450 wxString host;
451 wxString path;
452 wxString assetType;
453 wxString assetId;
454 wxString assetVersion;
455};
456
457
458// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
459// For maintenance and troubleshooting purposes, it was thought that we'd need to
460// separate the conversion process into distinct steps. There is no intent to have KiCad
461// forms of information in these 'E'STRUCTS. They are only binary forms
462// of the Eagle information in the corresponding Eagle XML nodes.
463
464
466{
467 /*
468 * <!ELEMENT description (#PCDATA)>
469 * <!ATTLIST description
470 * language %String; "en"
471 * >
472 */
473
474 wxString text;
476
477 EDESCRIPTION( wxXmlNode* aDescription, IO_BASE* aIo = nullptr );
478};
479
480
481// Eagle coordinates
482struct ECOORD : public EAGLE_BASE
483{
491
493 long long int value;
494
496 static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
497
499 : value( 0 )
500 {
501 }
502
503 ECOORD( int aValue, enum EAGLE_UNIT aUnit )
504 : value( ConvertToNm( aValue, aUnit ) )
505 {
506 }
507
508 ECOORD( const wxString& aValue, enum EAGLE_UNIT aUnit );
509
510 int ToMils() const
511 {
512 return value / 25400;
513 }
514
515 int To100NanoMeters() const
516 {
517 return value / 100;
518 }
519
520 int ToNanoMeters() const
521 {
522 return value;
523 }
524
525 float ToMm() const
526 {
527 return value / 1000000.0;
528 }
529
530 int ToSchUnits() const { return To100NanoMeters(); }
531 int ToPcbUnits() const { return ToNanoMeters(); }
532
533 ECOORD operator+( const ECOORD& aOther ) const
534 {
535 return ECOORD( value + aOther.value, ECOORD_UNIT );
536 }
537
538 ECOORD operator-( const ECOORD& aOther ) const
539 {
540 return ECOORD( value - aOther.value, ECOORD_UNIT );
541 }
542
543 bool operator==( const ECOORD& aOther ) const
544 {
545 return value == aOther.value;
546 }
547
549 static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
550};
551
552
554struct ENET : public EAGLE_BASE
555{
556 /*
557 * <!ELEMENT net (segment)*>
558 * <!ATTLIST net
559 * name %String; #REQUIRED
560 * class %Class; "0"
561 * >
562 */
563 wxString netname;
565
566 std::vector<std::unique_ptr<ESEGMENT>> segments;
567
568 ENET( int aNetCode, const wxString& aNetName ) :
569 netname( aNetName ),
570 netcode( aNetCode )
571 {}
572
574 netcode( 0 )
575 {}
576
577 ENET( wxXmlNode* aNet, IO_BASE* aIo = nullptr );
578};
579
580
582struct EROT
583{
584 bool mirror;
585 bool spin;
586 double degrees;
587
589 mirror( false ),
590 spin( false ),
591 degrees( 0 )
592 {}
593
594 EROT( double aDegrees ) :
595 mirror( false ),
596 spin( false ),
597 degrees( aDegrees )
598 {}
599};
600
601
603struct EVERTEX : public EAGLE_BASE
604{
605 /*
606 * <!ELEMENT vertex EMPTY>
607 * <!ATTLIST vertex
608 * x %Coord; #REQUIRED
609 * y %Coord; #REQUIRED
610 * curve %WireCurve; "0"
611 * >
612 * <!-- curve: The curvature from this vertex to the next one -->
613 */
617
618 EVERTEX( wxXmlNode* aVertex, IO_BASE* aIo = nullptr );
619};
620
621
623struct EWIRE : public EAGLE_BASE
624{
625 /*
626 * <!ELEMENT wire EMPTY>
627 * <!ATTLIST wire
628 * x1 %Coord; #REQUIRED
629 * y1 %Coord; #REQUIRED
630 * x2 %Coord; #REQUIRED
631 * y2 %Coord; #REQUIRED
632 * width %Dimension; #REQUIRED
633 * layer %Layer; #REQUIRED
634 * extent %Extent; #IMPLIED
635 * style %WireStyle; "continuous"
636 * curve %WireCurve; "0"
637 * cap %WireCap; "round"
638 * grouprefs IDREFS #IMPLIED
639 * >
640 * <!-- extent: Only applicable for airwires -->
641 * <!-- cap : Only applicable if 'curve' is not zero -->
642 */
648 int layer;
649
650 // for style: (continuous | longdash | shortdash | dashdot)
655
659
660 // for cap: (flat | round)
661 enum { FLAT,
663
665
666 // TODO add grouprefs
667
668 EWIRE( wxXmlNode* aWire, IO_BASE* aIo = nullptr );
669};
670
671
673struct EJUNCTION : public EAGLE_BASE
674{
675 /*
676 * <!ELEMENT junction EMPTY>
677 * <!ATTLIST junction
678 * x %Coord; #REQUIRED
679 * y %Coord; #REQUIRED
680 * grouprefs IDREFS #IMPLIED
681 * >
682 */
683
686
687 EJUNCTION( wxXmlNode* aJunction, IO_BASE* aIo = nullptr );
688};
689
690
692struct ELABEL : public EAGLE_BASE
693{
694 /*
695 * <!ELEMENT label EMPTY>
696 * <!ATTLIST label
697 * x %Coord; #REQUIRED
698 * y %Coord; #REQUIRED
699 * size %Dimension; #REQUIRED
700 * layer %Layer; #REQUIRED
701 * font %TextFont; "proportional"
702 * ratio %Int; "8"
703 * rot %Rotation; "R0"
704 * xref %Bool; "no"
705 * align %Align; "bottom-left"
706 * grouprefs IDREFS #IMPLIED
707 * >
708 * <!-- rot: Only 0, 90, 180 or 270 -->
709 * <!-- xref: Only in <net> context -->
710 */
711
715 int layer;
721
722 // TODO Add grouprefs
723
724 ELABEL( wxXmlNode* aLabel, IO_BASE* aIo = nullptr );
725};
726
727
729struct EVIA : public EAGLE_BASE
730{
731 /*
732 * <!ELEMENT via EMPTY>
733 * <!ATTLIST via
734 * x %Coord; #REQUIRED
735 * y %Coord; #REQUIRED
736 * extent %Extent; #REQUIRED
737 * drill %Dimension; #REQUIRED
738 * diameter %Dimension; "0"
739 * shape %ViaShape; "round"
740 * alwaysstop %Bool; "no"
741 * grouprefs IDREFS #IMPLIED
742 * >
743 */
752
753 // TODO add grouprefs
754
755 EVIA( wxXmlNode* aVia, IO_BASE* aIo = nullptr );
756};
757
758
760struct ECIRCLE : public EAGLE_BASE
761{
762 /*
763 * <!ELEMENT circle EMPTY>
764 * <!ATTLIST circle
765 * x %Coord; #REQUIRED
766 * y %Coord; #REQUIRED
767 * radius %Coord; #REQUIRED
768 * width %Dimension; #REQUIRED
769 * layer %Layer; #REQUIRED
770 * grouprefs IDREFS #IMPLIED
771 * >
772 */
777 int layer;
778
779 // TODO add grouprefs
780
781 ECIRCLE( wxXmlNode* aCircle, IO_BASE* aIo = nullptr );
782};
783
784
786struct ERECT : public EAGLE_BASE
787{
788 /*
789 * <!ELEMENT rectangle EMPTY>
790 * <!ATTLIST rectangle
791 * x1 %Coord; #REQUIRED
792 * y1 %Coord; #REQUIRED
793 * x2 %Coord; #REQUIRED
794 * y2 %Coord; #REQUIRED
795 * layer %Layer; #REQUIRED
796 * rot %Rotation; "R0"
797 * grouprefs IDREFS #IMPLIED
798 * >
799 */
804 int layer;
806
807 ERECT( wxXmlNode* aRect, IO_BASE* aIo = nullptr );
808};
809
810
811struct ESPLINE : public EAGLE_BASE
812{
813 /*
814 * <!ELEMENT spline (vertex)*>
815 * <!-- Four simple (non-curve) vertices define the control points of a degree-3
816 * spline curve -->
817 * <!ATTLIST spline
818 * width %Dimension; #REQUIRED
819 * >
820 */
821 std::vector<std::unique_ptr<EVERTEX>> vertices;
822 double width;
823
824 ESPLINE( wxXmlNode* aSpline, IO_BASE* aIo = nullptr );
825};
826
827
834struct EATTR : public EAGLE_BASE
835{
836 /*
837 * <!ELEMENT attribute EMPTY>
838 * <!ATTLIST attribute
839 * name %String; #REQUIRED
840 * value %String; #IMPLIED
841 * x %Coord; #IMPLIED
842 * y %Coord; #IMPLIED
843 * size %Dimension; #IMPLIED
844 * layer %Layer; #IMPLIED
845 * font %TextFont; #IMPLIED
846 * ratio %Int; #IMPLIED
847 * rot %Rotation; "R0"
848 * display %AttributeDisplay; "value"
849 * constant %Bool; "no"
850 * align %Align; "bottom-left"
851 * grouprefs IDREFS #IMPLIED
852 * >
853 * <!-- display: Only in <element> or <instance> context -->
854 * <!-- constant:Only in <device> context -->
855 */
856 wxString name;
865
866 enum { // for 'display'
871 };
872
876
877 // TODO add groupdefs
878
879 EATTR( wxXmlNode* aTree, IO_BASE* aIo = nullptr );
880 EATTR() {}
881};
882
883
885struct EDIMENSION : public EAGLE_BASE
886{
887 /*
888 * <!ELEMENT dimension EMPTY>
889 * <!ATTLIST dimension
890 * x1 %Coord; #REQUIRED
891 * y1 %Coord; #REQUIRED
892 * x2 %Coord; #REQUIRED
893 * y2 %Coord; #REQUIRED
894 * x3 %Coord; #REQUIRED
895 * y3 %Coord; #REQUIRED
896 * layer %Layer; #REQUIRED
897 * dtype %DimensionType; "parallel"
898 * width %Dimension; "0.13"
899 * extwidth %Dimension; "0"
900 * extlength %Dimension; "0"
901 * extoffset %Dimension; "0"
902 * textsize %Dimension; #REQUIRED
903 * textratio %Int; "8"
904 * unit %GridUnit; "mm"
905 * precision %Int; "2"
906 * visible %Bool; "no"
907 * grouprefs IDREFS #IMPLIED
908 * >
909 */
917 int layer;
927
928 // TODO add grouprefs
929
930 EDIMENSION( wxXmlNode* aDimension, IO_BASE* aIo = nullptr );
931};
932
933
935struct ETEXT : public EAGLE_BASE
936{
937 /*
938 * <!ELEMENT text (#PCDATA)>
939 * <!ATTLIST text
940 * x %Coord; #REQUIRED
941 * y %Coord; #REQUIRED
942 * size %Dimension; #REQUIRED
943 * layer %Layer; #REQUIRED
944 * font %TextFont; "proportional"
945 * ratio %Int; "8"
946 * rot %Rotation; "R0"
947 * align %Align; "bottom-left"
948 * distance %Int; "50"
949 * grouprefs IDREFS #IMPLIED
950 * >
951 */
952 wxString text;
956 int layer;
960
961 enum { // for align
967
968 // opposites are -1 x above, used by code tricks in here
973 };
974
977
978 // TODO add grouprefs
979
980 ETEXT( wxXmlNode* aText, IO_BASE* aIo = nullptr );
981
983 VECTOR2I ConvertSize() const;
984};
985
986
990struct EFRAME : public EAGLE_BASE
991{
992 /*
993 * <!ELEMENT frame EMPTY>
994 * <!ATTLIST frame
995 * x1 %Coord; #REQUIRED
996 * y1 %Coord; #REQUIRED
997 * x2 %Coord; #REQUIRED
998 * y2 %Coord; #REQUIRED
999 * columns %Int; #REQUIRED
1000 * rows %Int; #REQUIRED
1001 * layer %Layer; #REQUIRED
1002 * border-left %Bool; "yes"
1003 * border-top %Bool; "yes"
1004 * border-right %Bool; "yes"
1005 * border-bottom %Bool; "yes"
1006 * grouprefs IDREFS #IMPLIED
1007 * >
1008 */
1014 int rows;
1020
1021 EFRAME( wxXmlNode* aFrameNode, IO_BASE* aIo = nullptr );
1022};
1023
1024
1027{
1028 wxString name;
1033
1034 EPAD_COMMON( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1035};
1036
1037
1039struct EPAD : public EPAD_COMMON
1040{
1041 /*
1042 * <!ELEMENT pad EMPTY>
1043 * <!ATTLIST pad
1044 * name %String; #REQUIRED
1045 * x %Coord; #REQUIRED
1046 * y %Coord; #REQUIRED
1047 * drill %Dimension; #REQUIRED
1048 * diameter %Dimension; "0"
1049 * shape %PadShape; "round"
1050 * rot %Rotation; "R0"
1051 * stop %Bool; "yes"
1052 * thermals %Bool; "yes"
1053 * first %Bool; "no"
1054 * >
1055 */
1058
1059 // for shape: (square | round | octagon | long | offset)
1060 enum {
1061 UNDEF = -1,
1067 };
1068
1071
1072 EPAD( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1073};
1074
1075
1077struct ESMD : public EPAD_COMMON
1078{
1079 /*
1080 * <!ELEMENT smd EMPTY>
1081 * <!ATTLIST smd
1082 * name %String; #REQUIRED
1083 * x %Coord; #REQUIRED
1084 * y %Coord; #REQUIRED
1085 * dx %Dimension; #REQUIRED
1086 * dy %Dimension; #REQUIRED
1087 * layer %Layer; #REQUIRED
1088 * roundness %Int; "0"
1089 * rot %Rotation; "R0"
1090 * stop %Bool; "yes"
1091 * thermals %Bool; "yes"
1092 * cream %Bool; "yes"
1093 * >
1094 */
1100
1101 ESMD( wxXmlNode* aSMD, IO_BASE* aIo = nullptr );
1102};
1103
1104
1106struct EPIN : public EAGLE_BASE
1107{
1108 /*
1109 * <!ELEMENT pin EMPTY>
1110 * <!ATTLIST pin
1111 * name %String; #REQUIRED
1112 * x %Coord; #REQUIRED
1113 * y %Coord; #REQUIRED
1114 * visible %PinVisible; "both"
1115 * length %PinLength; "long"
1116 * direction %PinDirection; "io"
1117 * function %PinFunction; "none"
1118 * swaplevel %Int; "0"
1119 * rot %Rotation; "R0"
1120 * >
1121 */
1122 wxString name;
1125
1132
1133 EPIN( wxXmlNode* aPin, IO_BASE* aIo = nullptr );
1134};
1135
1136
1138struct EPOLYGON : public EAGLE_BASE
1139{
1140 /*
1141 * <!ELEMENT polygon (vertex)*>
1142 * <!-- the vertices must define a valid polygon; if the last vertex is the same
1143 * as the first one, it is ignored -->
1144 * <!ATTLIST polygon
1145 * width %Dimension; #REQUIRED
1146 * layer %Layer; #REQUIRED
1147 * spacing %Dimension; #IMPLIED
1148 * pour %PolygonPour; "solid"
1149 * isolate %Dimension; #IMPLIED
1150 * orphans %Bool; "no"
1151 * thermals %Bool; "yes"
1152 * rank %Int; "0"
1153 * grouprefs IDREFS #IMPLIED
1154 * >
1155 * <!-- isolate: Only in <signal> or <package> context -->
1156 * <!-- orphans: Only in <signal> context -->
1157 * <!-- thermals:Only in <signal> context -->
1158 * <!-- rank: 1..6 in <signal> context, 0 or 7 in <package> context -->
1159 */
1163
1164 // KiCad priority is opposite of Eagle rank, that is:
1165 // - Eagle Low rank drawn first
1166 // - KiCad high priority drawn first
1167 // So since Eagle has an upper limit we define this, used for the cases
1168 // where no rank is specified.
1169 static const int max_priority = 6;
1170
1171 enum { // for pour
1175 };
1176
1177 int pour;
1182
1183 std::vector<std::unique_ptr<EVERTEX>> vertices;
1184
1185 // TODO add grouprefs
1186
1189 bool IsValidOutline() const { return vertices.size() >= 3; }
1190
1191 EPOLYGON( wxXmlNode* aPolygon, IO_BASE* aIo = nullptr );
1192};
1193
1194
1196struct EHOLE : public EAGLE_BASE
1197{
1198 /*
1199 * <!ELEMENT hole EMPTY>
1200 * <!ATTLIST hole
1201 * x %Coord; #REQUIRED
1202 * y %Coord; #REQUIRED
1203 * drill %Dimension; #REQUIRED
1204 * grouprefs IDREFS #IMPLIED
1205 * >
1206 */
1210
1211 EHOLE( wxXmlNode* aHole, IO_BASE* aIo = nullptr );
1212};
1213
1214
1215struct EVARIANT : public EAGLE_BASE
1216{
1217 /*
1218 * <!ELEMENT variant EMPTY>
1219 * <!ATTLIST variant
1220 * name %String; #REQUIRED
1221 * populate %Bool; "yes"
1222 * value %String; #IMPLIED
1223 * technology %String; #IMPLIED
1224 * >
1225 * <!-- technology: Only in part context -->
1226 */
1227 wxString name;
1231
1232 EVARIANT( wxXmlNode* aVariant, IO_BASE* aIo = nullptr );
1233};
1234
1235
1236struct EPINMAP : public EAGLE_BASE
1237{
1238 /*
1239 * <!ELEMENT pinmap EMPTY>
1240 * <!ATTLIST pinmap
1241 * gate %String; #REQUIRED
1242 * pin %String; #REQUIRED
1243 * pinorder %String; #REQUIRED
1244 * >
1245 */
1246 wxString gate;
1247 wxString pin;
1248 wxString pinorder;
1249
1250 EPINMAP( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1251};
1252
1253
1255{
1256 /*
1257 * <!ELEMENT pinmapping (pinmap+)>
1258 * <!ATTLIST pinmapping
1259 * isusermap %Bool; "no"
1260 * iddevicewide %Bool; "yes"
1261 * spiceprefix %String; ""
1262 * >
1263 */
1264 std::vector<std::unique_ptr<EPINMAP>> pinmaps;
1268
1269 EPINMAPPING( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1270};
1271
1272
1273struct EMODEL : public EAGLE_BASE
1274{
1275 /*
1276 * <!ELEMENT model (#PCDATA)>
1277 * <!ATTLIST model
1278 * name %String; #REQUIRED
1279 * >
1280 */
1281 wxString name;
1282 wxString model;
1283
1284 EMODEL( wxXmlNode* aModel, IO_BASE* aIo = nullptr );
1285};
1286
1287
1288struct ESPICE : public EAGLE_BASE
1289{
1290 /*
1291 * <!ELEMENT spice (pinmapping, model)>
1292 */
1293 std::unique_ptr<EPINMAPPING> pinmapping;
1294 std::unique_ptr<EMODEL> model;
1295
1296 ESPICE( wxXmlNode* aSpice, IO_BASE* aIo = nullptr );
1297};
1298
1299
1301struct EELEMENT : public EAGLE_BASE
1302{
1303 /*
1304 * <!ELEMENT element (attribute*, variant*)>
1305 * <!-- variant* is accepted only for compatibility with EAGLE 6.x files -->
1306 * <!ATTLIST element
1307 * name %String; #REQUIRED
1308 * library %String; #REQUIRED
1309 * library_urn %Urn; ""
1310 * package %String; #REQUIRED
1311 * package3d_urn %Urn; ""
1312 * override_package3d_urn %Urn; ""
1313 * override_package_urn %Urn; ""
1314 * override_locally_modified %Bool; "no"
1315 * value %String; #REQUIRED
1316 * x %Coord; #REQUIRED
1317 * y %Coord; #REQUIRED
1318 * locked %Bool; "no"
1319 * populate %Bool; "yes"
1320 * smashed %Bool; "no"
1321 * rot %Rotation; "R0"
1322 * grouprefs IDREFS #IMPLIED
1323 * >
1324 * <!-- library_urn: Only in parts from online libraries -->
1325 */
1326 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1327 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1328
1329 wxString name;
1330 wxString library;
1332 wxString package;
1336 wxString value;
1342
1343 // TODO add grouprefs
1344
1345 EELEMENT( wxXmlNode* aElement, IO_BASE* aIo = nullptr );
1346};
1347
1348
1349struct ELAYER : public EAGLE_BASE
1350{
1351 /*
1352 * <!ELEMENT layer EMPTY>
1353 * <!ATTLIST layer
1354 * number %Layer; #REQUIRED
1355 * name %String; #REQUIRED
1356 * color %Int; #REQUIRED
1357 * fill %Int; #REQUIRED
1358 * visible %Bool; "yes"
1359 * active %Bool; "yes"
1360 * >
1361 */
1363 wxString name;
1365 int fill;
1368
1369 ELAYER( wxXmlNode* aLayer, IO_BASE* aIo = nullptr );
1370};
1371
1372
1452
1453
1454struct EGATE : public EAGLE_BASE
1455{
1456 /*
1457 * <!ELEMENT gate EMPTY>
1458 * <!ATTLIST gate
1459 * name %String; #REQUIRED
1460 * symbol %String; #REQUIRED
1461 * x %Coord; #REQUIRED
1462 * y %Coord; #REQUIRED
1463 * addlevel %GateAddLevel; "next"
1464 * swaplevel %Int; "0"
1465 * >
1466 */
1467
1468 wxString name;
1469 wxString symbol;
1470
1473
1476
1477 enum
1478 {
1484 };
1485
1486 EGATE( wxXmlNode* aGate, IO_BASE* aIo = nullptr );
1487};
1488
1489
1490struct EPART : public EAGLE_BASE
1491{
1492 /*
1493 * <!ELEMENT part (attribute*, variant*, spice?)>
1494 * <!ATTLIST part
1495 * name %String; #REQUIRED
1496 * library %String; #REQUIRED
1497 * library_urn %Urn; ""
1498 * deviceset %String; #REQUIRED
1499 * device %String; #REQUIRED
1500 * package3d_urn %Urn; ""
1501 * override_package3d_urn %Urn; ""
1502 * override_package_urn %Urn; ""
1503 * override_locally_modified %Bool; "no"
1504 * technology %String; ""
1505 * value %String; #IMPLIED
1506 * >
1507 * <!-- library_urn: Only in parts from online libraries -->
1508 */
1509 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1510 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1511 std::unique_ptr<ESPICE> spice;
1512
1513 wxString name;
1514 wxString library;
1516 wxString deviceset;
1517 wxString device;
1524
1525 EPART( wxXmlNode* aPart, IO_BASE* aIo = nullptr );
1526};
1527
1528
1529struct EINSTANCE : public EAGLE_BASE
1530{
1531 /*
1532 * <!ELEMENT instance (attribute)*>
1533 * <!ATTLIST instance
1534 * part %String; #REQUIRED
1535 * gate %String; #REQUIRED
1536 * x %Coord; #REQUIRED
1537 * y %Coord; #REQUIRED
1538 * smashed %Bool; "no"
1539 * rot %Rotation; "R0"
1540 * grouprefs IDREFS #IMPLIED
1541 * >
1542 * <!-- rot: Only 0, 90, 180 or 270 -->
1543 */
1544
1545 wxString part;
1546 wxString gate;
1551
1552 // TODO: add grouprefs
1553
1554 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1555
1556 EINSTANCE( wxXmlNode* aInstance, IO_BASE* aIo = nullptr );
1557};
1558
1559
1560struct ECONNECT : public EAGLE_BASE
1561{
1562 /*
1563 * <!ELEMENT connect EMPTY>
1564 * <!ATTLIST connect
1565 * gate %String; #REQUIRED
1566 * pin %String; #REQUIRED
1567 * pad %String; #REQUIRED
1568 * route %ContactRoute; "all"
1569 * >
1570 */
1571 wxString gate;
1572 wxString pin;
1573 wxString pad;
1575
1576 ECONNECT( wxXmlNode* aConnect, IO_BASE* aIo = nullptr );
1577};
1578
1579
1581{
1582 /*
1583 * <!ELEMENT technology (attribute)*>
1584 * <!ATTLIST technology
1585 * name %String; #REQUIRED
1586 * >
1587 */
1588 wxString name;
1589
1590 std::vector<std::unique_ptr<EATTR>> attributes;
1591
1592 ETECHNOLOGY( wxXmlNode* aTechnology, IO_BASE* aIo = nullptr );
1593};
1594
1595
1597{
1598 /*
1599 * <!ELEMENT package3dinstance EMPTY>
1600 * <!ATTLIST package3dinstance
1601 * package3d_urn %Urn; #REQUIRED
1602 * >
1603 */
1605
1606 EPACKAGE3DINST( wxXmlNode* aPackage3dInst, IO_BASE* aIo = nullptr );
1607};
1608
1609
1610struct EDEVICE : public EAGLE_BASE
1611{
1612 /*
1613 * <!ELEMENT device (connects?, package3dinstances?, technologies?)>
1614 * <!ATTLIST device
1615 * name %String; ""
1616 * package %String; #IMPLIED
1617 * >
1618 */
1619 wxString name;
1621
1622 std::vector<std::unique_ptr<ECONNECT>> connects;
1623 std::vector<std::unique_ptr<EPACKAGE3DINST>> package3dinstances;
1624 std::map<wxString, std::unique_ptr<ETECHNOLOGY>> technologies;
1625
1626 EDEVICE( wxXmlNode* aDevice, IO_BASE* aIo = nullptr );
1627};
1628
1629
1631{
1632 /*
1633 * <!ELEMENT deviceset (description?, gates, devices, spice?)>
1634 * <!ATTLIST deviceset
1635 * name %String; #REQUIRED
1636 * urn %Urn; ""
1637 * locally_modified %Bool; "no"
1638 * prefix %String; ""
1639 * uservalue %Bool; "no"
1640 * library_version %Int; ""
1641 * library_locally_modified %Bool; "no"
1642 * >
1643 * <!-- library_version and library_locally_modified: Only in managed libraries
1644 * inside boards or schematics -->
1645 */
1646
1647 wxString name;
1654
1655 std::optional<EDESCRIPTION> description;
1656 std::map<wxString, std::unique_ptr<EGATE>> gates;
1657 std::map<wxString, std::unique_ptr<EDEVICE>> devices;
1658 std::optional<ESPICE> spice;
1659
1660 EDEVICE_SET( wxXmlNode* aDeviceSet, IO_BASE* aIo = nullptr );
1661};
1662
1663
1664struct ECLASS : public EAGLE_BASE
1665{
1666 /*
1667 * <!ELEMENT class (clearance)*>
1668 * <!ATTLIST class
1669 * number %Class; #REQUIRED
1670 * name %String; #REQUIRED
1671 * width %Dimension; "0"
1672 * drill %Dimension; "0"
1673 * >
1674 */
1675
1676 wxString number;
1677 wxString name;
1680
1681 std::map<wxString, ECOORD> clearanceMap;
1682
1683 ECLASS( wxXmlNode* aClass, IO_BASE* aIo = nullptr );
1684};
1685
1686
1687struct EPORT : public EAGLE_BASE
1688{
1689 /*
1690 * <!ELEMENT port EMPTY>
1691 * <!ATTLIST port
1692 * name %String; #REQUIRED
1693 * side %String; #REQUIRED
1694 * coord %Coord; #REQUIRED
1695 * direction %PortDirection; "io"
1696 * >
1697 *
1698 * The eagle.dtd is incorrect for the EPORT side attribute. It is not an integer, it is a
1699 * string that defines the side of the module rectangle the port is located. Valid values
1700 * are "top", "bottom", "right", and "left".
1701 */
1702 wxString name;
1703 wxString side;
1706
1707 EPORT( wxXmlNode* aPort, IO_BASE* aIo = nullptr );
1708};
1709
1710
1712{
1713 /*
1714 * <!ELEMENT variantdef EMPTY>
1715 * <!ATTLIST variantdef
1716 * name %String; #REQUIRED
1717 * current %Bool; "no"
1718 * >
1719 */
1720 wxString name;
1722
1723 EVARIANTDEF( wxXmlNode* aVariantDef, IO_BASE* aIo = nullptr );
1724};
1725
1726
1728{
1729 /*
1730 * <!ELEMENT schematic_group (attribute*, description?)>
1731 * <!ATTLIST schematic_group
1732 * name ID #REQUIRED
1733 * selectable %Bool; #IMPLIED
1734 * width %Dimension; #IMPLIED
1735 * titleSize %Dimension; #IMPLIED
1736 * titleFont %TextFont; #IMPLIED
1737 * style %WireStyle; #IMPLIED
1738 * showAnnotations %Bool; #IMPLIED
1739 * layer %Layer; #IMPLIED
1740 * grouprefs IDREFS #IMPLIED
1741 * >
1742 */
1743 wxString name;
1752
1753 std::optional<EDESCRIPTION> description;
1754 std::vector<std::unique_ptr<EATTR>> attributes;
1755
1756 ESCHEMATIC_GROUP( wxXmlNode* aSchematicGroup, IO_BASE* aIo = nullptr );
1757};
1758
1759
1760struct EPLAIN : public EAGLE_BASE
1761{
1762 /*
1763 * <!ELEMENT plain (polygon | wire | text | dimension | circle | spline | rectangle |
1764 * frame | hole)*>
1765 */
1766
1767 std::vector<std::unique_ptr<EPOLYGON>> polygons;
1768 std::vector<std::unique_ptr<EWIRE>> wires;
1769 std::vector<std::unique_ptr<ETEXT>> texts;
1770 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
1771 std::vector<std::unique_ptr<ECIRCLE>> circles;
1772 std::vector<std::unique_ptr<ESPLINE>> splines;
1773 std::vector<std::unique_ptr<ERECT>> rectangles;
1774 std::vector<std::unique_ptr<EFRAME>> frames;
1775 std::vector<std::unique_ptr<EHOLE>> holes;
1776
1777 EPLAIN( wxXmlNode* aPlain, IO_BASE* aIo = nullptr );
1778};
1779
1780
1782{
1783 /*
1784 * <!ELEMENT moduleinst (attribute)*>
1785 * <!ATTLIST moduleinst
1786 * name %String; #REQUIRED
1787 * module %String; #REQUIRED
1788 * modulevariant %String; ""
1789 * x %Coord; #REQUIRED
1790 * y %Coord; #REQUIRED
1791 * offset %Int; "0"
1792 * smashed %Bool; "no"
1793 * rot %Rotation; "R0"
1794 * >
1795 * <!-- rot: Only 0, 90, 180 or 270 -->
1796 */
1797
1798 wxString name;
1799 wxString moduleinst;
1806
1807 EMODULEINST( wxXmlNode* aModuleInst, IO_BASE* aIo = nullptr );
1808};
1809
1810
1811struct EPINREF : public EAGLE_BASE
1812{
1813 /*
1814 * <!ELEMENT pinref EMPTY>
1815 * <!ATTLIST pinref
1816 * part %String; #REQUIRED
1817 * gate %String; #REQUIRED
1818 * pin %String; #REQUIRED
1819 * >
1820 */
1821 wxString part;
1822 wxString gate;
1823 wxString pin;
1824
1825 EPINREF( wxXmlNode* aPinRef, IO_BASE* aIo = nullptr );
1826};
1827
1828
1829struct EPORTREF : public EAGLE_BASE
1830{
1831 /*
1832 * <!ELEMENT portref EMPTY>
1833 * <!ATTLIST portref
1834 * moduleinst %String; #REQUIRED
1835 * port %String; #REQUIRED
1836 * >
1837 */
1838 wxString moduleinst;
1839 wxString port;
1840
1841 EPORTREF( wxXmlNode* aPortRef, IO_BASE* aIo = nullptr );
1842};
1843
1844
1845struct EPROBE : public EAGLE_BASE
1846{
1847 /*
1848 * <!ELEMENT probe EMPTY>
1849 * <!ATTLIST probe
1850 * x %Coord; #REQUIRED
1851 * y %Coord; #REQUIRED
1852 * size %Dimension; #REQUIRED
1853 * layer %Layer; #REQUIRED
1854 * font %TextFont; "proportional"
1855 * ratio %Int; "8"
1856 * rot %Rotation; "R0"
1857 * xref %Bool; "no"
1858 * grouprefs IDREFS #IMPLIED
1859 * >
1860 * <!-- rot: Only 0, 90, 180 or 270 -->
1861 * <!-- xref: Only in <net> context -->
1862 */
1865 double size;
1871
1872 // TODO add grouprefs
1873
1874 EPROBE( wxXmlNode* aProbe, IO_BASE* aIo = nullptr );
1875};
1876
1877
1878struct ESEGMENT : public EAGLE_BASE
1879{
1880 /*
1881 * <!ELEMENT segment (pinref | portref | wire | junction | label | probe)*>
1882 * <!-- 'pinref' and 'junction' are only valid in a <net> context -->
1883 */
1884 std::vector<std::unique_ptr<EPINREF>> pinRefs;
1885 std::vector<std::unique_ptr<EPORTREF>> portRefs;
1886 std::vector<std::unique_ptr<EWIRE>> wires;
1887 std::vector<std::unique_ptr<EJUNCTION>> junctions;
1888 std::vector<std::unique_ptr<ELABEL>> labels;
1889 std::vector<std::unique_ptr<EPROBE>> probes;
1890
1891 ESEGMENT( wxXmlNode* aSegment, IO_BASE* aIo = nullptr );
1892};
1893
1894
1895struct EBUS : public EAGLE_BASE
1896{
1897 /*
1898 * <!ELEMENT bus (segment)*>
1899 * <!ATTLIST bus
1900 * name %String; #REQUIRED
1901 * >
1902 */
1903
1904 wxString name;
1905 std::vector<std::unique_ptr<ESEGMENT>> segments;
1906
1907 EBUS( wxXmlNode* aBus, IO_BASE* aIo = nullptr );
1908};
1909
1910
1911struct ESHEET : public EAGLE_BASE
1912{
1913 /*
1914 * <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
1915 */
1916
1917 std::optional<EDESCRIPTION> description;
1918 std::unique_ptr<EPLAIN> plain;
1919 std::map<wxString, std::unique_ptr<EMODULEINST>> moduleinsts;
1920 std::vector<std::unique_ptr<EINSTANCE>> instances;
1921 std::vector<std::unique_ptr<EBUS>> busses;
1922 std::vector<std::unique_ptr<ENET>> nets;
1923
1924 ESHEET( wxXmlNode* aSheet, IO_BASE* aIo = nullptr );
1925};
1926
1927
1928struct EMODULE : public EAGLE_BASE
1929{
1930 /*
1931 * <!ELEMENT module (description?, ports?, variantdefs?, groups?, parts?, sheets?)>
1932 * <!ATTLIST module
1933 * name %String; #REQUIRED
1934 * prefix %String; ""
1935 * dx %Coord; #REQUIRED
1936 * dy %Coord; #REQUIRED
1937 * >
1938 */
1939 wxString name;
1943
1944 std::optional<EDESCRIPTION> description;
1945 std::map<wxString, std::unique_ptr<EPORT>> ports;
1946 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
1947 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
1948 std::map<wxString, std::unique_ptr<EPART>> parts;
1949 std::vector<std::unique_ptr<ESHEET>> sheets;
1950
1951 EMODULE( wxXmlNode* aModule, IO_BASE* aIo = nullptr );
1952};
1953
1954
1955struct ENOTE : public EAGLE_BASE
1956{
1957 /*
1958 * <!ELEMENT note (#PCDATA)>
1959 * <!ATTLIST note
1960 * version %Real; #REQUIRED
1961 * severity %Severity; #REQUIRED
1962 * >
1963 * <!-- version: The EAGLE program version that introduced this compatibility note -->
1964 */
1965 double version;
1966 wxString severity;
1967 wxString note;
1968
1969 ENOTE( wxXmlNode* aNote, IO_BASE* aIo = nullptr );
1970};
1971
1972
1974{
1975 /*
1976 * <!ELEMENT compatibility (note)*>
1977 */
1978 std::vector<std::unique_ptr<ENOTE>> notes;
1979
1980 ECOMPATIBILITY( wxXmlNode* aCompatibility, IO_BASE* aIo = nullptr );
1981};
1982
1983
1984struct ESETTING : public EAGLE_BASE
1985{
1986 /*
1987 * <!ELEMENT setting EMPTY>
1988 * <!ATTLIST setting
1989 * alwaysvectorfont %Bool; #IMPLIED
1990 * verticaltext %VerticalText; "up"
1991 * keepoldvectorfont %Bool; "no"
1992 * >
1993 */
1997
1998 ESETTING( wxXmlNode* aSetting, IO_BASE* aIo = nullptr );
1999};
2000
2001
2002struct EGRID : public EAGLE_BASE
2003{
2004 /*
2005 * <!ELEMENT grid EMPTY>
2006 * <!ATTLIST grid
2007 * distance %Real; #IMPLIED
2008 * unitdist %GridUnit; #IMPLIED
2009 * unit %GridUnit; #IMPLIED
2010 * style %GridStyle; "lines"
2011 * multiple %Int; "1"
2012 * display %Bool; "no"
2013 * altdistance %Real; #IMPLIED
2014 * altunitdist %GridUnit; #IMPLIED
2015 * altunit %GridUnit; #IMPLIED
2016 * >
2017 */
2027
2028 EGRID( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2029};
2030
2031
2032struct EFILTER : public EAGLE_BASE
2033{
2034 /*
2035 * <!ELEMENT filter EMPTY>
2036 * <!ATTLIST filter
2037 * name %String; #REQUIRED
2038 * expression %String; #REQUIRED
2039 * >
2040 */
2041 wxString name;
2042 wxString expression;
2043
2044 EFILTER( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2045};
2046
2047
2048struct EPACKAGE : public EAGLE_BASE
2049{
2050 /*
2051 * <!ELEMENT package (description?, (polygon | wire | text | dimension | circle |
2052 * rectangle | frame | hole | pad | smd)*)>
2053 * <!ATTLIST package
2054 * name %String; #REQUIRED
2055 * urn %Urn; ""
2056 * locally_modified %Bool; "no"
2057 * library_version %Int; ""
2058 * library_locally_modified %Bool; "no"
2059 * >
2060 * <!-- library_version and library_locally_modified: Only in managed libraries
2061 * inside boards or schematics -->
2062 */
2063 wxString name;
2068
2069 std::optional<EDESCRIPTION> description;
2070 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2071 std::vector<std::unique_ptr<EWIRE>> wires;
2072 std::vector<std::unique_ptr<ETEXT>> texts;
2073 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2074 std::vector<std::unique_ptr<ECIRCLE>> circles;
2075 std::vector<std::unique_ptr<ERECT>> rectangles;
2076 std::vector<std::unique_ptr<EFRAME>> frames;
2077 std::vector<std::unique_ptr<EHOLE>> holes;
2078 std::vector<std::unique_ptr<EPAD>> thtpads;
2079 std::vector<std::unique_ptr<ESMD>> smdpads;
2080
2081 EPACKAGE( wxXmlNode* aPackage, IO_BASE* aIo = nullptr );
2082};
2083
2084
2086{
2087 /*
2088 * <!ELEMENT packageinstance EMPTY>
2089 * <!ATTLIST packageinstance
2090 * name %String; #REQUIRED
2091 * >
2092 */
2093 wxString name;
2094
2095 EPACKAGEINSTANCE( wxXmlNode* aPackageInstance, IO_BASE* aIo = nullptr );
2096};
2097
2098
2099struct EPACKAGE3D : public EAGLE_BASE
2100{
2101 /*
2102 * <!ELEMENT package3d (description?, packageinstances?)>
2103 * <!ATTLIST package3d
2104 * name %String; ""
2105 * urn %Urn; #REQUIRED
2106 * type %Package3dType; #REQUIRED
2107 * library_version %Int; ""
2108 * library_locally_modified %Bool; "no"
2109 * >
2110 * <!-- library_version and library_locally_modified: Only in managed libraries
2111 * inside boards or schematics -->
2112 */
2113 wxString name;
2115 wxString type;
2118
2119 std::optional<EDESCRIPTION> description;
2120 std::vector<std::unique_ptr<EPACKAGEINSTANCE>> packageinstances;
2121
2122 EPACKAGE3D( wxXmlNode* aPackage3d, IO_BASE* aIo = nullptr );
2123};
2124
2125
2126struct ESYMBOL : public EAGLE_BASE
2127{
2128 /*
2129 * <!ELEMENT symbol (description?, (polygon | wire | text | dimension | pin | circle |
2130 * rectangle | frame)*)>
2131 * <!ATTLIST symbol
2132 * name %String; #REQUIRED
2133 * urn %Urn; ""
2134 * locally_modified %Bool; "no"
2135 * library_version %Int; ""
2136 * library_locally_modified %Bool; "no"
2137 * >
2138 * <!-- library_version and library_locally_modified: Only in managed libraries
2139 * inside boards or schematics -->
2140 */
2141
2142 wxString name;
2147
2148 std::optional<EDESCRIPTION> description;
2149 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2150 std::vector<std::unique_ptr<EWIRE>> wires;
2151 std::vector<std::unique_ptr<ETEXT>> texts;
2152 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2153 std::vector<std::unique_ptr<EPIN>> pins;
2154 std::vector<std::unique_ptr<ECIRCLE>> circles;
2155 std::vector<std::unique_ptr<ERECT>> rectangles;
2156 std::vector<std::unique_ptr<EFRAME>> frames;
2157
2158 ESYMBOL( wxXmlNode* aSymbol, IO_BASE* aIo = nullptr );
2159};
2160
2161
2162struct ELIBRARY : public EAGLE_BASE
2163{
2164 /*
2165 * <!ELEMENT library (description?, packages?, packages3d?, symbols?, devicesets?)>
2166 * <!ATTLIST library
2167 * name %String; #REQUIRED
2168 * urn %Urn; ""
2169 * >
2170 * <!-- name: Only in libraries used inside boards or schematics -->
2171 * <!-- urn: Only in online libraries used inside boards or schematics -->
2172 */
2173 wxString name;
2175
2176 std::optional<EDESCRIPTION> description;
2177 std::map<wxString, std::unique_ptr<EPACKAGE>> packages;
2178 std::map<wxString, std::unique_ptr<EPACKAGE3D>> packages3d;
2179 std::map<wxString, std::unique_ptr<ESYMBOL>> symbols;
2180 std::map<wxString, std::unique_ptr<EDEVICE_SET>> devicesets;
2181
2187 wxString GetName() const;
2188 ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo = nullptr );
2189};
2190
2191
2192struct EAPPROVED : public EAGLE_BASE
2193{
2194 /*
2195 * <!ELEMENT approved EMPTY>
2196 * <!ATTLIST approved
2197 * hash %String; #REQUIRED
2198 * >
2199 */
2200 wxString hash;
2201
2202 EAPPROVED( wxXmlNode* aApproved, IO_BASE* aIo = nullptr );
2203};
2204
2205
2206struct ESCHEMATIC : public EAGLE_BASE
2207{
2208 /*
2209 * <!ELEMENT schematic (description?, libraries?, attributes?, variantdefs?, classes?,
2210 * modules?, groups?, parts?, sheets?, errors?)>
2211 * <!ATTLIST schematic
2212 * xreflabel %String; #IMPLIED
2213 * xrefpart %String; #IMPLIED
2214 * >
2215 */
2218
2219 std::optional<EDESCRIPTION> description;
2220 std::map<wxString, std::unique_ptr<ELIBRARY>> libraries;
2221 std::map<wxString, std::unique_ptr<EATTR>> attributes;
2222 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
2223 std::map<wxString, std::unique_ptr<ECLASS>> classes;
2224 std::map<wxString, std::unique_ptr<EMODULE>> modules;
2225 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
2226 std::map<wxString, std::unique_ptr<EPART>> parts;
2227 std::vector<std::unique_ptr<ESHEET>> sheets;
2228 std::vector<std::unique_ptr<EAPPROVED>> errors;
2229
2230 ESCHEMATIC( wxXmlNode* aSchematic, IO_BASE* aIo = nullptr );
2231};
2232
2233
2234struct EDRAWING : public EAGLE_BASE
2235{
2236 /*
2237 * <!ELEMENT drawing (settings?, grid?, filters?, layers, (library | schematic | board))>
2238 */
2239 std::vector<std::unique_ptr<ESETTING>> settings;
2240 std::optional<EGRID> grid;
2241 std::vector<std::unique_ptr<EFILTER>> filters;
2242 std::vector<std::unique_ptr<ELAYER>> layers;
2243 std::optional<ESCHEMATIC> schematic;
2244 std::optional<ELIBRARY> library;
2245 // std::optional<std::unique_ptr<EBOARD>> board;
2246
2247 EDRAWING( wxXmlNode* aDrawing, IO_BASE* aIo = nullptr );
2248};
2249
2250
2251struct EAGLE_DOC : public EAGLE_BASE
2252{
2253 /*
2254 * <!ELEMENT eagle (compatibility?, drawing, compatibility?)>
2255 * <!ATTLIST eagle
2256 * version %Real; #REQUIRED
2257 * >
2258 * <!-- version: The EAGLE program version that generated this file, in the
2259 * form V.RR -->
2260 */
2261
2269 wxString version;
2270
2271 std::unique_ptr<EDRAWING> drawing;
2272 std::optional<ECOMPATIBILITY> compatibility;
2273
2274 EAGLE_DOC( wxXmlNode* aEagleDoc, IO_BASE* aIo = nullptr );
2275};
2276
2277
2278#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 ConvertEagleTextSize(const opt_wxString &font, const ECOORD &size)
Converts Eagle's text size to KiCad text size depending on the font used.
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)
std::map< wxString, std::unique_ptr< EDEVICE > > devices
opt_bool uservalue
opt_bool library_locally_modified
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
wxString name
std::vector< std::unique_ptr< EPACKAGE3DINST > > package3dinstances
std::vector< std::unique_ptr< ECONNECT > > connects
EDEVICE(wxXmlNode *aDevice, IO_BASE *aIo=nullptr)
opt_wxString package
std::map< wxString, 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
bool IsValidOutline() const
Fewer than three vertices cannot bound an area; such polygons (which pre-v6 binary files can carry) w...
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:683