KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eagle_parser.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 2012-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 * Copyright (C) 2017 CERN
7 *
8 * @author Alejandro GarcĂ­a Montoro <[email protected]>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, you may find one here:
22 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
23 * or you may search the http://www.gnu.org website for the version 2 license,
24 * or you may write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 */
27
28
29#ifndef _EAGLE_PARSER_H_
30#define _EAGLE_PARSER_H_
31
32#include <map>
33#include <memory>
34#include <optional>
35#include <unordered_map>
36
37#include <wx/xml/xml.h>
38#include <wx/string.h>
39#include <wx/filename.h>
40
41#include <layer_ids.h>
42#include <trigo.h>
43#include <core/wx_stl_compat.h>
45
46class FOOTPRINT;
47class IO_BASE;
48
49struct EINSTANCE;
50struct EPART;
51struct ETEXT;
52struct ESEGMENT;
53
54typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
55typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
56typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
57
59wxString escapeName( const wxString& aNetName );
60
62wxString interpretText( const wxString& aText );
63
65bool substituteVariable( wxString* aText );
66
68wxString convertDescription( wxString aDescr );
69
70static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
71{
72 auto it = aMap.find( aName );
73 return it == aMap.end() ? nullptr : it->second->GetChildren();
74}
75
76
81struct XML_PARSER_ERROR : std::runtime_error
82{
89 XML_PARSER_ERROR( const wxString& aMessage ) noexcept :
90 std::runtime_error( "XML parser failed - " + aMessage.ToStdString() )
91 {}
92};
93
94
96struct TRIPLET
97{
98 const char* element;
99 const char* attribute;
100 const char* value;
101
102 TRIPLET( const char* aElement, const char* aAttribute = "", const char* aValue = "" ) :
103 element( aElement ),
104 attribute( aAttribute ),
105 value( aValue )
106 {}
107};
108
109
123class XPATH
124{
125 std::vector<TRIPLET> p;
126
127public:
128 void push( const char* aPathSegment, const char* aAttribute="" )
129 {
130 p.emplace_back( aPathSegment, aAttribute );
131 }
132
133 void clear() { p.clear(); }
134
135 void pop() { p.pop_back(); }
136
138 void Value( const char* aValue )
139 {
140 p.back().value = aValue;
141 }
142
144 void Attribute( const char* aAttribute )
145 {
146 p.back().attribute = aAttribute;
147 }
148
150 wxString Contents()
151 {
152 typedef std::vector<TRIPLET>::const_iterator CITER_TRIPLET;
153
154 wxString ret;
155
156 for( CITER_TRIPLET it = p.begin(); it != p.end(); ++it )
157 {
158 if( it != p.begin() )
159 ret += '.';
160
161 ret += it->element;
162
163 if( it->attribute[0] && it->value[0] )
164 {
165 ret += '[';
166 ret += it->attribute;
167 ret += '=';
168 ret += it->value;
169 ret += ']';
170 }
171 }
172
173 return ret;
174 }
175};
176
177
185template<typename T>
186T Convert( const wxString& aValue )
187{
188 throw XML_PARSER_ERROR( "Conversion failed. Unknown type." );
189}
190
191template <>
192wxString Convert<wxString>( const wxString& aValue );
193
200template <typename T>
202{
203private:
206
209
210public:
215 m_isAvailable( false ),
216 m_data( T() )
217 {}
218
224 OPTIONAL_XML_ATTRIBUTE( const wxString& aData )
225 {
226 m_data = T();
227 m_isAvailable = !aData.IsEmpty();
228
229 if( m_isAvailable )
230 Set( aData );
231 }
232
237 template<typename V = T>
239 m_isAvailable( true ),
240 m_data( aData )
241 {}
242
246 operator bool() const
247 {
248 return m_isAvailable;
249 }
250
257 OPTIONAL_XML_ATTRIBUTE<T>& operator =( const wxString& aData )
258 {
259 m_isAvailable = !aData.IsEmpty();
260
261 if( m_isAvailable )
262 Set( aData );
263
264 return *this;
265 }
266
274 {
275 m_data = aData;
276 m_isAvailable = true;
277
278 return *this;
279 }
280
284 bool operator ==( const T& aOther ) const
285 {
286 return m_isAvailable && ( aOther == m_data );
287 }
288
294 void Set( const wxString& aString )
295 {
296 m_data = Convert<T>( aString );
297 m_isAvailable = !aString.IsEmpty();
298 }
299
305 T& Get()
306 {
307 assert( m_isAvailable );
308 return m_data;
309 }
310
316 const T& CGet() const
317 {
318 assert( m_isAvailable );
319 return m_data;
320 }
321
328 {
329 return Get();
330 }
331
337 const T& operator*() const
338 {
339 return CGet();
340 }
341
348 {
349 return &Get();
350 }
351
357 const T* operator->() const
358 {
359 return &CGet();
360 }
361};
362
363
371size_t GetNodeCount( const wxXmlNode* aNode );
372
373
381NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
382
384VECTOR2I ConvertArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle );
385
386// Pre-declare for typedefs
387struct EROT;
388struct ECOORD;
389
396
397
399{
400 EAGLE_BASE( IO_BASE* aIo = nullptr ) :
401 io( aIo ) {}
402
404
405 /*
406 * Send a message to the #IO_BASE #REPORTER object if one exists.
407 *
408 * @param aMsg is the message to send to the #REPORTER object.
409 */
410 void Report( const wxString& aMsg, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED );
411
413};
414
415
416// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
417// For maintenance and troubleshooting purposes, it was thought that we'd need to
418// separate the conversion process into distinct steps. There is no intent to have KiCad
419// forms of information in these 'E'STRUCTS. They are only binary forms
420// of the Eagle information in the corresponding Eagle XML nodes.
421
422
424{
425 /*
426 * <!ELEMENT description (#PCDATA)>
427 * <!ATTLIST description
428 * language %String; "en"
429 * >
430 */
431
432 wxString text;
434
435 EDESCRIPTION( wxXmlNode* aDescription, IO_BASE* aIo = nullptr );
436};
437
438
439// Eagle coordinates
440struct ECOORD : public EAGLE_BASE
441{
443 {
448 };
449
451 long long int value;
452
454 static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
455
457 : value( 0 )
458 {
459 }
460
461 ECOORD( int aValue, enum EAGLE_UNIT aUnit )
462 : value( ConvertToNm( aValue, aUnit ) )
463 {
464 }
465
466 ECOORD( const wxString& aValue, enum EAGLE_UNIT aUnit );
467
468 int ToMils() const
469 {
470 return value / 25400;
471 }
472
473 int To100NanoMeters() const
474 {
475 return value / 100;
476 }
477
478 int ToNanoMeters() const
479 {
480 return value;
481 }
482
483 float ToMm() const
484 {
485 return value / 1000000.0;
486 }
487
488 int ToSchUnits() const { return To100NanoMeters(); }
489 int ToPcbUnits() const { return ToNanoMeters(); }
490
491 ECOORD operator+( const ECOORD& aOther ) const
492 {
493 return ECOORD( value + aOther.value, ECOORD_UNIT );
494 }
495
496 ECOORD operator-( const ECOORD& aOther ) const
497 {
498 return ECOORD( value - aOther.value, ECOORD_UNIT );
499 }
500
501 bool operator==( const ECOORD& aOther ) const
502 {
503 return value == aOther.value;
504 }
505
507 static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
508};
509
510
512struct ENET : public EAGLE_BASE
513{
514 /*
515 * <!ELEMENT net (segment)*>
516 * <!ATTLIST net
517 * name %String; #REQUIRED
518 * class %Class; "0"
519 * >
520 */
521 wxString netname;
523
524 std::vector<std::unique_ptr<ESEGMENT>> segments;
525
526 ENET( int aNetCode, const wxString& aNetName ) :
527 netname( aNetName ),
528 netcode( aNetCode )
529 {}
530
532 netcode( 0 )
533 {}
534
535 ENET( wxXmlNode* aNet, IO_BASE* aIo = nullptr );
536};
537
538
540struct EROT
541{
542 bool mirror;
543 bool spin;
544 double degrees;
545
547 mirror( false ),
548 spin( false ),
549 degrees( 0 )
550 {}
551
552 EROT( double aDegrees ) :
553 mirror( false ),
554 spin( false ),
555 degrees( aDegrees )
556 {}
557};
558
559
561struct EVERTEX : public EAGLE_BASE
562{
563 /*
564 * <!ELEMENT vertex EMPTY>
565 * <!ATTLIST vertex
566 * x %Coord; #REQUIRED
567 * y %Coord; #REQUIRED
568 * curve %WireCurve; "0"
569 * >
570 * <!-- curve: The curvature from this vertex to the next one -->
571 */
575
576 EVERTEX( wxXmlNode* aVertex, IO_BASE* aIo = nullptr );
577};
578
579
581struct EWIRE : public EAGLE_BASE
582{
583 /*
584 * <!ELEMENT wire EMPTY>
585 * <!ATTLIST wire
586 * x1 %Coord; #REQUIRED
587 * y1 %Coord; #REQUIRED
588 * x2 %Coord; #REQUIRED
589 * y2 %Coord; #REQUIRED
590 * width %Dimension; #REQUIRED
591 * layer %Layer; #REQUIRED
592 * extent %Extent; #IMPLIED
593 * style %WireStyle; "continuous"
594 * curve %WireCurve; "0"
595 * cap %WireCap; "round"
596 * grouprefs IDREFS #IMPLIED
597 * >
598 * <!-- extent: Only applicable for airwires -->
599 * <!-- cap : Only applicable if 'curve' is not zero -->
600 */
606 int layer;
607
608 // for style: (continuous | longdash | shortdash | dashdot)
613
617
618 // for cap: (flat | round)
619 enum { FLAT,
621
623
624 // TODO add grouprefs
625
626 EWIRE( wxXmlNode* aWire, IO_BASE* aIo = nullptr );
627};
628
629
631struct EJUNCTION : public EAGLE_BASE
632{
633 /*
634 * <!ELEMENT junction EMPTY>
635 * <!ATTLIST junction
636 * x %Coord; #REQUIRED
637 * y %Coord; #REQUIRED
638 * grouprefs IDREFS #IMPLIED
639 * >
640 */
641
644
645 EJUNCTION( wxXmlNode* aJunction, IO_BASE* aIo = nullptr );
646};
647
648
650struct ELABEL : public EAGLE_BASE
651{
652 /*
653 * <!ELEMENT label EMPTY>
654 * <!ATTLIST label
655 * x %Coord; #REQUIRED
656 * y %Coord; #REQUIRED
657 * size %Dimension; #REQUIRED
658 * layer %Layer; #REQUIRED
659 * font %TextFont; "proportional"
660 * ratio %Int; "8"
661 * rot %Rotation; "R0"
662 * xref %Bool; "no"
663 * align %Align; "bottom-left"
664 * grouprefs IDREFS #IMPLIED
665 * >
666 * <!-- rot: Only 0, 90, 180 or 270 -->
667 * <!-- xref: Only in <net> context -->
668 */
669
673 int layer;
679
680 // TODO Add grouprefs
681
682 ELABEL( wxXmlNode* aLabel, IO_BASE* aIo = nullptr );
683};
684
685
687struct EVIA : public EAGLE_BASE
688{
689 /*
690 * <!ELEMENT via EMPTY>
691 * <!ATTLIST via
692 * x %Coord; #REQUIRED
693 * y %Coord; #REQUIRED
694 * extent %Extent; #REQUIRED
695 * drill %Dimension; #REQUIRED
696 * diameter %Dimension; "0"
697 * shape %ViaShape; "round"
698 * alwaysstop %Bool; "no"
699 * grouprefs IDREFS #IMPLIED
700 * >
701 */
710
711 // TODO add grouprefs
712
713 EVIA( wxXmlNode* aVia, IO_BASE* aIo = nullptr );
714};
715
716
718struct ECIRCLE : public EAGLE_BASE
719{
720 /*
721 * <!ELEMENT circle EMPTY>
722 * <!ATTLIST circle
723 * x %Coord; #REQUIRED
724 * y %Coord; #REQUIRED
725 * radius %Coord; #REQUIRED
726 * width %Dimension; #REQUIRED
727 * layer %Layer; #REQUIRED
728 * grouprefs IDREFS #IMPLIED
729 * >
730 */
735 int layer;
736
737 // TODO add grouprefs
738
739 ECIRCLE( wxXmlNode* aCircle, IO_BASE* aIo = nullptr );
740};
741
742
744struct ERECT : public EAGLE_BASE
745{
746 /*
747 * <!ELEMENT rectangle EMPTY>
748 * <!ATTLIST rectangle
749 * x1 %Coord; #REQUIRED
750 * y1 %Coord; #REQUIRED
751 * x2 %Coord; #REQUIRED
752 * y2 %Coord; #REQUIRED
753 * layer %Layer; #REQUIRED
754 * rot %Rotation; "R0"
755 * grouprefs IDREFS #IMPLIED
756 * >
757 */
762 int layer;
764
765 ERECT( wxXmlNode* aRect, IO_BASE* aIo = nullptr );
766};
767
768
769struct ESPLINE : public EAGLE_BASE
770{
771 /*
772 * <!ELEMENT spline (vertex)*>
773 * <!-- Four simple (non-curve) vertices define the control points of a degree-3
774 * spline curve -->
775 * <!ATTLIST spline
776 * width %Dimension; #REQUIRED
777 * >
778 */
779 std::vector<std::unique_ptr<EVERTEX>> vertices;
780 double width;
781
782 ESPLINE( wxXmlNode* aSpline, IO_BASE* aIo = nullptr );
783};
784
785
792struct EATTR : public EAGLE_BASE
793{
794 /*
795 * <!ELEMENT attribute EMPTY>
796 * <!ATTLIST attribute
797 * name %String; #REQUIRED
798 * value %String; #IMPLIED
799 * x %Coord; #IMPLIED
800 * y %Coord; #IMPLIED
801 * size %Dimension; #IMPLIED
802 * layer %Layer; #IMPLIED
803 * font %TextFont; #IMPLIED
804 * ratio %Int; #IMPLIED
805 * rot %Rotation; "R0"
806 * display %AttributeDisplay; "value"
807 * constant %Bool; "no"
808 * align %Align; "bottom-left"
809 * grouprefs IDREFS #IMPLIED
810 * >
811 * <!-- display: Only in <element> or <instance> context -->
812 * <!-- constant:Only in <device> context -->
813 */
814 wxString name;
823
824 enum { // for 'display'
829 };
830
834
835 // TODO add groupdefs
836
837 EATTR( wxXmlNode* aTree, IO_BASE* aIo = nullptr );
838 EATTR() {}
839};
840
841
843struct EDIMENSION : public EAGLE_BASE
844{
845 /*
846 * <!ELEMENT dimension EMPTY>
847 * <!ATTLIST dimension
848 * x1 %Coord; #REQUIRED
849 * y1 %Coord; #REQUIRED
850 * x2 %Coord; #REQUIRED
851 * y2 %Coord; #REQUIRED
852 * x3 %Coord; #REQUIRED
853 * y3 %Coord; #REQUIRED
854 * layer %Layer; #REQUIRED
855 * dtype %DimensionType; "parallel"
856 * width %Dimension; "0.13"
857 * extwidth %Dimension; "0"
858 * extlength %Dimension; "0"
859 * extoffset %Dimension; "0"
860 * textsize %Dimension; #REQUIRED
861 * textratio %Int; "8"
862 * unit %GridUnit; "mm"
863 * precision %Int; "2"
864 * visible %Bool; "no"
865 * grouprefs IDREFS #IMPLIED
866 * >
867 */
875 int layer;
885
886 // TODO add grouprefs
887
888 EDIMENSION( wxXmlNode* aDimension, IO_BASE* aIo = nullptr );
889};
890
891
893struct ETEXT : public EAGLE_BASE
894{
895 /*
896 * <!ELEMENT text (#PCDATA)>
897 * <!ATTLIST text
898 * x %Coord; #REQUIRED
899 * y %Coord; #REQUIRED
900 * size %Dimension; #REQUIRED
901 * layer %Layer; #REQUIRED
902 * font %TextFont; "proportional"
903 * ratio %Int; "8"
904 * rot %Rotation; "R0"
905 * align %Align; "bottom-left"
906 * distance %Int; "50"
907 * grouprefs IDREFS #IMPLIED
908 * >
909 */
910 wxString text;
914 int layer;
918
919 enum { // for align
925
926 // opposites are -1 x above, used by code tricks in here
931 };
932
935
936 // TODO add grouprefs
937
938 ETEXT( wxXmlNode* aText, IO_BASE* aIo = nullptr );
939
941 VECTOR2I ConvertSize() const;
942};
943
944
948struct EFRAME : public EAGLE_BASE
949{
950 /*
951 * <!ELEMENT frame EMPTY>
952 * <!ATTLIST frame
953 * x1 %Coord; #REQUIRED
954 * y1 %Coord; #REQUIRED
955 * x2 %Coord; #REQUIRED
956 * y2 %Coord; #REQUIRED
957 * columns %Int; #REQUIRED
958 * rows %Int; #REQUIRED
959 * layer %Layer; #REQUIRED
960 * border-left %Bool; "yes"
961 * border-top %Bool; "yes"
962 * border-right %Bool; "yes"
963 * border-bottom %Bool; "yes"
964 * grouprefs IDREFS #IMPLIED
965 * >
966 */
972 int rows;
973 int layer;
978
979 EFRAME( wxXmlNode* aFrameNode, IO_BASE* aIo = nullptr );
980};
981
982
984struct EPAD_COMMON : public EAGLE_BASE
985{
986 wxString name;
991
992 EPAD_COMMON( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
993};
994
995
997struct EPAD : public EPAD_COMMON
998{
999 /*
1000 * <!ELEMENT pad EMPTY>
1001 * <!ATTLIST pad
1002 * name %String; #REQUIRED
1003 * x %Coord; #REQUIRED
1004 * y %Coord; #REQUIRED
1005 * drill %Dimension; #REQUIRED
1006 * diameter %Dimension; "0"
1007 * shape %PadShape; "round"
1008 * rot %Rotation; "R0"
1009 * stop %Bool; "yes"
1010 * thermals %Bool; "yes"
1011 * first %Bool; "no"
1012 * >
1013 */
1016
1017 // for shape: (square | round | octagon | long | offset)
1018 enum {
1019 UNDEF = -1,
1025 };
1026
1029
1030 EPAD( wxXmlNode* aPad, IO_BASE* aIo = nullptr );
1031};
1032
1033
1035struct ESMD : public EPAD_COMMON
1036{
1037 /*
1038 * <!ELEMENT smd EMPTY>
1039 * <!ATTLIST smd
1040 * name %String; #REQUIRED
1041 * x %Coord; #REQUIRED
1042 * y %Coord; #REQUIRED
1043 * dx %Dimension; #REQUIRED
1044 * dy %Dimension; #REQUIRED
1045 * layer %Layer; #REQUIRED
1046 * roundness %Int; "0"
1047 * rot %Rotation; "R0"
1048 * stop %Bool; "yes"
1049 * thermals %Bool; "yes"
1050 * cream %Bool; "yes"
1051 * >
1052 */
1058
1059 ESMD( wxXmlNode* aSMD, IO_BASE* aIo = nullptr );
1060};
1061
1062
1064struct EPIN : public EAGLE_BASE
1065{
1066 /*
1067 * <!ELEMENT pin EMPTY>
1068 * <!ATTLIST pin
1069 * name %String; #REQUIRED
1070 * x %Coord; #REQUIRED
1071 * y %Coord; #REQUIRED
1072 * visible %PinVisible; "both"
1073 * length %PinLength; "long"
1074 * direction %PinDirection; "io"
1075 * function %PinFunction; "none"
1076 * swaplevel %Int; "0"
1077 * rot %Rotation; "R0"
1078 * >
1079 */
1080 wxString name;
1083
1090
1091 EPIN( wxXmlNode* aPin, IO_BASE* aIo = nullptr );
1092};
1093
1094
1096struct EPOLYGON : public EAGLE_BASE
1097{
1098 /*
1099 * <!ELEMENT polygon (vertex)*>
1100 * <!-- the vertices must define a valid polygon; if the last vertex is the same
1101 * as the first one, it is ignored -->
1102 * <!ATTLIST polygon
1103 * width %Dimension; #REQUIRED
1104 * layer %Layer; #REQUIRED
1105 * spacing %Dimension; #IMPLIED
1106 * pour %PolygonPour; "solid"
1107 * isolate %Dimension; #IMPLIED
1108 * orphans %Bool; "no"
1109 * thermals %Bool; "yes"
1110 * rank %Int; "0"
1111 * grouprefs IDREFS #IMPLIED
1112 * >
1113 * <!-- isolate: Only in <signal> or <package> context -->
1114 * <!-- orphans: Only in <signal> context -->
1115 * <!-- thermals:Only in <signal> context -->
1116 * <!-- rank: 1..6 in <signal> context, 0 or 7 in <package> context -->
1117 */
1121
1122 // KiCad priority is opposite of Eagle rank, that is:
1123 // - Eagle Low rank drawn first
1124 // - KiCad high priority drawn first
1125 // So since Eagle has an upper limit we define this, used for the cases
1126 // where no rank is specified.
1127 static const int max_priority = 6;
1128
1129 enum { // for pour
1133 };
1134
1135 int pour;
1140
1141 std::vector<std::unique_ptr<EVERTEX>> vertices;
1142
1143 // TODO add grouprefs
1144
1145 EPOLYGON( wxXmlNode* aPolygon, IO_BASE* aIo = nullptr );
1146};
1147
1148
1150struct EHOLE : public EAGLE_BASE
1151{
1152 /*
1153 * <!ELEMENT hole EMPTY>
1154 * <!ATTLIST hole
1155 * x %Coord; #REQUIRED
1156 * y %Coord; #REQUIRED
1157 * drill %Dimension; #REQUIRED
1158 * grouprefs IDREFS #IMPLIED
1159 * >
1160 */
1164
1165 EHOLE( wxXmlNode* aHole, IO_BASE* aIo = nullptr );
1166};
1167
1168
1169struct EVARIANT : public EAGLE_BASE
1170{
1171 /*
1172 * <!ELEMENT variant EMPTY>
1173 * <!ATTLIST variant
1174 * name %String; #REQUIRED
1175 * populate %Bool; "yes"
1176 * value %String; #IMPLIED
1177 * technology %String; #IMPLIED
1178 * >
1179 * <!-- technology: Only in part context -->
1180 */
1181 wxString name;
1185
1186 EVARIANT( wxXmlNode* aVariant, IO_BASE* aIo = nullptr );
1187};
1188
1189
1190struct EPINMAP : public EAGLE_BASE
1191{
1192 /*
1193 * <!ELEMENT pinmap EMPTY>
1194 * <!ATTLIST pinmap
1195 * gate %String; #REQUIRED
1196 * pin %String; #REQUIRED
1197 * pinorder %String; #REQUIRED
1198 * >
1199 */
1200 wxString gate;
1201 wxString pin;
1202 wxString pinorder;
1203
1204 EPINMAP( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1205};
1206
1207
1209{
1210 /*
1211 * <!ELEMENT pinmapping (pinmap+)>
1212 * <!ATTLIST pinmapping
1213 * isusermap %Bool; "no"
1214 * iddevicewide %Bool; "yes"
1215 * spiceprefix %String; ""
1216 * >
1217 */
1218 std::vector<std::unique_ptr<EPINMAP>> pinmaps;
1222
1223 EPINMAPPING( wxXmlNode* aPinMap, IO_BASE* aIo = nullptr );
1224};
1225
1226
1227struct EMODEL : public EAGLE_BASE
1228{
1229 /*
1230 * <!ELEMENT model (#PCDATA)>
1231 * <!ATTLIST model
1232 * name %String; #REQUIRED
1233 * >
1234 */
1235 wxString name;
1236 wxString model;
1237
1238 EMODEL( wxXmlNode* aModel, IO_BASE* aIo = nullptr );
1239};
1240
1241
1242struct ESPICE : public EAGLE_BASE
1243{
1244 /*
1245 * <!ELEMENT spice (pinmapping, model)>
1246 */
1247 std::unique_ptr<EPINMAPPING> pinmapping;
1248 std::unique_ptr<EMODEL> model;
1249
1250 ESPICE( wxXmlNode* aSpice, IO_BASE* aIo = nullptr );
1251};
1252
1253
1255struct EELEMENT : public EAGLE_BASE
1256{
1257 /*
1258 * <!ELEMENT element (attribute*, variant*)>
1259 * <!-- variant* is accepted only for compatibility with EAGLE 6.x files -->
1260 * <!ATTLIST element
1261 * name %String; #REQUIRED
1262 * library %String; #REQUIRED
1263 * library_urn %Urn; ""
1264 * package %String; #REQUIRED
1265 * package3d_urn %Urn; ""
1266 * override_package3d_urn %Urn; ""
1267 * override_package_urn %Urn; ""
1268 * override_locally_modified %Bool; "no"
1269 * value %String; #REQUIRED
1270 * x %Coord; #REQUIRED
1271 * y %Coord; #REQUIRED
1272 * locked %Bool; "no"
1273 * populate %Bool; "yes"
1274 * smashed %Bool; "no"
1275 * rot %Rotation; "R0"
1276 * grouprefs IDREFS #IMPLIED
1277 * >
1278 * <!-- library_urn: Only in parts from online libraries -->
1279 */
1280 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1281 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1282
1283 wxString name;
1284 wxString library;
1286 wxString package;
1290 wxString value;
1296
1297 // TODO add grouprefs
1298
1299 EELEMENT( wxXmlNode* aElement, IO_BASE* aIo = nullptr );
1300};
1301
1302
1303struct ELAYER : public EAGLE_BASE
1304{
1305 /*
1306 * <!ELEMENT layer EMPTY>
1307 * <!ATTLIST layer
1308 * number %Layer; #REQUIRED
1309 * name %String; #REQUIRED
1310 * color %Int; #REQUIRED
1311 * fill %Int; #REQUIRED
1312 * visible %Bool; "yes"
1313 * active %Bool; "yes"
1314 * >
1315 */
1317 wxString name;
1319 int fill;
1322
1323 ELAYER( wxXmlNode* aLayer, IO_BASE* aIo = nullptr );
1324};
1325
1326
1328{
1329 enum
1330 {
1331 TOP = 1,
1347 PADS = 17,
1348 VIAS = 18,
1359 TSTOP = 29,
1360 BSTOP = 30,
1365 TGLUE = 35,
1366 BGLUE = 36,
1367 TTEST = 37,
1368 BTEST = 38,
1375 HOLES = 45,
1381 TDOCU = 51,
1382 BDOCU = 52,
1383 NETS = 91,
1385 PINS = 93,
1387 NAMES = 95,
1389 INFO = 97,
1390 GUIDE = 98,
1392 USERLAYER2 = 161
1394};
1395
1396
1397struct EGATE : public EAGLE_BASE
1398{
1399 /*
1400 * <!ELEMENT gate EMPTY>
1401 * <!ATTLIST gate
1402 * name %String; #REQUIRED
1403 * symbol %String; #REQUIRED
1404 * x %Coord; #REQUIRED
1405 * y %Coord; #REQUIRED
1406 * addlevel %GateAddLevel; "next"
1407 * swaplevel %Int; "0"
1408 * >
1409 */
1410
1411 wxString name;
1412 wxString symbol;
1413
1416
1419
1420 enum
1421 {
1426 ALWAYS
1428
1429 EGATE( wxXmlNode* aGate, IO_BASE* aIo = nullptr );
1430};
1431
1432
1433struct EPART : public EAGLE_BASE
1434{
1435 /*
1436 * <!ELEMENT part (attribute*, variant*, spice?)>
1437 * <!ATTLIST part
1438 * name %String; #REQUIRED
1439 * library %String; #REQUIRED
1440 * library_urn %Urn; ""
1441 * deviceset %String; #REQUIRED
1442 * device %String; #REQUIRED
1443 * package3d_urn %Urn; ""
1444 * override_package3d_urn %Urn; ""
1445 * override_package_urn %Urn; ""
1446 * override_locally_modified %Bool; "no"
1447 * technology %String; ""
1448 * value %String; #IMPLIED
1449 * >
1450 * <!-- library_urn: Only in parts from online libraries -->
1451 */
1452 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1453 std::map<wxString, std::unique_ptr<EVARIANT>> variants;
1454 std::unique_ptr<ESPICE> spice;
1455
1456 wxString name;
1457 wxString library;
1459 wxString deviceset;
1460 wxString device;
1467
1468 EPART( wxXmlNode* aPart, IO_BASE* aIo = nullptr );
1469};
1470
1471
1472struct EINSTANCE : public EAGLE_BASE
1473{
1474 /*
1475 * <!ELEMENT instance (attribute)*>
1476 * <!ATTLIST instance
1477 * part %String; #REQUIRED
1478 * gate %String; #REQUIRED
1479 * x %Coord; #REQUIRED
1480 * y %Coord; #REQUIRED
1481 * smashed %Bool; "no"
1482 * rot %Rotation; "R0"
1483 * grouprefs IDREFS #IMPLIED
1484 * >
1485 * <!-- rot: Only 0, 90, 180 or 270 -->
1486 */
1487
1488 wxString part;
1489 wxString gate;
1494
1495 // TODO: add grouprefs
1496
1497 std::map<wxString, std::unique_ptr<EATTR>> attributes;
1498
1499 EINSTANCE( wxXmlNode* aInstance, IO_BASE* aIo = nullptr );
1500};
1501
1502
1503struct ECONNECT : public EAGLE_BASE
1504{
1505 /*
1506 * <!ELEMENT connect EMPTY>
1507 * <!ATTLIST connect
1508 * gate %String; #REQUIRED
1509 * pin %String; #REQUIRED
1510 * pad %String; #REQUIRED
1511 * route %ContactRoute; "all"
1512 * >
1513 */
1514 wxString gate;
1515 wxString pin;
1516 wxString pad;
1518
1519 ECONNECT( wxXmlNode* aConnect, IO_BASE* aIo = nullptr );
1520};
1521
1522
1524{
1525 /*
1526 * <!ELEMENT technology (attribute)*>
1527 * <!ATTLIST technology
1528 * name %String; #REQUIRED
1529 * >
1530 */
1531 wxString name;
1532
1533 std::vector<std::unique_ptr<EATTR>> attributes;
1534
1535 ETECHNOLOGY( wxXmlNode* aTechnology, IO_BASE* aIo = nullptr );
1536};
1537
1538
1540{
1541 /*
1542 * <!ELEMENT package3dinstance EMPTY>
1543 * <!ATTLIST package3dinstance
1544 * package3d_urn %Urn; #REQUIRED
1545 * >
1546 */
1548
1549 EPACKAGE3DINST( wxXmlNode* aPackage3dInst, IO_BASE* aIo = nullptr );
1550};
1551
1552
1553struct EDEVICE : public EAGLE_BASE
1554{
1555 /*
1556 * <!ELEMENT device (connects?, package3dinstances?, technologies?)>
1557 * <!ATTLIST device
1558 * name %String; ""
1559 * package %String; #IMPLIED
1560 * >
1561 */
1562 wxString name;
1564
1565 std::vector<std::unique_ptr<ECONNECT>> connects;
1566 std::vector < std::unique_ptr<EPACKAGE3DINST>> package3dinstances;
1567 std::vector < std::unique_ptr<ETECHNOLOGY>> technologies;
1568
1569 EDEVICE( wxXmlNode* aDevice, IO_BASE* aIo = nullptr );
1570};
1571
1572
1574{
1575 /*
1576 * <!ELEMENT deviceset (description?, gates, devices, spice?)>
1577 * <!ATTLIST deviceset
1578 * name %String; #REQUIRED
1579 * urn %Urn; ""
1580 * locally_modified %Bool; "no"
1581 * prefix %String; ""
1582 * uservalue %Bool; "no"
1583 * library_version %Int; ""
1584 * library_locally_modified %Bool; "no"
1585 * >
1586 * <!-- library_version and library_locally_modified: Only in managed libraries
1587 * inside boards or schematics -->
1588 */
1589
1590 wxString name;
1597
1598 std::optional<EDESCRIPTION> description;
1599 std::map<wxString, std::unique_ptr<EGATE>> gates;
1600 std::vector<std::unique_ptr<EDEVICE>> devices;
1601 std::optional<ESPICE> spice;
1602
1603 EDEVICE_SET( wxXmlNode* aDeviceSet, IO_BASE* aIo = nullptr );
1604};
1605
1606
1607struct ECLASS : public EAGLE_BASE
1608{
1609 /*
1610 * <!ELEMENT class (clearance)*>
1611 * <!ATTLIST class
1612 * number %Class; #REQUIRED
1613 * name %String; #REQUIRED
1614 * width %Dimension; "0"
1615 * drill %Dimension; "0"
1616 * >
1617 */
1618
1619 wxString number;
1620 wxString name;
1623
1624 std::map<wxString, ECOORD> clearanceMap;
1625
1626 ECLASS( wxXmlNode* aClass, IO_BASE* aIo = nullptr );
1627};
1628
1629
1630struct EPORT : public EAGLE_BASE
1631{
1632 /*
1633 * <!ELEMENT port EMPTY>
1634 * <!ATTLIST port
1635 * name %String; #REQUIRED
1636 * side %String; #REQUIRED
1637 * coord %Coord; #REQUIRED
1638 * direction %PortDirection; "io"
1639 * >
1640 *
1641 * The eagle.dtd is incorrect for the EPORT side attribute. It is not an integer, it is a
1642 * string that defines the side of the module rectangle the port is located. Valid values
1643 * are "top", "bottom", "right", and "left".
1644 */
1645 wxString name;
1646 wxString side;
1649
1650 EPORT( wxXmlNode* aPort, IO_BASE* aIo = nullptr );
1651};
1652
1653
1655{
1656 /*
1657 * <!ELEMENT variantdef EMPTY>
1658 * <!ATTLIST variantdef
1659 * name %String; #REQUIRED
1660 * current %Bool; "no"
1661 * >
1662 */
1663 wxString name;
1665
1666 EVARIANTDEF( wxXmlNode* aVariantDef, IO_BASE* aIo = nullptr );
1667};
1668
1669
1671{
1672 /*
1673 * <!ELEMENT schematic_group (attribute*, description?)>
1674 * <!ATTLIST schematic_group
1675 * name ID #REQUIRED
1676 * selectable %Bool; #IMPLIED
1677 * width %Dimension; #IMPLIED
1678 * titleSize %Dimension; #IMPLIED
1679 * titleFont %TextFont; #IMPLIED
1680 * style %WireStyle; #IMPLIED
1681 * showAnnotations %Bool; #IMPLIED
1682 * layer %Layer; #IMPLIED
1683 * grouprefs IDREFS #IMPLIED
1684 * >
1685 */
1686 wxString name;
1695
1696 std::optional<EDESCRIPTION> description;
1697 std::vector<std::unique_ptr<EATTR>> attributes;
1698
1699 ESCHEMATIC_GROUP( wxXmlNode* aSchematicGroup, IO_BASE* aIo = nullptr );
1700};
1701
1702
1703struct EPLAIN : public EAGLE_BASE
1704{
1705 /*
1706 * <!ELEMENT plain (polygon | wire | text | dimension | circle | spline | rectangle |
1707 * frame | hole)*>
1708 */
1709
1710 std::vector<std::unique_ptr<EPOLYGON>> polygons;
1711 std::vector<std::unique_ptr<EWIRE>> wires;
1712 std::vector<std::unique_ptr<ETEXT>> texts;
1713 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
1714 std::vector<std::unique_ptr<ECIRCLE>> circles;
1715 std::vector<std::unique_ptr<ESPLINE>> splines;
1716 std::vector<std::unique_ptr<ERECT>> rectangles;
1717 std::vector<std::unique_ptr<EFRAME>> frames;
1718 std::vector<std::unique_ptr<EHOLE>> holes;
1719
1720 EPLAIN( wxXmlNode* aPlain, IO_BASE* aIo = nullptr );
1721};
1722
1723
1725{
1726 /*
1727 * <!ELEMENT moduleinst (attribute)*>
1728 * <!ATTLIST moduleinst
1729 * name %String; #REQUIRED
1730 * module %String; #REQUIRED
1731 * modulevariant %String; ""
1732 * x %Coord; #REQUIRED
1733 * y %Coord; #REQUIRED
1734 * offset %Int; "0"
1735 * smashed %Bool; "no"
1736 * rot %Rotation; "R0"
1737 * >
1738 * <!-- rot: Only 0, 90, 180 or 270 -->
1739 */
1740
1741 wxString name;
1742 wxString moduleinst;
1749
1750 EMODULEINST( wxXmlNode* aModuleInst, IO_BASE* aIo = nullptr );
1751};
1752
1753
1754struct EPINREF : public EAGLE_BASE
1755{
1756 /*
1757 * <!ELEMENT pinref EMPTY>
1758 * <!ATTLIST pinref
1759 * part %String; #REQUIRED
1760 * gate %String; #REQUIRED
1761 * pin %String; #REQUIRED
1762 * >
1763 */
1764 wxString part;
1765 wxString gate;
1766 wxString pin;
1767
1768 EPINREF( wxXmlNode* aPinRef, IO_BASE* aIo = nullptr );
1769};
1770
1771
1772struct EPORTREF : public EAGLE_BASE
1773{
1774 /*
1775 * <!ELEMENT portref EMPTY>
1776 * <!ATTLIST portref
1777 * moduleinst %String; #REQUIRED
1778 * port %String; #REQUIRED
1779 * >
1780 */
1781 wxString moduleinst;
1782 wxString port;
1783
1784 EPORTREF( wxXmlNode* aPortRef, IO_BASE* aIo = nullptr );
1785};
1786
1787
1788struct EPROBE : public EAGLE_BASE
1789{
1790 /*
1791 * <!ELEMENT probe EMPTY>
1792 * <!ATTLIST probe
1793 * x %Coord; #REQUIRED
1794 * y %Coord; #REQUIRED
1795 * size %Dimension; #REQUIRED
1796 * layer %Layer; #REQUIRED
1797 * font %TextFont; "proportional"
1798 * ratio %Int; "8"
1799 * rot %Rotation; "R0"
1800 * xref %Bool; "no"
1801 * grouprefs IDREFS #IMPLIED
1802 * >
1803 * <!-- rot: Only 0, 90, 180 or 270 -->
1804 * <!-- xref: Only in <net> context -->
1805 */
1808 double size;
1814
1815 // TODO add grouprefs
1816
1817 EPROBE( wxXmlNode* aProbe, IO_BASE* aIo = nullptr );
1818};
1819
1820
1821struct ESEGMENT : public EAGLE_BASE
1822{
1823 /*
1824 * <!ELEMENT segment (pinref | portref | wire | junction | label | probe)*>
1825 * <!-- 'pinref' and 'junction' are only valid in a <net> context -->
1826 */
1827 std::vector<std::unique_ptr<EPINREF>> pinRefs;
1828 std::vector<std::unique_ptr<EPORTREF>> portRefs;
1829 std::vector<std::unique_ptr<EWIRE>> wires;
1830 std::vector<std::unique_ptr<EJUNCTION>> junctions;
1831 std::vector<std::unique_ptr<ELABEL>> labels;
1832 std::vector<std::unique_ptr<EPROBE>> probes;
1833
1834 ESEGMENT( wxXmlNode* aSegment, IO_BASE* aIo = nullptr );
1835};
1836
1837
1838struct EBUS : public EAGLE_BASE
1839{
1840 /*
1841 * <!ELEMENT bus (segment)*>
1842 * <!ATTLIST bus
1843 * name %String; #REQUIRED
1844 * >
1845 */
1846
1847 wxString name;
1848 std::vector<std::unique_ptr<ESEGMENT>> segments;
1849
1850 EBUS( wxXmlNode* aBus, IO_BASE* aIo = nullptr );
1851};
1852
1853
1854struct ESHEET : public EAGLE_BASE
1855{
1856 /*
1857 * <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
1858 */
1859
1861 std::unique_ptr<EPLAIN> plain;
1862 std::map<wxString, std::unique_ptr<EMODULEINST>> moduleinsts;
1863 std::vector<std::unique_ptr<EINSTANCE>> instances;
1864 std::vector<std::unique_ptr<EBUS>> busses;
1865 std::vector<std::unique_ptr<ENET>> nets;
1866
1867 ESHEET( wxXmlNode* aSheet, IO_BASE* aIo = nullptr );
1868};
1869
1870
1871struct EMODULE : public EAGLE_BASE
1872{
1873 /*
1874 * <!ELEMENT module (description?, ports?, variantdefs?, groups?, parts?, sheets?)>
1875 * <!ATTLIST module
1876 * name %String; #REQUIRED
1877 * prefix %String; ""
1878 * dx %Coord; #REQUIRED
1879 * dy %Coord; #REQUIRED
1880 * >
1881 */
1882 wxString name;
1886
1887 std::optional<EDESCRIPTION> description;
1888
1889 std::map<wxString, std::unique_ptr<EPORT>> ports;
1890 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
1891 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
1892 std::map<wxString, std::unique_ptr<EPART>> parts;
1893 std::vector<std::unique_ptr<ESHEET>> sheets;
1894
1895 EMODULE( wxXmlNode* aModule, IO_BASE* aIo = nullptr );
1896};
1897
1898
1899struct ENOTE : public EAGLE_BASE
1900{
1901 /*
1902 * <!ELEMENT note (#PCDATA)>
1903 * <!ATTLIST note
1904 * version %Real; #REQUIRED
1905 * severity %Severity; #REQUIRED
1906 * >
1907 * <!-- version: The EAGLE program version that introduced this compatibility note -->
1908 */
1909 double version;
1910 wxString severity;
1911 wxString note;
1912
1913 ENOTE( wxXmlNode* aNote, IO_BASE* aIo = nullptr );
1914};
1915
1916
1918{
1919 /*
1920 * <!ELEMENT compatibility (note)*>
1921 */
1922 std::vector<std::unique_ptr<ENOTE>> notes;
1923
1924 ECOMPATIBILITY( wxXmlNode* aCompatibility, IO_BASE* aIo = nullptr );
1925};
1926
1927
1928struct ESETTING : public EAGLE_BASE
1929{
1930 /*
1931 * <!ELEMENT setting EMPTY>
1932 * <!ATTLIST setting
1933 * alwaysvectorfont %Bool; #IMPLIED
1934 * verticaltext %VerticalText; "up"
1935 * keepoldvectorfont %Bool; "no"
1936 * >
1937 */
1941
1942 ESETTING( wxXmlNode* aSetting, IO_BASE* aIo = nullptr );
1943};
1944
1945
1946struct EGRID : public EAGLE_BASE
1947{
1948 /*
1949 * <!ELEMENT grid EMPTY>
1950 * <!ATTLIST grid
1951 * distance %Real; #IMPLIED
1952 * unitdist %GridUnit; #IMPLIED
1953 * unit %GridUnit; #IMPLIED
1954 * style %GridStyle; "lines"
1955 * multiple %Int; "1"
1956 * display %Bool; "no"
1957 * altdistance %Real; #IMPLIED
1958 * altunitdist %GridUnit; #IMPLIED
1959 * altunit %GridUnit; #IMPLIED
1960 * >
1961 */
1971
1972 EGRID( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
1973};
1974
1975
1976struct EFILTER : public EAGLE_BASE
1977{
1978 /*
1979 * <!ELEMENT filter EMPTY>
1980 * <!ATTLIST filter
1981 * name %String; #REQUIRED
1982 * expression %String; #REQUIRED
1983 * >
1984 */
1985 wxString name;
1986 wxString expression;
1987
1988 EFILTER( wxXmlNode* aGrid, IO_BASE* aIo = nullptr );
1989};
1990
1991
1992struct EPACKAGE : public EAGLE_BASE
1993{
1994 /*
1995 * <!ELEMENT package (description?, (polygon | wire | text | dimension | circle |
1996 * rectangle | frame | hole | pad | smd)*)>
1997 * <!ATTLIST package
1998 * name %String; #REQUIRED
1999 * urn %Urn; ""
2000 * locally_modified %Bool; "no"
2001 * library_version %Int; ""
2002 * library_locally_modified %Bool; "no"
2003 * >
2004 * <!-- library_version and library_locally_modified: Only in managed libraries
2005 * inside boards or schematics -->
2006 */
2007 wxString name;
2012
2013 std::optional<EDESCRIPTION> description;
2014 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2015 std::vector<std::unique_ptr<EWIRE>> wires;
2016 std::vector<std::unique_ptr<ETEXT>> texts;
2017 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2018 std::vector<std::unique_ptr<ECIRCLE>> circles;
2019 std::vector<std::unique_ptr<ERECT>> rectangles;
2020 std::vector<std::unique_ptr<EFRAME>> frames;
2021 std::vector<std::unique_ptr<EHOLE>> holes;
2022 std::vector<std::unique_ptr<EPAD>> thtpads;
2023 std::vector<std::unique_ptr<ESMD>> smdpads;
2024
2025 EPACKAGE( wxXmlNode* aPackage, IO_BASE* aIo = nullptr );
2026};
2027
2028
2030{
2031 /*
2032 * <!ELEMENT packageinstance EMPTY>
2033 * <!ATTLIST packageinstance
2034 * name %String; #REQUIRED
2035 * >
2036 */
2037 wxString name;
2038
2039 EPACKAGEINSTANCE( wxXmlNode* aPackageInstance, IO_BASE* aIo = nullptr );
2040};
2041
2042
2043struct EPACKAGE3D : public EAGLE_BASE
2044{
2045 /*
2046 * <!ELEMENT package3d (description?, packageinstances?)>
2047 * <!ATTLIST package3d
2048 * name %String; ""
2049 * urn %Urn; #REQUIRED
2050 * type %Package3dType; #REQUIRED
2051 * library_version %Int; ""
2052 * library_locally_modified %Bool; "no"
2053 * >
2054 * <!-- library_version and library_locally_modified: Only in managed libraries
2055 * inside boards or schematics -->
2056 */
2057 wxString name;
2058 wxString urn;
2059 wxString type;
2062
2063 std::optional<EDESCRIPTION> description;
2064 std::vector<std::unique_ptr<EPACKAGEINSTANCE>> packageinstances;
2065
2066 EPACKAGE3D( wxXmlNode* aPackage3d, IO_BASE* aIo = nullptr );
2067};
2068
2069
2070struct ESYMBOL : public EAGLE_BASE
2071{
2072 /*
2073 * <!ELEMENT symbol (description?, (polygon | wire | text | dimension | pin | circle |
2074 * rectangle | frame)*)>
2075 * <!ATTLIST symbol
2076 * name %String; #REQUIRED
2077 * urn %Urn; ""
2078 * locally_modified %Bool; "no"
2079 * library_version %Int; ""
2080 * library_locally_modified %Bool; "no"
2081 * >
2082 * <!-- library_version and library_locally_modified: Only in managed libraries
2083 * inside boards or schematics -->
2084 */
2085
2086 wxString name;
2091
2092 std::optional<EDESCRIPTION> description;
2093 std::vector<std::unique_ptr<EPOLYGON>> polygons;
2094 std::vector<std::unique_ptr<EWIRE>> wires;
2095 std::vector<std::unique_ptr<ETEXT>> texts;
2096 std::vector<std::unique_ptr<EDIMENSION>> dimensions;
2097 std::vector<std::unique_ptr<EPIN>> pins;
2098 std::vector<std::unique_ptr<ECIRCLE>> circles;
2099 std::vector<std::unique_ptr<ERECT>> rectangles;
2100 std::vector<std::unique_ptr<EFRAME>> frames;
2101
2102 ESYMBOL( wxXmlNode* aSymbol, IO_BASE* aIo = nullptr );
2103};
2104
2105
2106struct ELIBRARY : public EAGLE_BASE
2107{
2108 /*
2109 * <!ELEMENT library (description?, packages?, packages3d?, symbols?, devicesets?)>
2110 * <!ATTLIST library
2111 * name %String; #REQUIRED
2112 * urn %Urn; ""
2113 * >
2114 * <!-- name: Only in libraries used inside boards or schematics -->
2115 * <!-- urn: Only in online libraries used inside boards or schematics -->
2116 */
2117 wxString name;
2119
2120 std::optional<EDESCRIPTION> description;
2121 std::map<wxString, std::unique_ptr<EPACKAGE>> packages;
2122 std::map<wxString, std::unique_ptr<EPACKAGE3D>> packages3d;
2123 std::map<wxString, std::unique_ptr<ESYMBOL>> symbols;
2124 std::map<wxString, std::unique_ptr<EDEVICE_SET>> devicesets;
2125
2126 ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo = nullptr );
2127};
2128
2129
2130struct EAPPROVED : public EAGLE_BASE
2131{
2132 /*
2133 * <!ELEMENT approved EMPTY>
2134 * <!ATTLIST approved
2135 * hash %String; #REQUIRED
2136 * >
2137 */
2138 wxString hash;
2139
2140 EAPPROVED( wxXmlNode* aApproved, IO_BASE* aIo = nullptr );
2141};
2142
2143
2144struct ESCHEMATIC : public EAGLE_BASE
2145{
2146 /*
2147 * <!ELEMENT schematic (description?, libraries?, attributes?, variantdefs?, classes?,
2148 * modules?, groups?, parts?, sheets?, errors?)>
2149 * <!ATTLIST schematic
2150 * xreflabel %String; #IMPLIED
2151 * xrefpart %String; #IMPLIED
2152 * >
2153 */
2156
2157 std::optional<EDESCRIPTION> description;
2158 std::map<wxString, std::unique_ptr<ELIBRARY>> libraries;
2159 std::map<wxString, std::unique_ptr<EATTR>> attributes;
2160 std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
2161 std::map<wxString, std::unique_ptr<ECLASS>> classes;
2162 std::map<wxString, std::unique_ptr<EMODULE>> modules;
2163 std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
2164 std::map<wxString, std::unique_ptr<EPART>> parts;
2165 std::vector<std::unique_ptr<ESHEET>> sheets;
2166 std::vector<std::unique_ptr<EAPPROVED>> errors;
2167
2168 ESCHEMATIC( wxXmlNode* aSchematic, IO_BASE* aIo = nullptr );
2169};
2170
2171
2172struct EDRAWING : public EAGLE_BASE
2173{
2174 /*
2175 * <!ELEMENT drawing (settings?, grid?, filters?, layers, (library | schematic | board))>
2176 */
2177 std::vector<std::unique_ptr<ESETTING>> settings;
2178 std::optional<EGRID> grid;
2179 std::vector<std::unique_ptr<EFILTER>> filters;
2180 std::vector<std::unique_ptr<ELAYER>> layers;
2181 std::optional<ESCHEMATIC> schematic;
2182 std::optional<ELIBRARY> library;
2183 // std::optional<std::unique_ptr<EBOARD>> board;
2184
2185 EDRAWING( wxXmlNode* aDrawing, IO_BASE* aIo = nullptr );
2186};
2187
2188
2189struct EAGLE_DOC : public EAGLE_BASE
2190{
2191 /*
2192 * <!ELEMENT eagle (compatibility?, drawing, compatibility?)>
2193 * <!ATTLIST eagle
2194 * version %Real; #REQUIRED
2195 * >
2196 * <!-- version: The EAGLE program version that generated this file, in the
2197 * form V.RR -->
2198 */
2199
2207 wxString version;
2208
2209 std::unique_ptr<EDRAWING> drawing;
2210 std::optional<ECOMPATIBILITY> compatibility;
2211
2212 EAGLE_DOC( wxXmlNode* aEagleDoc, IO_BASE* aIo = nullptr );
2213};
2214
2215
2216#endif // _EAGLE_PARSER_H_
Model an optional XML attribute.
Definition: eagle_parser.h:202
bool operator==(const T &aOther) const
Definition: eagle_parser.h:284
const T * operator->() const
Return a constant pointer to the value of the attribute assuming it is available.
Definition: eagle_parser.h:357
OPTIONAL_XML_ATTRIBUTE< T > & operator=(const wxString &aData)
Assign to a string (optionally) containing the data.
Definition: eagle_parser.h:257
T * operator->()
Return a pointer to the value of the attribute assuming it is available.
Definition: eagle_parser.h:347
const T & operator*() const
Return a constant reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:337
OPTIONAL_XML_ATTRIBUTE(const wxString &aData)
Definition: eagle_parser.h:224
bool m_isAvailable
A boolean indicating if the data is present or not.
Definition: eagle_parser.h:205
const T & CGet() const
Return a constant reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:316
T m_data
The actual data if m_isAvailable is true; otherwise, garbage.
Definition: eagle_parser.h:208
void Set(const wxString &aString)
Attempt to convert a string to the base type.
Definition: eagle_parser.h:294
T & operator*()
Return a reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:327
T & Get()
Return a reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:305
OPTIONAL_XML_ATTRIBUTE(T aData)
Definition: eagle_parser.h:238
OPTIONAL_XML_ATTRIBUTE()
Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
Definition: eagle_parser.h:214
Keep track of what we are working on within a PTREE.
Definition: eagle_parser.h:124
void pop()
Definition: eagle_parser.h:135
void clear()
Definition: eagle_parser.h:133
void Value(const char *aValue)
modify the last path node's value
Definition: eagle_parser.h:138
std::vector< TRIPLET > p
Definition: eagle_parser.h:125
void Attribute(const char *aAttribute)
modify the last path node's attribute
Definition: eagle_parser.h:144
void push(const char *aPathSegment, const char *aAttribute="")
Definition: eagle_parser.h:128
wxString Contents()
return the contents of the XPATH as a single string
Definition: eagle_parser.h:150
OPTIONAL_XML_ATTRIBUTE< ECOORD > opt_ecoord
Definition: eagle_parser.h:395
T Convert(const wxString &aValue)
Convert a wxString to a generic type T.
Definition: eagle_parser.h:186
OPTIONAL_XML_ATTRIBUTE< int > opt_int
Definition: eagle_parser.h:391
static wxXmlNode * getChildrenNodes(NODE_MAP &aMap, const wxString &aName)
Definition: eagle_parser.h:70
NODE_MAP MapChildren(wxXmlNode *aCurrentNode)
Provide an easy access to the children of an XML node via their names.
OPTIONAL_XML_ATTRIBUTE< EROT > opt_erot
Definition: eagle_parser.h:394
wxString escapeName(const wxString &aNetName)
Interprets special characters in Eagle text and converts them to KiCAD notation.
wxString interpretText(const wxString &aText)
Translates Eagle special text reference to a KiCad variable reference.
bool substituteVariable(wxString *aText)
Converts Eagle's HTML description into KiCad description format.
wxString Convert< wxString >(const wxString &aValue)
size_t GetNodeCount(const wxXmlNode *aNode)
Fetch the number of XML nodes within aNode.
OPTIONAL_XML_ATTRIBUTE< wxString > opt_wxString
Definition: eagle_parser.h:390
std::map< wxString, EINSTANCE * > EINSTANCE_MAP
Definition: eagle_parser.h:55
std::unordered_map< wxString, wxXmlNode * > NODE_MAP
Definition: eagle_parser.h:54
OPTIONAL_XML_ATTRIBUTE< bool > opt_bool
Definition: eagle_parser.h:393
OPTIONAL_XML_ATTRIBUTE< double > opt_double
Definition: eagle_parser.h:392
VECTOR2I ConvertArcCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle)
wxString convertDescription(wxString aDescr)
std::map< wxString, std::unique_ptr< EPART > > EPART_MAP
Translates Eagle special characters to their counterparts in KiCad.
Definition: eagle_parser.h:56
SEVERITY
@ RPT_SEVERITY_UNDEFINED
EAGLE_BASE(IO_BASE *aIo=nullptr)
Definition: eagle_parser.h:400
IO_BASE * io
Definition: eagle_parser.h:403
void AdvanceProgressPhase()
void Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
std::optional< ECOMPATIBILITY > compatibility
wxString version
The Eagle XML file version.
std::unique_ptr< EDRAWING > drawing
wxString hash
Parse an Eagle "attribute" XML element.
Definition: eagle_parser.h:793
opt_wxString font
Definition: eagle_parser.h:820
opt_double ratio
Definition: eagle_parser.h:821
opt_wxString value
Definition: eagle_parser.h:815
opt_ecoord size
Definition: eagle_parser.h:818
opt_ecoord y
Definition: eagle_parser.h:817
wxString name
Definition: eagle_parser.h:814
opt_erot rot
Definition: eagle_parser.h:822
opt_int align
Definition: eagle_parser.h:833
opt_int display
Definition: eagle_parser.h:832
opt_ecoord x
Definition: eagle_parser.h:816
opt_bool constant
Definition: eagle_parser.h:831
opt_int layer
Definition: eagle_parser.h:819
wxString name
std::vector< std::unique_ptr< ESEGMENT > > segments
Eagle circle.
Definition: eagle_parser.h:719
ECOORD x
Definition: eagle_parser.h:731
ECOORD radius
Definition: eagle_parser.h:733
ECOORD y
Definition: eagle_parser.h:732
ECOORD width
Definition: eagle_parser.h:734
wxString number
opt_ecoord drill
std::map< wxString, ECOORD > clearanceMap
opt_ecoord width
wxString name
std::vector< std::unique_ptr< ENOTE > > notes
opt_wxString contactroute
wxString pad
wxString gate
wxString pin
int ToNanoMeters() const
Definition: eagle_parser.h:478
ECOORD operator+(const ECOORD &aOther) const
Definition: eagle_parser.h:491
@ EU_NM
nanometers
Definition: eagle_parser.h:444
@ EU_MM
millimeters
Definition: eagle_parser.h:445
@ EU_MIL
mils/thous
Definition: eagle_parser.h:447
@ EU_INCH
inches
Definition: eagle_parser.h:446
int ToSchUnits() const
Definition: eagle_parser.h:488
float ToMm() const
Definition: eagle_parser.h:483
ECOORD operator-(const ECOORD &aOther) const
Definition: eagle_parser.h:496
int ToMils() const
Definition: eagle_parser.h:468
int To100NanoMeters() const
Definition: eagle_parser.h:473
ECOORD(int aValue, enum EAGLE_UNIT aUnit)
Definition: eagle_parser.h:461
long long int value
Unit used for the value field.
Definition: eagle_parser.h:451
bool operator==(const ECOORD &aOther) const
Converts a size expressed in a certain unit to nanometers.
Definition: eagle_parser.h:501
static long long int ConvertToNm(int aValue, enum EAGLE_UNIT aUnit)
int ToPcbUnits() const
Definition: eagle_parser.h:489
static constexpr EAGLE_UNIT ECOORD_UNIT
Definition: eagle_parser.h:454
opt_wxString language
Definition: eagle_parser.h:433
wxString text
Definition: eagle_parser.h:432
opt_bool uservalue
opt_bool library_locally_modified
std::vector< std::unique_ptr< EDEVICE > > devices
opt_bool locally_modified
std::optional< EDESCRIPTION > description
opt_int library_version
opt_wxString prefix
opt_wxString urn
std::map< wxString, std::unique_ptr< EGATE > > gates
std::optional< ESPICE > spice
wxString name
std::vector< std::unique_ptr< EPACKAGE3DINST > > package3dinstances
wxString name
std::vector< std::unique_ptr< ECONNECT > > connects
opt_wxString package
std::vector< std::unique_ptr< ETECHNOLOGY > > technologies
Eagle dimension element.
Definition: eagle_parser.h:844
opt_double extwidth
Definition: eagle_parser.h:878
opt_int precision
Definition: eagle_parser.h:883
opt_wxString dimensionType
Definition: eagle_parser.h:876
opt_int textratio
Definition: eagle_parser.h:881
opt_double width
Definition: eagle_parser.h:877
opt_double extoffset
Definition: eagle_parser.h:880
opt_ecoord textsize
Definition: eagle_parser.h:874
opt_double extlength
Definition: eagle_parser.h:879
opt_wxString unit
Definition: eagle_parser.h:882
opt_bool visible
Definition: eagle_parser.h:884
std::optional< ESCHEMATIC > schematic
std::optional< ELIBRARY > library
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
Eagle element element.
opt_erot rot
wxString name
wxString library
opt_wxString library_urn
wxString package
opt_wxString package3d_urn
ECOORD y
opt_bool smashed
opt_wxString override_package3d_urn
ECOORD x
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
wxString expression
wxString name
Parse an Eagle frame element.
Definition: eagle_parser.h:949
ECOORD x1
Definition: eagle_parser.h:967
opt_bool border_bottom
Definition: eagle_parser.h:977
opt_bool border_left
Definition: eagle_parser.h:974
opt_bool border_right
Definition: eagle_parser.h:976
ECOORD y1
Definition: eagle_parser.h:968
int layer
Definition: eagle_parser.h:973
opt_bool border_top
Definition: eagle_parser.h:975
int columns
Definition: eagle_parser.h:971
ECOORD y2
Definition: eagle_parser.h:970
int rows
Definition: eagle_parser.h:972
ECOORD x2
Definition: eagle_parser.h:969
opt_int swaplevel
ECOORD x
ECOORD y
wxString symbol
wxString name
opt_int addlevel
opt_wxString style
opt_int multiple
opt_wxString unit
opt_bool display
opt_wxString altunit
opt_wxString unitdist
opt_wxString altunitdist
opt_double altdistance
opt_double distance
Eagle hole element.
ECOORD y
ECOORD drill
ECOORD x
wxString part
std::map< wxString, std::unique_ptr< EATTR > > attributes
opt_erot rot
wxString gate
opt_bool smashed
Eagle Junction.
Definition: eagle_parser.h:632
ECOORD y
Definition: eagle_parser.h:643
ECOORD x
Definition: eagle_parser.h:642
Eagle label.
Definition: eagle_parser.h:651
opt_erot rot
Definition: eagle_parser.h:676
opt_wxString font
Definition: eagle_parser.h:674
opt_int ratio
Definition: eagle_parser.h:675
ECOORD size
Definition: eagle_parser.h:672
opt_wxString align
Definition: eagle_parser.h:678
opt_bool xref
Definition: eagle_parser.h:677
int layer
Definition: eagle_parser.h:673
ECOORD y
Definition: eagle_parser.h:671
ECOORD x
Definition: eagle_parser.h:670
wxString name
opt_bool visible
opt_bool active
int number
std::map< wxString, std::unique_ptr< EDEVICE_SET > > devicesets
std::map< wxString, std::unique_ptr< EPACKAGE3D > > packages3d
std::map< wxString, std::unique_ptr< EPACKAGE > > packages
wxString name
std::optional< EDESCRIPTION > description
opt_wxString urn
std::map< wxString, std::unique_ptr< ESYMBOL > > symbols
wxString name
wxString model
opt_bool smashed
wxString name
opt_erot rotation
opt_int offset
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
opt_wxString prefix
std::map< wxString, std::unique_ptr< EVARIANTDEF > > variantdefs
ECOORD dx
wxString name
std::map< wxString, std::unique_ptr< EPORT > > ports
Eagle net.
Definition: eagle_parser.h:513
int netcode
Definition: eagle_parser.h:522
wxString netname
Definition: eagle_parser.h:521
std::vector< std::unique_ptr< ESEGMENT > > segments
Definition: eagle_parser.h:524
ENET(int aNetCode, const wxString &aNetName)
Definition: eagle_parser.h:526
wxString note
double version
wxString severity
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
wxString urn
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
opt_wxString urn
opt_bool locally_modified
Structure holding common properties for through-hole and SMD pads.
Definition: eagle_parser.h:985
opt_bool thermals
Definition: eagle_parser.h:990
opt_bool stop
Definition: eagle_parser.h:989
wxString name
Definition: eagle_parser.h:986
opt_erot rot
Definition: eagle_parser.h:988
Eagle thru hole pad.
Definition: eagle_parser.h:998
ECOORD drill
opt_ecoord diameter
opt_bool first
opt_int shape
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_wxString override_package3d_urn
opt_wxString libraryUrn
wxString deviceset
opt_wxString package3d_urn
opt_wxString value
std::map< wxString, std::unique_ptr< EVARIANT > > variants
wxString name
opt_bool iddevicewide
opt_wxString spiceprefix
opt_bool isusermap
std::vector< std::unique_ptr< EPINMAP > > pinmaps
wxString pinorder
wxString gate
wxString pin
wxString gate
wxString pin
wxString part
Eagle pin element.
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
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
Eagle polygon, without vertices which are parsed as needed.
opt_bool orphans
opt_int rank
opt_bool thermals
opt_ecoord spacing
static const int max_priority
std::vector< std::unique_ptr< EVERTEX > > vertices
ECOORD width
opt_ecoord isolate
wxString port
wxString moduleinst
opt_wxString direction
wxString name
wxString side
ECOORD coord
double size
ECOORD y
opt_erot rot
opt_wxString font
ECOORD x
opt_bool xref
Eagle XML rectangle in binary.
Definition: eagle_parser.h:745
ECOORD x2
Definition: eagle_parser.h:760
ECOORD y1
Definition: eagle_parser.h:759
opt_erot rot
Definition: eagle_parser.h:763
int layer
Definition: eagle_parser.h:762
ECOORD y2
Definition: eagle_parser.h:761
ECOORD x1
Definition: eagle_parser.h:758
Eagle rotation.
Definition: eagle_parser.h:541
double degrees
Definition: eagle_parser.h:544
bool spin
Definition: eagle_parser.h:543
EROT(double aDegrees)
Definition: eagle_parser.h:552
bool mirror
Definition: eagle_parser.h:542
std::vector< std::unique_ptr< EATTR > > attributes
opt_bool showAnnotations
std::optional< EDESCRIPTION > description
opt_wxString titleFont
opt_wxString grouprefs
opt_wxString wireStyle
opt_ecoord titleSize
opt_ecoord width
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
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
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
std::unique_ptr< EPLAIN > plain
std::vector< std::unique_ptr< ENET > > nets
std::vector< std::unique_ptr< EBUS > > busses
opt_wxString description
std::vector< std::unique_ptr< EINSTANCE > > instances
std::map< wxString, std::unique_ptr< EMODULEINST > > moduleinsts
Eagle SMD pad.
opt_int roundness
ECOORD dx
int layer
opt_bool cream
ECOORD dy
std::unique_ptr< EMODEL > model
std::unique_ptr< EPINMAPPING > pinmapping
std::vector< std::unique_ptr< EVERTEX > > vertices
Definition: eagle_parser.h:779
double width
Definition: eagle_parser.h:780
std::vector< std::unique_ptr< EFRAME > > frames
opt_wxString urn
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
std::vector< std::unique_ptr< ERECT > > rectangles
std::vector< std::unique_ptr< EWIRE > > wires
opt_bool locally_modified
wxString name
std::vector< std::unique_ptr< EDIMENSION > > dimensions
wxString name
std::vector< std::unique_ptr< EATTR > > attributes
Eagle text element.
Definition: eagle_parser.h:894
opt_double ratio
Definition: eagle_parser.h:916
@ BOTTOM_CENTER
Definition: eagle_parser.h:928
@ BOTTOM_RIGHT
Definition: eagle_parser.h:930
@ TOP_CENTER
Definition: eagle_parser.h:922
@ TOP_LEFT
Definition: eagle_parser.h:923
@ TOP_RIGHT
Definition: eagle_parser.h:924
@ CENTER_RIGHT
Definition: eagle_parser.h:927
@ CENTER_LEFT
Definition: eagle_parser.h:921
@ BOTTOM_LEFT
Definition: eagle_parser.h:929
wxString text
Definition: eagle_parser.h:910
ECOORD y
Definition: eagle_parser.h:912
opt_int distance
Definition: eagle_parser.h:934
ECOORD size
Definition: eagle_parser.h:913
opt_erot rot
Definition: eagle_parser.h:917
opt_int align
Definition: eagle_parser.h:933
ECOORD x
Definition: eagle_parser.h:911
VECTOR2I ConvertSize() const
Calculate text size based on font type and size.
opt_wxString font
Definition: eagle_parser.h:915
int layer
Definition: eagle_parser.h:914
opt_bool current
wxString name
opt_bool populate
opt_wxString technology
wxString name
opt_wxString value
Eagle vertex.
Definition: eagle_parser.h:562
ECOORD y
Definition: eagle_parser.h:573
ECOORD x
Definition: eagle_parser.h:572
opt_double curve
range is -359.9..359.9
Definition: eagle_parser.h:574
Eagle via.
Definition: eagle_parser.h:688
opt_ecoord diam
Definition: eagle_parser.h:707
ECOORD drill
< inclusive
Definition: eagle_parser.h:706
ECOORD y
Definition: eagle_parser.h:703
opt_wxString shape
Definition: eagle_parser.h:708
int layer_front_most
Definition: eagle_parser.h:704
int layer_back_most
< extent
Definition: eagle_parser.h:705
ECOORD x
Definition: eagle_parser.h:702
opt_bool alwaysStop
Definition: eagle_parser.h:709
Eagle wire.
Definition: eagle_parser.h:582
ECOORD width
Definition: eagle_parser.h:605
int layer
Definition: eagle_parser.h:606
opt_wxString extent
Definition: eagle_parser.h:614
ECOORD x2
Definition: eagle_parser.h:603
opt_int cap
Definition: eagle_parser.h:622
@ LONGDASH
Definition: eagle_parser.h:610
@ CONTINUOUS
Definition: eagle_parser.h:609
@ SHORTDASH
Definition: eagle_parser.h:611
opt_int style
Definition: eagle_parser.h:615
ECOORD y2
Definition: eagle_parser.h:604
ECOORD x1
Definition: eagle_parser.h:601
ECOORD y1
Definition: eagle_parser.h:602
opt_double curve
range is -359.9..359.9
Definition: eagle_parser.h:616
segment (element) of our XPATH into the Eagle XML document tree in PTREE form.
Definition: eagle_parser.h:97
TRIPLET(const char *aElement, const char *aAttribute="", const char *aValue="")
Definition: eagle_parser.h:102
const char * value
Definition: eagle_parser.h:100
const char * attribute
Definition: eagle_parser.h:99
const char * element
Definition: eagle_parser.h:98
Implement a simple wrapper around runtime_error to isolate the errors thrown by the Eagle XML parser.
Definition: eagle_parser.h:82
XML_PARSER_ERROR(const wxString &aMessage) noexcept
Build an XML error by just calling its parent class constructor, std::runtime_error,...
Definition: eagle_parser.h:89