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 <unordered_map>
35
36#include <wx/xml/xml.h>
37#include <wx/string.h>
38#include <wx/filename.h>
39
40#include <layer_ids.h>
41#include <trigo.h>
42#include <core/wx_stl_compat.h>
43
44class FOOTPRINT;
45struct EINSTANCE;
46struct EPART;
47struct ETEXT;
48
49typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
50typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
51typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
52
54wxString escapeName( const wxString& aNetName );
55
57wxString interpretText( const wxString& aText );
58
60bool substituteVariable( wxString* aText );
61
62static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
63{
64 auto it = aMap.find( aName );
65 return it == aMap.end() ? nullptr : it->second->GetChildren();
66}
67
68
73struct XML_PARSER_ERROR : std::runtime_error
74{
81 XML_PARSER_ERROR( const wxString& aMessage ) noexcept :
82 std::runtime_error( "XML parser failed - " + aMessage.ToStdString() )
83 {}
84};
85
86
88struct TRIPLET
89{
90 const char* element;
91 const char* attribute;
92 const char* value;
93
94 TRIPLET( const char* aElement, const char* aAttribute = "", const char* aValue = "" ) :
95 element( aElement ),
96 attribute( aAttribute ),
97 value( aValue )
98 {}
99};
100
101
115class XPATH
116{
117 std::vector<TRIPLET> p;
118
119public:
120 void push( const char* aPathSegment, const char* aAttribute="" )
121 {
122 p.emplace_back( aPathSegment, aAttribute );
123 }
124
125 void clear() { p.clear(); }
126
127 void pop() { p.pop_back(); }
128
130 void Value( const char* aValue )
131 {
132 p.back().value = aValue;
133 }
134
136 void Attribute( const char* aAttribute )
137 {
138 p.back().attribute = aAttribute;
139 }
140
142 wxString Contents()
143 {
144 typedef std::vector<TRIPLET>::const_iterator CITER_TRIPLET;
145
146 wxString ret;
147
148 for( CITER_TRIPLET it = p.begin(); it != p.end(); ++it )
149 {
150 if( it != p.begin() )
151 ret += '.';
152
153 ret += it->element;
154
155 if( it->attribute[0] && it->value[0] )
156 {
157 ret += '[';
158 ret += it->attribute;
159 ret += '=';
160 ret += it->value;
161 ret += ']';
162 }
163 }
164
165 return ret;
166 }
167};
168
169
177template<typename T>
178T Convert( const wxString& aValue )
179{
180 throw XML_PARSER_ERROR( "Conversion failed. Unknown type." );
181}
182
183template <>
184wxString Convert<wxString>( const wxString& aValue );
185
192template <typename T>
194{
195private:
198
201
202public:
207 m_isAvailable( false ),
208 m_data( T() )
209 {}
210
216 OPTIONAL_XML_ATTRIBUTE( const wxString& aData )
217 {
218 m_data = T();
219 m_isAvailable = !aData.IsEmpty();
220
221 if( m_isAvailable )
222 Set( aData );
223 }
224
229 template<typename V = T>
231 m_isAvailable( true ),
232 m_data( aData )
233 {}
234
238 operator bool() const
239 {
240 return m_isAvailable;
241 }
242
249 OPTIONAL_XML_ATTRIBUTE<T>& operator =( const wxString& aData )
250 {
251 m_isAvailable = !aData.IsEmpty();
252
253 if( m_isAvailable )
254 Set( aData );
255
256 return *this;
257 }
258
266 {
267 m_data = aData;
268 m_isAvailable = true;
269
270 return *this;
271 }
272
276 bool operator ==( const T& aOther ) const
277 {
278 return m_isAvailable && ( aOther == m_data );
279 }
280
286 void Set( const wxString& aString )
287 {
288 m_data = Convert<T>( aString );
289 m_isAvailable = !aString.IsEmpty();
290 }
291
297 T& Get()
298 {
299 assert( m_isAvailable );
300 return m_data;
301 }
302
308 const T& CGet() const
309 {
310 assert( m_isAvailable );
311 return m_data;
312 }
313
320 {
321 return Get();
322 }
323
329 const T& operator*() const
330 {
331 return CGet();
332 }
333
340 {
341 return &Get();
342 }
343
349 const T* operator->() const
350 {
351 return &CGet();
352 }
353};
354
355
363NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
364
366VECTOR2I ConvertArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle );
367
368// Pre-declare for typedefs
369struct EROT;
370struct ECOORD;
377
378
379// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
380// For maintenance and troubleshooting purposes, it was thought that we'd need to
381// separate the conversion process into distinct steps. There is no intent to have KiCad
382// forms of information in these 'E'STRUCTS. They are only binary forms
383// of the Eagle information in the corresponding Eagle XML nodes.
384
385// Eagle coordinates
386struct ECOORD
387{
389 {
394 };
395
397 long long int value;
398
400 static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
401
403 : value( 0 )
404 {
405 }
406
407 ECOORD( int aValue, enum EAGLE_UNIT aUnit )
408 : value( ConvertToNm( aValue, aUnit ) )
409 {
410 }
411
412 ECOORD( const wxString& aValue, enum EAGLE_UNIT aUnit );
413
414 int ToMils() const
415 {
416 return value / 25400;
417 }
418
419 int To100NanoMeters() const
420 {
421 return value / 100;
422 }
423
424 int ToNanoMeters() const
425 {
426 return value;
427 }
428
429 float ToMm() const
430 {
431 return value / 1000000.0;
432 }
433
434 int ToSchUnits() const { return To100NanoMeters(); }
435 int ToPcbUnits() const { return ToNanoMeters(); }
436
437 ECOORD operator+( const ECOORD& aOther ) const
438 {
439 return ECOORD( value + aOther.value, ECOORD_UNIT );
440 }
441
442 ECOORD operator-( const ECOORD& aOther ) const
443 {
444 return ECOORD( value - aOther.value, ECOORD_UNIT );
445 }
446
447 bool operator==( const ECOORD& aOther ) const
448 {
449 return value == aOther.value;
450 }
451
453 static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
454};
455
456
458struct ENET
459{
461 wxString netname;
462
463 ENET( int aNetCode, const wxString& aNetName ) :
464 netcode( aNetCode ),
465 netname( aNetName )
466 {}
467
469 netcode( 0 )
470 {}
471};
472
473
475struct EROT
476{
477 bool mirror;
478 bool spin;
479 double degrees;
480
482 mirror( false ),
483 spin( false ),
484 degrees( 0 )
485 {}
486
487 EROT( double aDegrees ) :
488 mirror( false ),
489 spin( false ),
490 degrees( aDegrees )
491 {}
492};
493
494
496struct EWIRE
497{
503 int layer;
504
505 // for style: (continuous | longdash | shortdash | dashdot)
510
513
514 // for cap: (flat | round)
515 enum { FLAT,
517
519
520 EWIRE( wxXmlNode* aWire );
521};
522
523
526{
529
530 EJUNCTION( wxXmlNode* aJunction);
531};
532
533
535struct ELABEL
536{
540 int layer;
543 wxString netname;
544
545 ELABEL( wxXmlNode* aLabel, const wxString& aNetName );
546};
547
548
550struct EVIA
551{
559
560 EVIA( wxXmlNode* aVia );
561};
562
563
566{
571 int layer;
572
573 ECIRCLE( wxXmlNode* aCircle );
574};
575
576
578struct ERECT
579{
584 int layer;
586
587 ERECT( wxXmlNode* aRect );
588};
589
590
597struct EATTR
598{
599 wxString name;
607
608 enum { // for 'display'
613 };
616
617 EATTR( wxXmlNode* aTree );
618 EATTR() {}
619};
620
621
624{
632 int layer;
634
635 EDIMENSION( wxXmlNode* aDimension );
636};
637
638
640struct ETEXT
641{
642 wxString text;
646 int layer;
650
651 enum { // for align
657
658 // opposites are -1 x above, used by code tricks in here
663 };
664
666
667 ETEXT( wxXmlNode* aText );
668
670 VECTOR2I ConvertSize() const;
671};
672
673
677struct EFRAME
678{
684 int rows;
685 int layer;
690
691 EFRAME( wxXmlNode* aFrameNode );
692};
693
694
697{
698 wxString name;
703
704 EPAD_COMMON( wxXmlNode* aPad );
705};
706
707
709struct EPAD : public EPAD_COMMON
710{
713
714 // for shape: (square | round | octagon | long | offset)
715 enum {
716 UNDEF = -1,
722 };
725
726 EPAD( wxXmlNode* aPad );
727};
728
729
731struct ESMD : public EPAD_COMMON
732{
735 int layer;
738
739 ESMD( wxXmlNode* aSMD );
740};
741
742
744struct EPIN
745{
746 wxString name;
749
756
757 EPIN( wxXmlNode* aPin );
758};
759
760
763{
767
768 EVERTEX( wxXmlNode* aVertex );
769};
770
771
774{
776 int layer;
778
779 // KiCad priority is opposite of Eagle rank, that is:
780 // - Eagle Low rank drawn first
781 // - KiCad high priority drawn first
782 // So since Eagle has an upper limit we define this, used for the cases
783 // where no rank is specified.
784 static const int max_priority = 6;
785
786 enum { // for pour
790 };
791 int pour;
796
797 EPOLYGON( wxXmlNode* aPolygon );
798};
799
800
802struct EHOLE
803{
807
808 EHOLE( wxXmlNode* aHole );
809};
810
811
814{
815 wxString name;
816 wxString library;
817 wxString package;
818 wxString value;
824
825 EELEMENT( wxXmlNode* aElement );
826};
827
828
829struct ELAYER
830{
832 wxString name;
833 int color;
834 int fill;
837
838 ELAYER( wxXmlNode* aLayer );
839};
840
841
843{
844 enum
845 {
846 TOP = 1,
861 BOTTOM = 16,
862 PADS = 17,
863 VIAS = 18,
866 TPLACE = 21,
867 BPLACE = 22,
870 TNAMES = 25,
871 BNAMES = 26,
874 TSTOP = 29,
875 BSTOP = 30,
876 TCREAM = 31,
877 BCREAM = 32,
880 TGLUE = 35,
881 BGLUE = 36,
882 TTEST = 37,
883 BTEST = 38,
889 DRILLS = 44,
890 HOLES = 45,
896 TDOCU = 51,
897 BDOCU = 52,
898 NETS = 91,
899 BUSSES = 92,
900 PINS = 93,
902 NAMES = 95,
903 VALUES = 96,
904 INFO = 97,
905 GUIDE = 98,
907 USERLAYER2 = 161
908 };
909};
910
911
912struct EPART
913{
914 /*
915 * <!ELEMENT part (attribute*, variant*)>
916 * <!ATTLIST part
917 * name %String; #REQUIRED
918 * library %String; #REQUIRED
919 * deviceset %String; #REQUIRED
920 * device %String; #REQUIRED
921 * technology %String; ""
922 * value %String; #IMPLIED
923 * >
924 */
925
926 wxString name;
927 wxString library;
928 wxString deviceset;
929 wxString device;
932 std::map<std::string,std::string> attribute;
933 std::map<std::string,std::string> variant;
934
935 EPART( wxXmlNode* aPart );
936};
937
938
940{
941 /*
942 * <!ELEMENT instance (attribute)*>
943 * <!ATTLIST instance
944 * part %String; #REQUIRED
945 * gate %String; #REQUIRED
946 * x %Coord; #REQUIRED
947 * y %Coord; #REQUIRED
948 * smashed %Bool; "no"
949 * rot %Rotation; "R0"
950 * >
951 */
952
953 wxString part;
954 wxString gate;
959
960 EINSTANCE( wxXmlNode* aInstance );
961};
962
963
964struct EGATE
965{
966 /*
967 * <!ELEMENT gate EMPTY>
968 * <!ATTLIST gate
969 * name %String; #REQUIRED
970 * symbol %String; #REQUIRED
971 * x %Coord; #REQUIRED
972 * y %Coord; #REQUIRED
973 * addlevel %GateAddLevel; "next"
974 * swaplevel %Int; "0"
975 * >
976 */
977
978 wxString name;
979 wxString symbol;
980
983
986
987 enum
988 {
993 ALWAYS
994 };
995
996 EGATE( wxXmlNode* aGate );
997};
998
999
1001{
1002 /*
1003 * <!ELEMENT connect EMPTY>
1004 * <!ATTLIST connect
1005 * gate %String; #REQUIRED
1006 * pin %String; #REQUIRED
1007 * pad %String; #REQUIRED
1008 * route %ContactRoute; "all"
1009 * >
1010 */
1011 wxString gate;
1012 wxString pin;
1013 wxString pad;
1014 //int contactroute; // TODO
1015
1016 ECONNECT( wxXmlNode* aConnect );
1017};
1018
1019
1021{
1022 /*
1023 * <!ELEMENT device (connects?, technologies?)>
1024 * <!ATTLIST device
1025 * name %String; ""
1026 * package %String; #IMPLIED
1027 * >
1028 */
1029 wxString name;
1031
1032 std::vector<ECONNECT> connects;
1033
1034 EDEVICE( wxXmlNode* aDevice );
1035};
1036
1037
1039{
1040 /*
1041 <!ELEMENT deviceset (description?, gates, devices)>
1042 <!ATTLIST deviceset
1043 name %String; #REQUIRED
1044 prefix %String; ""
1045 uservalue %Bool; "no"
1046 >
1047 */
1048
1049 wxString name;
1052 //std::vector<EDEVICE> devices;
1053 //std::vector<EGATE> gates;
1054
1055
1056 EDEVICE_SET( wxXmlNode* aDeviceSet );
1057};
1058
1059
1061{
1062 wxString number;
1063 wxString name;
1064 std::map<wxString, ECOORD> clearanceMap;
1065
1066 ECLASS( wxXmlNode* aClass );
1067};
1068
1069
1070#endif // _EAGLE_PARSER_H_
Model an optional XML attribute.
Definition: eagle_parser.h:194
bool operator==(const T &aOther) const
Definition: eagle_parser.h:276
const T * operator->() const
Return a constant pointer to the value of the attribute assuming it is available.
Definition: eagle_parser.h:349
OPTIONAL_XML_ATTRIBUTE< T > & operator=(const wxString &aData)
Assign to a string (optionally) containing the data.
Definition: eagle_parser.h:249
T * operator->()
Return a pointer to the value of the attribute assuming it is available.
Definition: eagle_parser.h:339
const T & operator*() const
Return a constant reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:329
OPTIONAL_XML_ATTRIBUTE(const wxString &aData)
Definition: eagle_parser.h:216
bool m_isAvailable
A boolean indicating if the data is present or not.
Definition: eagle_parser.h:197
const T & CGet() const
Return a constant reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:308
T m_data
The actual data if m_isAvailable is true; otherwise, garbage.
Definition: eagle_parser.h:200
void Set(const wxString &aString)
Attempt to convert a string to the base type.
Definition: eagle_parser.h:286
T & operator*()
Return a reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:319
T & Get()
Return a reference to the value of the attribute assuming it is available.
Definition: eagle_parser.h:297
OPTIONAL_XML_ATTRIBUTE(T aData)
Definition: eagle_parser.h:230
OPTIONAL_XML_ATTRIBUTE()
Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
Definition: eagle_parser.h:206
Keep track of what we are working on within a PTREE.
Definition: eagle_parser.h:116
void pop()
Definition: eagle_parser.h:127
void clear()
Definition: eagle_parser.h:125
void Value(const char *aValue)
modify the last path node's value
Definition: eagle_parser.h:130
std::vector< TRIPLET > p
Definition: eagle_parser.h:117
void Attribute(const char *aAttribute)
modify the last path node's attribute
Definition: eagle_parser.h:136
void push(const char *aPathSegment, const char *aAttribute="")
Definition: eagle_parser.h:120
wxString Contents()
return the contents of the XPATH as a single string
Definition: eagle_parser.h:142
OPTIONAL_XML_ATTRIBUTE< ECOORD > opt_ecoord
Definition: eagle_parser.h:376
T Convert(const wxString &aValue)
Convert a wxString to a generic type T.
Definition: eagle_parser.h:178
OPTIONAL_XML_ATTRIBUTE< int > opt_int
Definition: eagle_parser.h:372
static wxXmlNode * getChildrenNodes(NODE_MAP &aMap, const wxString &aName)
Definition: eagle_parser.h:62
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:375
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)
wxString Convert< wxString >(const wxString &aValue)
OPTIONAL_XML_ATTRIBUTE< wxString > opt_wxString
Definition: eagle_parser.h:371
std::map< wxString, EINSTANCE * > EINSTANCE_MAP
Definition: eagle_parser.h:50
std::unordered_map< wxString, wxXmlNode * > NODE_MAP
Definition: eagle_parser.h:49
OPTIONAL_XML_ATTRIBUTE< bool > opt_bool
Definition: eagle_parser.h:374
OPTIONAL_XML_ATTRIBUTE< double > opt_double
Definition: eagle_parser.h:373
VECTOR2I ConvertArcCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle)
std::map< wxString, std::unique_ptr< EPART > > EPART_MAP
Translates Eagle special characters to their counterparts in KiCad.
Definition: eagle_parser.h:51
Parse an Eagle "attribute" XML element.
Definition: eagle_parser.h:598
opt_double ratio
Definition: eagle_parser.h:605
opt_wxString value
Definition: eagle_parser.h:600
opt_ecoord size
Definition: eagle_parser.h:603
opt_ecoord y
Definition: eagle_parser.h:602
wxString name
Definition: eagle_parser.h:599
opt_erot rot
Definition: eagle_parser.h:606
opt_int align
Definition: eagle_parser.h:615
opt_int display
Definition: eagle_parser.h:614
opt_ecoord x
Definition: eagle_parser.h:601
opt_int layer
Definition: eagle_parser.h:604
Eagle circle.
Definition: eagle_parser.h:566
ECOORD x
Definition: eagle_parser.h:567
ECOORD radius
Definition: eagle_parser.h:569
ECOORD y
Definition: eagle_parser.h:568
ECOORD width
Definition: eagle_parser.h:570
wxString number
std::map< wxString, ECOORD > clearanceMap
wxString name
wxString pad
wxString gate
wxString pin
int ToNanoMeters() const
Definition: eagle_parser.h:424
ECOORD operator+(const ECOORD &aOther) const
Definition: eagle_parser.h:437
@ EU_NM
nanometers
Definition: eagle_parser.h:390
@ EU_MM
millimeters
Definition: eagle_parser.h:391
@ EU_MIL
mils/thous
Definition: eagle_parser.h:393
@ EU_INCH
inches
Definition: eagle_parser.h:392
int ToSchUnits() const
Definition: eagle_parser.h:434
float ToMm() const
Definition: eagle_parser.h:429
ECOORD operator-(const ECOORD &aOther) const
Definition: eagle_parser.h:442
int ToMils() const
Definition: eagle_parser.h:414
int To100NanoMeters() const
Definition: eagle_parser.h:419
ECOORD(int aValue, enum EAGLE_UNIT aUnit)
Definition: eagle_parser.h:407
long long int value
Unit used for the value field.
Definition: eagle_parser.h:397
bool operator==(const ECOORD &aOther) const
Converts a size expressed in a certain unit to nanometers.
Definition: eagle_parser.h:447
static long long int ConvertToNm(int aValue, enum EAGLE_UNIT aUnit)
int ToPcbUnits() const
Definition: eagle_parser.h:435
static constexpr EAGLE_UNIT ECOORD_UNIT
Definition: eagle_parser.h:400
opt_bool uservalue
opt_wxString prefix
wxString name
std::vector< ECONNECT > connects
wxString name
opt_wxString package
Eagle dimension element.
Definition: eagle_parser.h:624
opt_wxString dimensionType
Definition: eagle_parser.h:633
opt_ecoord textsize
Definition: eagle_parser.h:631
Eagle element element.
Definition: eagle_parser.h:814
opt_erot rot
Definition: eagle_parser.h:823
wxString name
Definition: eagle_parser.h:815
wxString library
Definition: eagle_parser.h:816
wxString package
Definition: eagle_parser.h:817
ECOORD y
Definition: eagle_parser.h:820
opt_bool smashed
Definition: eagle_parser.h:822
ECOORD x
Definition: eagle_parser.h:819
wxString value
Definition: eagle_parser.h:818
opt_bool locked
Definition: eagle_parser.h:821
Parse an Eagle frame element.
Definition: eagle_parser.h:678
ECOORD x1
Definition: eagle_parser.h:679
opt_bool border_bottom
Definition: eagle_parser.h:689
opt_bool border_left
Definition: eagle_parser.h:686
opt_bool border_right
Definition: eagle_parser.h:688
ECOORD y1
Definition: eagle_parser.h:680
int layer
Definition: eagle_parser.h:685
opt_bool border_top
Definition: eagle_parser.h:687
int columns
Definition: eagle_parser.h:683
ECOORD y2
Definition: eagle_parser.h:682
int rows
Definition: eagle_parser.h:684
ECOORD x2
Definition: eagle_parser.h:681
opt_int swaplevel
Definition: eagle_parser.h:985
ECOORD x
Definition: eagle_parser.h:981
ECOORD y
Definition: eagle_parser.h:982
wxString symbol
Definition: eagle_parser.h:979
wxString name
Definition: eagle_parser.h:978
opt_int addlevel
Definition: eagle_parser.h:984
Eagle hole element.
Definition: eagle_parser.h:803
ECOORD y
Definition: eagle_parser.h:805
ECOORD drill
Definition: eagle_parser.h:806
ECOORD x
Definition: eagle_parser.h:804
wxString part
Definition: eagle_parser.h:953
ECOORD x
Definition: eagle_parser.h:955
opt_erot rot
Definition: eagle_parser.h:958
wxString gate
Definition: eagle_parser.h:954
ECOORD y
Definition: eagle_parser.h:956
opt_bool smashed
Definition: eagle_parser.h:957
Eagle Junction.
Definition: eagle_parser.h:526
ECOORD y
Definition: eagle_parser.h:528
ECOORD x
Definition: eagle_parser.h:527
Eagle label.
Definition: eagle_parser.h:536
opt_erot rot
Definition: eagle_parser.h:541
ECOORD size
Definition: eagle_parser.h:539
wxString netname
Definition: eagle_parser.h:543
opt_wxString xref
Definition: eagle_parser.h:542
int layer
Definition: eagle_parser.h:540
ECOORD y
Definition: eagle_parser.h:538
ECOORD x
Definition: eagle_parser.h:537
wxString name
Definition: eagle_parser.h:832
opt_bool visible
Definition: eagle_parser.h:835
opt_bool active
Definition: eagle_parser.h:836
int color
Definition: eagle_parser.h:833
int fill
Definition: eagle_parser.h:834
int number
Definition: eagle_parser.h:831
Eagle net.
Definition: eagle_parser.h:459
int netcode
Definition: eagle_parser.h:460
wxString netname
Definition: eagle_parser.h:461
ENET(int aNetCode, const wxString &aNetName)
Definition: eagle_parser.h:463
Structure holding common properties for through-hole and SMD pads.
Definition: eagle_parser.h:697
opt_bool thermals
Definition: eagle_parser.h:702
opt_bool stop
Definition: eagle_parser.h:701
wxString name
Definition: eagle_parser.h:698
opt_erot rot
Definition: eagle_parser.h:700
Eagle thru hole pad.
Definition: eagle_parser.h:710
ECOORD drill
Definition: eagle_parser.h:711
opt_ecoord diameter
Definition: eagle_parser.h:712
opt_bool first
Definition: eagle_parser.h:724
@ OCTAGON
Definition: eagle_parser.h:719
@ SQUARE
Definition: eagle_parser.h:717
@ OFFSET
Definition: eagle_parser.h:721
opt_int shape
Definition: eagle_parser.h:723
wxString device
Definition: eagle_parser.h:929
std::map< std::string, std::string > variant
Definition: eagle_parser.h:933
wxString library
Definition: eagle_parser.h:927
opt_wxString technology
Definition: eagle_parser.h:930
wxString deviceset
Definition: eagle_parser.h:928
std::map< std::string, std::string > attribute
Definition: eagle_parser.h:932
opt_wxString value
Definition: eagle_parser.h:931
wxString name
Definition: eagle_parser.h:926
Eagle pin element.
Definition: eagle_parser.h:745
ECOORD x
Definition: eagle_parser.h:747
wxString name
Definition: eagle_parser.h:746
opt_int swaplevel
Definition: eagle_parser.h:754
opt_wxString visible
Definition: eagle_parser.h:750
opt_wxString direction
Definition: eagle_parser.h:752
opt_wxString length
Definition: eagle_parser.h:751
opt_wxString function
Definition: eagle_parser.h:753
opt_erot rot
Definition: eagle_parser.h:755
ECOORD y
Definition: eagle_parser.h:748
Eagle polygon, without vertices which are parsed as needed.
Definition: eagle_parser.h:774
opt_bool orphans
Definition: eagle_parser.h:793
opt_int rank
Definition: eagle_parser.h:795
opt_bool thermals
Definition: eagle_parser.h:794
opt_ecoord spacing
Definition: eagle_parser.h:777
static const int max_priority
Definition: eagle_parser.h:784
ECOORD width
Definition: eagle_parser.h:775
opt_ecoord isolate
Definition: eagle_parser.h:792
Eagle XML rectangle in binary.
Definition: eagle_parser.h:579
ECOORD x2
Definition: eagle_parser.h:582
ECOORD y1
Definition: eagle_parser.h:581
opt_erot rot
Definition: eagle_parser.h:585
int layer
Definition: eagle_parser.h:584
ECOORD y2
Definition: eagle_parser.h:583
ECOORD x1
Definition: eagle_parser.h:580
Eagle rotation.
Definition: eagle_parser.h:476
double degrees
Definition: eagle_parser.h:479
bool spin
Definition: eagle_parser.h:478
EROT(double aDegrees)
Definition: eagle_parser.h:487
bool mirror
Definition: eagle_parser.h:477
Eagle SMD pad.
Definition: eagle_parser.h:732
opt_int roundness
Definition: eagle_parser.h:736
ECOORD dx
Definition: eagle_parser.h:733
int layer
Definition: eagle_parser.h:735
opt_bool cream
Definition: eagle_parser.h:737
ECOORD dy
Definition: eagle_parser.h:734
Eagle text element.
Definition: eagle_parser.h:641
opt_double ratio
Definition: eagle_parser.h:648
wxString text
Definition: eagle_parser.h:642
@ BOTTOM_CENTER
Definition: eagle_parser.h:660
@ BOTTOM_RIGHT
Definition: eagle_parser.h:662
@ TOP_CENTER
Definition: eagle_parser.h:654
@ TOP_LEFT
Definition: eagle_parser.h:655
@ TOP_RIGHT
Definition: eagle_parser.h:656
@ CENTER_RIGHT
Definition: eagle_parser.h:659
@ CENTER_LEFT
Definition: eagle_parser.h:653
@ BOTTOM_LEFT
Definition: eagle_parser.h:661
ECOORD y
Definition: eagle_parser.h:644
ECOORD size
Definition: eagle_parser.h:645
opt_erot rot
Definition: eagle_parser.h:649
opt_int align
Definition: eagle_parser.h:665
ECOORD x
Definition: eagle_parser.h:643
VECTOR2I ConvertSize() const
Calculate text size based on font type and size.
opt_wxString font
Definition: eagle_parser.h:647
int layer
Definition: eagle_parser.h:646
Eagle vertex.
Definition: eagle_parser.h:763
ECOORD y
Definition: eagle_parser.h:765
ECOORD x
Definition: eagle_parser.h:764
opt_double curve
range is -359.9..359.9
Definition: eagle_parser.h:766
Eagle via.
Definition: eagle_parser.h:551
opt_ecoord diam
Definition: eagle_parser.h:557
ECOORD drill
< inclusive
Definition: eagle_parser.h:556
ECOORD y
Definition: eagle_parser.h:553
opt_wxString shape
Definition: eagle_parser.h:558
int layer_front_most
Definition: eagle_parser.h:554
int layer_back_most
< extent
Definition: eagle_parser.h:555
ECOORD x
Definition: eagle_parser.h:552
Eagle wire.
Definition: eagle_parser.h:497
ECOORD width
Definition: eagle_parser.h:502
int layer
Definition: eagle_parser.h:503
@ LONGDASH
Definition: eagle_parser.h:507
@ CONTINUOUS
Definition: eagle_parser.h:506
@ SHORTDASH
Definition: eagle_parser.h:508
ECOORD x2
Definition: eagle_parser.h:500
opt_int cap
Definition: eagle_parser.h:518
opt_int style
Definition: eagle_parser.h:511
ECOORD y2
Definition: eagle_parser.h:501
ECOORD x1
Definition: eagle_parser.h:498
ECOORD y1
Definition: eagle_parser.h:499
opt_double curve
range is -359.9..359.9
Definition: eagle_parser.h:512
segment (element) of our XPATH into the Eagle XML document tree in PTREE form.
Definition: eagle_parser.h:89
TRIPLET(const char *aElement, const char *aAttribute="", const char *aValue="")
Definition: eagle_parser.h:94
const char * value
Definition: eagle_parser.h:92
const char * attribute
Definition: eagle_parser.h:91
const char * element
Definition: eagle_parser.h:90
Implement a simple wrapper around runtime_error to isolate the errors thrown by the Eagle XML parser.
Definition: eagle_parser.h:74
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:81