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
1441
1442
1443struct EGATE : public EAGLE_BASE
1444{
1445 /*
1446 * <!ELEMENT gate EMPTY>
1447 * <!ATTLIST gate
1448 * name %String; #REQUIRED
1449 * symbol %String; #REQUIRED
1450 * x %Coord; #REQUIRED
1451 * y %Coord; #REQUIRED
1452 * addlevel %GateAddLevel; "next"
1453 * swaplevel %Int; "0"
1454 * >
1455 */
1456
1457 wxString name;
1458 wxString symbol;
1459
1462
1465
1466 enum
1467 {
1473 };
1474
1475 EGATE( wxXmlNode* aGate, IO_BASE* aIo = nullptr );
1476};
1477
1478
1479struct EPART : public EAGLE_BASE
1480{
1481 /*
1482 * <!ELEMENT part (attribute*, variant*, spice?)>
1483 * <!ATTLIST part
1484 * name %String; #REQUIRED
1485 * library %String; #REQUIRED
1486 * library_urn %Urn; ""
1487 * deviceset %String; #REQUIRED
1488 * device %String; #REQUIRED
1489 * package3d_urn %Urn; ""
1490 * override_package3d_urn %Urn; ""
1491 * override_package_urn %Urn; ""
1492 * override_locally_modified %Bool; "no"
1493 * technology %String; ""
1494 * value %String; #IMPLIED
1495 * >
1496 * <!-- library_urn: Only in parts from online libraries -->
1497 */
1498 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1499 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1500 std::unique_ptr<ESPICE> spice;
1501
1502 wxString name;
1503 wxString library;
1505 wxString deviceset;
1506 wxString device;
1513
1514 EPART( wxXmlNode* aPart, IO_BASE* aIo = nullptr );
1515};
1516
1517
1518struct EINSTANCE : public EAGLE_BASE
1519{
1520 /*
1521 * <!ELEMENT instance (attribute)*>
1522 * <!ATTLIST instance
1523 * part %String; #REQUIRED
1524 * gate %String; #REQUIRED
1525 * x %Coord; #REQUIRED
1526 * y %Coord; #REQUIRED
1527 * smashed %Bool; "no"
1528 * rot %Rotation; "R0"
1529 * grouprefs IDREFS #IMPLIED
1530 * >
1531 * <!-- rot: Only 0, 90, 180 or 270 -->
1532 */
1533
1534 wxString part;
1535 wxString gate;
1540
1541 // TODO: add grouprefs
1542
1543 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1544
1545 EINSTANCE( wxXmlNode* aInstance, IO_BASE* aIo = nullptr );
1546};
1547
1548
1549struct ECONNECT : public EAGLE_BASE
1550{
1551 /*
1552 * <!ELEMENT connect EMPTY>
1553 * <!ATTLIST connect
1554 * gate %String; #REQUIRED
1555 * pin %String; #REQUIRED
1556 * pad %String; #REQUIRED
1557 * route %ContactRoute; "all"
1558 * >
1559 */
1560 wxString gate;
1561 wxString pin;
1562 wxString pad;
1564
1565 ECONNECT( wxXmlNode* aConnect, IO_BASE* aIo = nullptr );
1566};
1567
1568
1570{
1571 /*
1572 * <!ELEMENT technology (attribute)*>
1573 * <!ATTLIST technology
1574 * name %String; #REQUIRED
1575 * >
1576 */
1577 wxString name;
1578
1579 std::vector<std::unique_ptr<EATTR>> attributes;
1580
1581 ETECHNOLOGY( wxXmlNode* aTechnology, IO_BASE* aIo = nullptr );
1582};
1583
1584
1586{
1587 /*
1588 * <!ELEMENT package3dinstance EMPTY>
1589 * <!ATTLIST package3dinstance
1590 * package3d_urn %Urn; #REQUIRED
1591 * >
1592 */
1594
1595 EPACKAGE3DINST( wxXmlNode* aPackage3dInst, IO_BASE* aIo = nullptr );
1596};
1597
1598
1599struct EDEVICE : public EAGLE_BASE
1600{
1601 /*
1602 * <!ELEMENT device (connects?, package3dinstances?, technologies?)>
1603 * <!ATTLIST device
1604 * name %String; ""
1605 * package %String; #IMPLIED
1606 * >
1607 */
1608 wxString name;
1610
1611 std::vector<std::unique_ptr<ECONNECT>> connects;
1612 std::vector<std::unique_ptr<EPACKAGE3DINST>> package3dinstances;
1613 std::map<wxString, std::unique_ptr<ETECHNOLOGY>> technologies;
1614
1615 EDEVICE( wxXmlNode* aDevice, IO_BASE* aIo = nullptr );
1616};
1617
1618
1620{
1621 /*
1622 * <!ELEMENT deviceset (description?, gates, devices, spice?)>
1623 * <!ATTLIST deviceset
1624 * name %String; #REQUIRED
1625 * urn %Urn; ""
1626 * locally_modified %Bool; "no"
1627 * prefix %String; ""
1628 * uservalue %Bool; "no"
1629 * library_version %Int; ""
1630 * library_locally_modified %Bool; "no"
1631 * >
1632 * <!-- library_version and library_locally_modified: Only in managed libraries
1633 * inside boards or schematics -->
1634 */
1635
1636 wxString name;
1643
1644 std::optional<EDESCRIPTION> description;
1645 std::map<wxString, std::unique_ptr<EGATE>> gates;
1646 std::map<wxString, std::unique_ptr<EDEVICE>> devices;
1647 std::optional<ESPICE> spice;
1648
1649 EDEVICE_SET( wxXmlNode* aDeviceSet, IO_BASE* aIo = nullptr );
1650};
1651
1652
1653struct ECLASS : public EAGLE_BASE
1654{
1655 /*
1656 * <!ELEMENT class (clearance)*>
1657 * <!ATTLIST class
1658 * number %Class; #REQUIRED
1659 * name %String; #REQUIRED
1660 * width %Dimension; "0"
1661 * drill %Dimension; "0"
1662 * >
1663 */
1664
1665 wxString number;
1666 wxString name;
1669
1670 std::map<wxString, ECOORD> clearanceMap;
1671
1672 ECLASS( wxXmlNode* aClass, IO_BASE* aIo = nullptr );
1673};
1674
1675
1676struct EPORT : public EAGLE_BASE
1677{
1678 /*
1679 * <!ELEMENT port EMPTY>
1680 * <!ATTLIST port
1681 * name %String; #REQUIRED
1682 * side %String; #REQUIRED
1683 * coord %Coord; #REQUIRED
1684 * direction %PortDirection; "io"
1685 * >
1686 *
1687 * The eagle.dtd is incorrect for the EPORT side attribute. It is not an integer, it is a
1688 * string that defines the side of the module rectangle the port is located. Valid values
1689 * are "top", "bottom", "right", and "left".
1690 */
1691 wxString name;
1692 wxString side;
1695
1696 EPORT( wxXmlNode* aPort, IO_BASE* aIo = nullptr );
1697};
1698
1699
1701{
1702 /*
1703 * <!ELEMENT variantdef EMPTY>
1704 * <!ATTLIST variantdef
1705 * name %String; #REQUIRED
1706 * current %Bool; "no"
1707 * >
1708 */
1709 wxString name;
1711
1712 EVARIANTDEF( wxXmlNode* aVariantDef, IO_BASE* aIo = nullptr );
1713};
1714
1715
1717{
1718 /*
1719 * <!ELEMENT schematic_group (attribute*, description?)>
1720 * <!ATTLIST schematic_group
1721 * name ID #REQUIRED
1722 * selectable %Bool; #IMPLIED
1723 * width %Dimension; #IMPLIED
1724 * titleSize %Dimension; #IMPLIED
1725 * titleFont %TextFont; #IMPLIED
1726 * style %WireStyle; #IMPLIED
1727 * showAnnotations %Bool; #IMPLIED
1728 * layer %Layer; #IMPLIED
1729 * grouprefs IDREFS #IMPLIED
1730 * >
1731 */
1732 wxString name;
1741
1742 std::optional<EDESCRIPTION> description;
1743 std::vector<std::unique_ptr<EATTR>> attributes;
1744
1745 ESCHEMATIC_GROUP( wxXmlNode* aSchematicGroup, IO_BASE* aIo = nullptr );
1746};
1747
1748
1749struct EPLAIN : public EAGLE_BASE
1750{
1751 /*
1752 * <!ELEMENT plain (polygon | wire | text | dimension | circle | spline | rectangle |
1753 * frame | hole)*>
1754 */
1755
1756 std::vector<std::unique_ptr<EPOLYGON>> polygons;
1757 std::vector<std::unique_ptr<EWIRE>> wires;
1758 std::vector<std::unique_ptr<ETEXT>> texts;
1759 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
1760 std::vector<std::unique_ptr<ECIRCLE>> circles;
1761 std::vector<std::unique_ptr<ESPLINE>> splines;
1762 std::vector<std::unique_ptr<ERECT>> rectangles;
1763 std::vector<std::unique_ptr<EFRAME>> frames;
1764 std::vector<std::unique_ptr<EHOLE>> holes;
1765
1766 EPLAIN( wxXmlNode* aPlain, IO_BASE* aIo = nullptr );
1767};
1768
1769
1771{
1772 /*
1773 * <!ELEMENT moduleinst (attribute)*>
1774 * <!ATTLIST moduleinst
1775 * name %String; #REQUIRED
1776 * module %String; #REQUIRED
1777 * modulevariant %String; ""
1778 * x %Coord; #REQUIRED
1779 * y %Coord; #REQUIRED
1780 * offset %Int; "0"
1781 * smashed %Bool; "no"
1782 * rot %Rotation; "R0"
1783 * >
1784 * <!-- rot: Only 0, 90, 180 or 270 -->
1785 */
1786
1787 wxString name;
1788 wxString moduleinst;
1795
1796 EMODULEINST( wxXmlNode* aModuleInst, IO_BASE* aIo = nullptr );
1797};
1798
1799
1800struct EPINREF : public EAGLE_BASE
1801{
1802 /*
1803 * <!ELEMENT pinref EMPTY>
1804 * <!ATTLIST pinref
1805 * part %String; #REQUIRED
1806 * gate %String; #REQUIRED
1807 * pin %String; #REQUIRED
1808 * >
1809 */
1810 wxString part;
1811 wxString gate;
1812 wxString pin;
1813
1814 EPINREF( wxXmlNode* aPinRef, IO_BASE* aIo = nullptr );
1815};
1816
1817
1818struct EPORTREF : public EAGLE_BASE
1819{
1820 /*
1821 * <!ELEMENT portref EMPTY>
1822 * <!ATTLIST portref
1823 * moduleinst %String; #REQUIRED
1824 * port %String; #REQUIRED
1825 * >
1826 */
1827 wxString moduleinst;
1828 wxString port;
1829
1830 EPORTREF( wxXmlNode* aPortRef, IO_BASE* aIo = nullptr );
1831};
1832
1833
1834struct EPROBE : public EAGLE_BASE
1835{
1836 /*
1837 * <!ELEMENT probe EMPTY>
1838 * <!ATTLIST probe
1839 * x %Coord; #REQUIRED
1840 * y %Coord; #REQUIRED
1841 * size %Dimension; #REQUIRED
1842 * layer %Layer; #REQUIRED
1843 * font %TextFont; "proportional"
1844 * ratio %Int; "8"
1845 * rot %Rotation; "R0"
1846 * xref %Bool; "no"
1847 * grouprefs IDREFS #IMPLIED
1848 * >
1849 * <!-- rot: Only 0, 90, 180 or 270 -->
1850 * <!-- xref: Only in <net> context -->
1851 */
1854 double size;
1860
1861 // TODO add grouprefs
1862
1863 EPROBE( wxXmlNode* aProbe, IO_BASE* aIo = nullptr );
1864};
1865
1866
1867struct ESEGMENT : public EAGLE_BASE
1868{
1869 /*
1870 * <!ELEMENT segment (pinref | portref | wire | junction | label | probe)*>
1871 * <!-- 'pinref' and 'junction' are only valid in a <net> context -->
1872 */
1873 std::vector<std::unique_ptr<EPINREF>> pinRefs;
1874 std::vector<std::unique_ptr<EPORTREF>> portRefs;
1875 std::vector<std::unique_ptr<EWIRE>> wires;
1876 std::vector<std::unique_ptr<EJUNCTION>> junctions;
1877 std::vector<std::unique_ptr<ELABEL>> labels;
1878 std::vector<std::unique_ptr<EPROBE>> probes;
1879
1880 ESEGMENT( wxXmlNode* aSegment, IO_BASE* aIo = nullptr );
1881};
1882
1883
1884struct EBUS : public EAGLE_BASE
1885{
1886 /*
1887 * <!ELEMENT bus (segment)*>
1888 * <!ATTLIST bus
1889 * name %String; #REQUIRED
1890 * >
1891 */
1892
1893 wxString name;
1894 std::vector<std::unique_ptr<ESEGMENT>> segments;
1895
1896 EBUS( wxXmlNode* aBus, IO_BASE* aIo = nullptr );
1897};
1898
1899
1900struct ESHEET : public EAGLE_BASE
1901{
1902 /*
1903 * <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
1904 */
1905
1906 std::optional<EDESCRIPTION> description;
1907 std::unique_ptr<EPLAIN> plain;
1908 std::map<wxString, std::unique_ptr<EMODULEINST>> moduleinsts;
1909 std::vector<std::unique_ptr<EINSTANCE>> instances;
1910 std::vector<std::unique_ptr<EBUS>> busses;
1911 std::vector<std::unique_ptr<ENET>> nets;
1912
1913 ESHEET( wxXmlNode* aSheet, IO_BASE* aIo = nullptr );
1914};
1915
1916
1917struct EMODULE : public EAGLE_BASE
1918{
1919 /*
1920 * <!ELEMENT module (description?, ports?, variantdefs?, groups?, parts?, sheets?)>
1921 * <!ATTLIST module
1922 * name %String; #REQUIRED
1923 * prefix %String; ""
1924 * dx %Coord; #REQUIRED
1925 * dy %Coord; #REQUIRED
1926 * >
1927 */
1928 wxString name;
1932
1933 std::optional<EDESCRIPTION> description;
1934 std::map<wxString, std::unique_ptr<EPORT>> ports;
1935 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
1936 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
1937 std::map<wxString, std::unique_ptr<EPART>> parts;
1938 std::vector<std::unique_ptr<ESHEET>> sheets;
1939
1940 EMODULE( wxXmlNode* aModule, IO_BASE* aIo = nullptr );
1941};
1942
1943
1944struct ENOTE : public EAGLE_BASE
1945{
1946 /*
1947 * <!ELEMENT note (#PCDATA)>
1948 * <!ATTLIST note
1949 * version %Real; #REQUIRED
1950 * severity %Severity; #REQUIRED
1951 * >
1952 * <!-- version: The EAGLE program version that introduced this compatibility note -->
1953 */
1954 double version;
1955 wxString severity;
1956 wxString note;
1957
1958 ENOTE( wxXmlNode* aNote, IO_BASE* aIo = nullptr );
1959};
1960
1961
1963{
1964 /*
1965 * <!ELEMENT compatibility (note)*>
1966 */
1967 std::vector<std::unique_ptr<ENOTE>> notes;
1968
1969 ECOMPATIBILITY( wxXmlNode* aCompatibility, IO_BASE* aIo = nullptr );
1970};
1971
1972
1973struct ESETTING : public EAGLE_BASE
1974{
1975 /*
1976 * <!ELEMENT setting EMPTY>
1977 * <!ATTLIST setting
1978 * alwaysvectorfont %Bool; #IMPLIED
1979 * verticaltext %VerticalText; "up"
1980 * keepoldvectorfont %Bool; "no"
1981 * >
1982 */
1986
1987 ESETTING( wxXmlNode* aSetting, IO_BASE* aIo = nullptr );
1988};
1989
1990
1991struct EGRID : public EAGLE_BASE
1992{
1993 /*
1994 * <!ELEMENT grid EMPTY>
1995 * <!ATTLIST grid
1996 * distance %Real; #IMPLIED
1997 * unitdist %GridUnit; #IMPLIED
1998 * unit %GridUnit; #IMPLIED
1999 * style %GridStyle; "lines"
2000 * multiple %Int; "1"
2001 * display %Bool; "no"
2002 * altdistance %Real; #IMPLIED
2003 * altunitdist %GridUnit; #IMPLIED
2004 * altunit %GridUnit; #IMPLIED
2005 * >
2006 */
2016
2017 EGRID( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2018};
2019
2020
2021struct EFILTER : public EAGLE_BASE
2022{
2023 /*
2024 * <!ELEMENT filter EMPTY>
2025 * <!ATTLIST filter
2026 * name %String; #REQUIRED
2027 * expression %String; #REQUIRED
2028 * >
2029 */
2030 wxString name;
2031 wxString expression;
2032
2033 EFILTER( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
2034};
2035
2036
2037struct EPACKAGE : public EAGLE_BASE
2038{
2039 /*
2040 * <!ELEMENT package (description?, (polygon | wire | text | dimension | circle |
2041 * rectangle | frame | hole | pad | smd)*)>
2042 * <!ATTLIST package
2043 * name %String; #REQUIRED
2044 * urn %Urn; ""
2045 * locally_modified %Bool; "no"
2046 * library_version %Int; ""
2047 * library_locally_modified %Bool; "no"
2048 * >
2049 * <!-- library_version and library_locally_modified: Only in managed libraries
2050 * inside boards or schematics -->
2051 */
2052 wxString name;
2057
2058 std::optional<EDESCRIPTION> description;
2059 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2060 std::vector<std::unique_ptr<EWIRE>> wires;
2061 std::vector<std::unique_ptr<ETEXT>> texts;
2062 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2063 std::vector<std::unique_ptr<ECIRCLE>> circles;
2064 std::vector<std::unique_ptr<ERECT>> rectangles;
2065 std::vector<std::unique_ptr<EFRAME>> frames;
2066 std::vector<std::unique_ptr<EHOLE>> holes;
2067 std::vector<std::unique_ptr<EPAD>> thtpads;
2068 std::vector<std::unique_ptr<ESMD>> smdpads;
2069
2070 EPACKAGE( wxXmlNode* aPackage, IO_BASE* aIo = nullptr );
2071};
2072
2073
2075{
2076 /*
2077 * <!ELEMENT packageinstance EMPTY>
2078 * <!ATTLIST packageinstance
2079 * name %String; #REQUIRED
2080 * >
2081 */
2082 wxString name;
2083
2084 EPACKAGEINSTANCE( wxXmlNode* aPackageInstance, IO_BASE* aIo = nullptr );
2085};
2086
2087
2088struct EPACKAGE3D : public EAGLE_BASE
2089{
2090 /*
2091 * <!ELEMENT package3d (description?, packageinstances?)>
2092 * <!ATTLIST package3d
2093 * name %String; ""
2094 * urn %Urn; #REQUIRED
2095 * type %Package3dType; #REQUIRED
2096 * library_version %Int; ""
2097 * library_locally_modified %Bool; "no"
2098 * >
2099 * <!-- library_version and library_locally_modified: Only in managed libraries
2100 * inside boards or schematics -->
2101 */
2102 wxString name;
2104 wxString type;
2107
2108 std::optional<EDESCRIPTION> description;
2109 std::vector<std::unique_ptr<EPACKAGEINSTANCE>> packageinstances;
2110
2111 EPACKAGE3D( wxXmlNode* aPackage3d, IO_BASE* aIo = nullptr );
2112};
2113
2114
2115struct ESYMBOL : public EAGLE_BASE
2116{
2117 /*
2118 * <!ELEMENT symbol (description?, (polygon | wire | text | dimension | pin | circle |
2119 * rectangle | frame)*)>
2120 * <!ATTLIST symbol
2121 * name %String; #REQUIRED
2122 * urn %Urn; ""
2123 * locally_modified %Bool; "no"
2124 * library_version %Int; ""
2125 * library_locally_modified %Bool; "no"
2126 * >
2127 * <!-- library_version and library_locally_modified: Only in managed libraries
2128 * inside boards or schematics -->
2129 */
2130
2131 wxString name;
2136
2137 std::optional<EDESCRIPTION> description;
2138 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2139 std::vector<std::unique_ptr<EWIRE>> wires;
2140 std::vector<std::unique_ptr<ETEXT>> texts;
2141 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2142 std::vector<std::unique_ptr<EPIN>> pins;
2143 std::vector<std::unique_ptr<ECIRCLE>> circles;
2144 std::vector<std::unique_ptr<ERECT>> rectangles;
2145 std::vector<std::unique_ptr<EFRAME>> frames;
2146
2147 ESYMBOL( wxXmlNode* aSymbol, IO_BASE* aIo = nullptr );
2148};
2149
2150
2151struct ELIBRARY : public EAGLE_BASE
2152{
2153 /*
2154 * <!ELEMENT library (description?, packages?, packages3d?, symbols?, devicesets?)>
2155 * <!ATTLIST library
2156 * name %String; #REQUIRED
2157 * urn %Urn; ""
2158 * >
2159 * <!-- name: Only in libraries used inside boards or schematics -->
2160 * <!-- urn: Only in online libraries used inside boards or schematics -->
2161 */
2162 wxString name;
2164
2165 std::optional<EDESCRIPTION> description;
2166 std::map<wxString, std::unique_ptr<EPACKAGE>> packages;
2167 std::map<wxString, std::unique_ptr<EPACKAGE3D>> packages3d;
2168 std::map<wxString, std::unique_ptr<ESYMBOL>> symbols;
2169 std::map<wxString, std::unique_ptr<EDEVICE_SET>> devicesets;
2170
2176 wxString GetName() const;
2177 ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo = nullptr );
2178};
2179
2180
2181struct EAPPROVED : public EAGLE_BASE
2182{
2183 /*
2184 * <!ELEMENT approved EMPTY>
2185 * <!ATTLIST approved
2186 * hash %String; #REQUIRED
2187 * >
2188 */
2189 wxString hash;
2190
2191 EAPPROVED( wxXmlNode* aApproved, IO_BASE* aIo = nullptr );
2192};
2193
2194
2195struct ESCHEMATIC : public EAGLE_BASE
2196{
2197 /*
2198 * <!ELEMENT schematic (description?, libraries?, attributes?, variantdefs?, classes?,
2199 * modules?, groups?, parts?, sheets?, errors?)>
2200 * <!ATTLIST schematic
2201 * xreflabel %String; #IMPLIED
2202 * xrefpart %String; #IMPLIED
2203 * >
2204 */
2207
2208 std::optional<EDESCRIPTION> description;
2209 std::map<wxString, std::unique_ptr<ELIBRARY>> libraries;
2210 std::map<wxString, std::unique_ptr<EATTR>> attributes;
2211 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
2212 std::map<wxString, std::unique_ptr<ECLASS>> classes;
2213 std::map<wxString, std::unique_ptr<EMODULE>> modules;
2214 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
2215 std::map<wxString, std::unique_ptr<EPART>> parts;
2216 std::vector<std::unique_ptr<ESHEET>> sheets;
2217 std::vector<std::unique_ptr<EAPPROVED>> errors;
2218
2219 ESCHEMATIC( wxXmlNode* aSchematic, IO_BASE* aIo = nullptr );
2220};
2221
2222
2223struct EDRAWING : public EAGLE_BASE
2224{
2225 /*
2226 * <!ELEMENT drawing (settings?, grid?, filters?, layers, (library | schematic | board))>
2227 */
2228 std::vector<std::unique_ptr<ESETTING>> settings;
2229 std::optional<EGRID> grid;
2230 std::vector<std::unique_ptr<EFILTER>> filters;
2231 std::vector<std::unique_ptr<ELAYER>> layers;
2232 std::optional<ESCHEMATIC> schematic;
2233 std::optional<ELIBRARY> library;
2234 // std::optional<std::unique_ptr<EBOARD>> board;
2235
2236 EDRAWING( wxXmlNode* aDrawing, IO_BASE* aIo = nullptr );
2237};
2238
2239
2240struct EAGLE_DOC : public EAGLE_BASE
2241{
2242 /*
2243 * <!ELEMENT eagle (compatibility?, drawing, compatibility?)>
2244 * <!ATTLIST eagle
2245 * version %Real; #REQUIRED
2246 * >
2247 * <!-- version: The EAGLE program version that generated this file, in the
2248 * form V.RR -->
2249 */
2250
2258 wxString version;
2259
2260 std::unique_ptr<EDRAWING> drawing;
2261 std::optional<ECOMPATIBILITY> compatibility;
2262
2263 EAGLE_DOC( wxXmlNode* aEagleDoc, IO_BASE* aIo = nullptr );
2264};
2265
2266
2267#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