KiCad PCB EDA Suite
Loading...
Searching...
No Matches
altium_parser_sch.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) 2020 Thomas Pointhuber <[email protected]>
5 * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef ALTIUM_PARSER_SCH_H
26#define ALTIUM_PARSER_SCH_H
27
28#include <cstdint>
29#include <cstring>
30#include <map>
31#include <vector>
32
33#include <math/vector2d.h>
34
35#include <wx/gdicmn.h>
36#include <wx/string.h>
37
38// this constant specifies a item which is not inside an component
39const int ALTIUM_COMPONENT_NONE = -1;
40
41class ALTIUM_PARSER;
42
44{
45 wxString filename;
46 std::vector<char> data;
47
48 explicit ASCH_STORAGE_FILE( ALTIUM_PARSER& aReader );
49};
50
52{
53 wxString FileName;
54 std::vector<char> Data;
55
56 explicit ASCH_ADDITIONAL_FILE( ALTIUM_PARSER& aReader );
57};
58
60{
61 HEADER = 0,
62 COMPONENT = 1,
63 PIN = 2,
64 IEEE_SYMBOL = 3,
65 LABEL = 4,
66 BEZIER = 5,
67 POLYLINE = 6,
68 POLYGON = 7,
69 ELLIPSE = 8,
70 PIECHART = 9,
71 ROUND_RECTANGLE = 10,
72 ELLIPTICAL_ARC = 11,
73 ARC = 12,
74 LINE = 13,
75 RECTANGLE = 14,
76 SHEET_SYMBOL = 15,
77 SHEET_ENTRY = 16,
78 POWER_PORT = 17,
79 PORT = 18,
80 NO_ERC = 22,
81 NET_LABEL = 25,
82 BUS = 26,
83 WIRE = 27,
84 TEXT_FRAME = 28,
85 JUNCTION = 29,
86 IMAGE = 30,
87 SHEET = 31,
88 SHEET_NAME = 32,
89 FILE_NAME = 33,
90 DESIGNATOR = 34,
91 BUS_ENTRY = 37,
92 TEMPLATE = 39,
93 PARAMETER = 41,
94 PARAMETER_SET = 43,
96 IMPLEMENTATION = 45,
97 RECORD_46 = 46,
98 RECORD_47 = 47,
99 RECORD_48 = 48,
100 NOTE = 209,
101 COMPILE_MASK = 211,
102 HARNESS_CONNECTOR = 215,
103 HARNESS_ENTRY = 216,
104 HARNESS_TYPE = 217,
105 SIGNAL_HARNESS = 218,
106 BLANKET = 225,
107 RECORD_226 = 226,
108};
109
110
112{
113 RIGHTWARDS = 0, // 0
114 UPWARDS = 1, // 90
115 LEFTWARDS = 2, // 180
116 DOWNWARDS = 3 // 270
117};
118
119
121{
125
128
129 int Color;
131};
132
133
135{
138 wxString libreference;
141
145
149
150 explicit ASCH_SYMBOL( const std::map<wxString, wxString>& aProps );
151};
152
153
155{
156 UNKNOWN = -1,
157 NO_SYMBOL = 0,
164};
165
166
168{
169 UNKNOWN = -1,
170 NO_SYMBOL = 0,
171 POSPONED_OUTPUT = 8,
172 OPEN_COLLECTOR = 9,
173 HIZ = 10,
174 HIGH_CURRENT = 11,
175 PULSE = 12,
176 SCHMITT = 13,
178 OPEN_EMITTER = 23,
180 SHIFT_LEFT = 30,
181 OPEN_OUTPUT = 32
182};
183
184
186{
187 UNKNOWN = -1,
188 NO_SYMBOL = 0,
189 NEGATED = 1,
190 LOW_INPUT = 4,
191 LOW_OUTPUT = 17
192};
193
194
196{
197 UNKNOWN = -1,
198 NO_SYMBOL = 0,
199 CLOCK = 3,
200};
201
202
204{
205 UNKNOWN = -1,
206
207 INPUT = 0,
208 BIDI = 1,
209 OUTPUT = 2,
210 OPEN_COLLECTOR = 3,
211 PASSIVE = 4,
212 TRISTATE = 5,
213 OPEN_EMITTER = 6,
214 POWER = 7
215};
216
217
219{
223
224 wxString name;
225 wxString text;
226 wxString designator;
227
230
233
236
239
240 VECTOR2I kicadLocation; // location of pin in KiCad without rounding error
241
244
245 explicit ASCH_PIN( const std::map<wxString, wxString>& aProps );
246};
247
248
250{
251 UNKNOWN = -1,
252
253 BOTTOM_LEFT = 0,
254 BOTTOM_CENTER = 1,
255 BOTTOM_RIGHT = 2,
256 CENTER_LEFT = 3,
257 CENTER_CENTER = 4,
258 CENTER_RIGHT = 5,
259 TOP_LEFT = 6,
260 TOP_CENTER = 7,
261 TOP_RIGHT = 8
262};
263
264
266{
267 LEFT = 1,
268 CENTER = 2,
269 RIGHT = 3
270};
271
272
274{
277
279
280 wxString text;
281
284
287
288 explicit ASCH_LABEL( const std::map<wxString, wxString>& aProps );
289};
290
291
293{
295 wxSize Size;
296
297 // have both coordinates, for convenience
300
301 wxString Text;
302
303 bool IsWordWrapped; // to do when kicad supports this
306
308 int TextMargin; // to do when kicad supports this
311
313
314 explicit ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProps );
315};
316
317
319{
320 wxString author;
321
322 explicit ASCH_NOTE( const std::map<wxString, wxString>& aProperties );
323};
324
325
327{
331
332 std::vector<VECTOR2I> points;
333
335
336 explicit ASCH_BEZIER( const std::map<wxString, wxString>& aProps );
337};
338
339
341{
342 SOLID = 0,
343 DASHED = 1,
344 DOTTED = 2,
345 DASH_DOTTED = 3
346};
347
348
350{
351 LEFT = 0,
352 RIGHT = 1,
353 TOP = 2,
354 BOTTOM = 3
355};
356
357
359{
363
364 std::vector<VECTOR2I> Points;
365
367 int Color;
368
370
371 explicit ASCH_POLYLINE( const std::map<wxString, wxString>& aProps );
372};
373
374
376{
377 std::vector<VECTOR2I> points;
378
379 explicit ASCH_POLYGON( const std::map<wxString, wxString>& aProps );
380};
381
382
384{
387
389
391
392 explicit ASCH_ROUND_RECTANGLE( const std::map<wxString, wxString>& aProps );
393};
394
395
397{
401
408
410
411 explicit ASCH_ARC( const std::map<wxString, wxString>& aProps );
412};
413
414
416{
419
423
427
428 explicit ASCH_ELLIPSE( const std::map<wxString, wxString>& aProps );
429};
430
431
433{
437
440
442
443 explicit ASCH_LINE( const std::map<wxString, wxString>& aProps );
444};
445
446
448{
449 int OwnerPartID; // always -1, can be safely ignored I think
450
453
454 std::vector<VECTOR2I> Points;
455
456 int Color;
459
460 explicit ASCH_SIGNAL_HARNESS( const std::map<wxString, wxString>& aProps );
461};
462
463
465{
466 int OwnerPartID; // always -1, can be safely ignored I think
467
470
472 int Color;
473 int IndexInSheet; // Keeps increasing nicely
475 //int locationX; // keep just in case
476 //int locationY;
478 //int xSize; // keep just in case
479 //int ySize;
480
481 explicit ASCH_HARNESS_CONNECTOR( const std::map<wxString, wxString>& aProps );
482};
483
484
486{
487 // Completely random, mostly this entry exists, but not always, should not be used!
488 // int ownerindex;
489
490 int OwnerPartID; // always -1, can be safely ignored I think
491
493 int Color;
499
500 bool OwnerIndexAdditionalList; // what is that?
501
502 wxString Name;
504
505 explicit ASCH_HARNESS_ENTRY( const std::map<wxString, wxString>& aProps );
506};
507
508
510{
511 //int ownerindex; // use SCH_ALTIUM_PLUGIN::m_harnessEntryParent instead!
512 int OwnerPartID; // Always -1, presumably safe to remuve
513
514 int Color;
517
519 bool OwnerIndexAdditionalList; // what is that?
520
522
523 wxString Text;
524
525 explicit ASCH_HARNESS_TYPE( const std::map<wxString, wxString>& aProps );
526};
527
528
530{
533
535
536 explicit ASCH_RECTANGLE( const std::map<wxString, wxString>& aProps );
537};
538
539
541{
544
546
547 int color;
549
550 explicit ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProps );
551};
552
553
555{
556 UNSPECIFIED = 0,
557 OUTPUT = 1,
558 INPUT = 2,
559 BIDI = 3,
560};
561
562
564{
565 NONE_HORIZONTAL = 0,
566 LEFT = 1,
567 RIGHT = 2,
568 LEFT_RIGHT = 3,
569 NONE_VERTICAL = 4,
570 TOP = 5,
571 BOTTOM = 6,
572 TOP_BOTTOM = 7
573};
574
575
577{
580
582
586
587 wxString name;
588
589 explicit ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProps );
590};
591
592
594{
595 UNKNOWN = -1,
596
597 CIRCLE = 0,
598 ARROW = 1,
599 BAR = 2,
600 WAVE = 3,
601 POWER_GROUND = 4,
602 SIGNAL_GROUND = 5,
603 EARTH = 6,
604 GOST_ARROW = 7,
606 GOST_EARTH = 9,
607 GOST_BAR = 10
608};
609
610
612{
614
615 wxString text;
617
621
622 explicit ASCH_POWER_PORT( const std::map<wxString, wxString>& aProps );
623};
624
625
627{
629
630 wxString Name;
631 wxString HarnessType;
632
634 int Width;
637 int Color;
640
642
645
646 explicit ASCH_PORT( const std::map<wxString, wxString>& aProps );
647};
648
649
651{
653
656
657 explicit ASCH_NO_ERC( const std::map<wxString, wxString>& aProps );
658};
659
660
662{
663 wxString text;
664
666
668
669 explicit ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps );
670};
671
672
674{
677
678 std::vector<VECTOR2I> points;
679
680 explicit ASCH_BUS( const std::map<wxString, wxString>& aProps );
681};
682
683
685{
688
689 std::vector<VECTOR2I> points;
690
691 explicit ASCH_WIRE( const std::map<wxString, wxString>& aProps );
692};
693
694
696{
698
700
701 explicit ASCH_JUNCTION( const std::map<wxString, wxString>& aProps );
702};
703
704
706{
710
711 wxString filename;
714
717
718 explicit ASCH_IMAGE( const std::map<wxString, wxString>& aProps );
719};
720
721
723{
724 wxString FontName;
725
726 int Size;
729
730 bool Italic;
731 bool Bold;
733
734 explicit ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProps, int aId );
735};
736
737
739{
740 UNKNOWN = -1, // use A4
741
742 A4 = 0, // 1150 × 760
743 A3 = 1, // 1550 × 1110
744 A2 = 2, // 2230 × 1570
745 A1 = 3, // 3150 × 2230
746 A0 = 4, // 4460 × 3150
747 A = 5, // 950 × 750
748 B = 6, // 1500 × 950
749 C = 7, // 2000 × 1500
750 D = 8, // 3200 × 2000
751 E = 9, // 4200 × 3200
752 LETTER = 10, // 1100 × 850
753 LEGAL = 11, // 1400 × 850
754 TABLOID = 12, // 1700 × 1100
755 ORCAD_A = 13, // 990 × 790
756 ORCAD_B = 14, // 1540 × 990
757 ORCAD_C = 15, // 2060 × 1560
758 ORCAD_D = 16, // 3260 × 2060
759 ORCAD_E = 17 // 4280 × 3280
760};
761
763
764
766{
767 LANDSCAPE = 0,
768 PORTRAIT = 1
769};
770
771
773{
774 std::vector<ASCH_SHEET_FONT> fonts;
775
778
779 explicit ASCH_SHEET( const std::map<wxString, wxString>& aProps );
780};
781
782
784{
787
788 wxString text;
789
792
794
795 explicit ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProps );
796};
797
798
800{
803
804 wxString text;
805
808
810
811 explicit ASCH_FILE_NAME( const std::map<wxString, wxString>& aProps );
812};
813
814
816{
819
820 wxString name;
821 wxString text;
822
826
827 explicit ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProps );
828};
829
830
832{
834
835 wxString name;
836 wxString type;
837 wxString libname;
838
840
841 explicit ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProps );
842};
843
844
846{
848 explicit ASCH_IMPLEMENTATION_LIST( const std::map<wxString, wxString>& aProps );
849};
850
851
853{
856
857 explicit ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProps );
858};
859
860
862{
865
869
870 wxString name;
871 wxString text;
872
876
877 explicit ASCH_PARAMETER( const std::map<wxString, wxString>& aProps );
878};
879
880#endif //ALTIUM_PARSER_SCH_H
ASCH_PIN_SYMBOL_INNER
ALTIUM_SCH_RECORD
ASCH_RECORD_ORIENTATION
ASCH_SHEET_ENTRY_SIDE
ASCH_PIN_SYMBOL_INNEREDGE
ASCH_PIN_ELECTRICAL
ASCH_PORT_IOTYPE
ASCH_PORT_STYLE
const int ALTIUM_COMPONENT_NONE
VECTOR2I ASchSheetGetSize(ASCH_SHEET_SIZE aSheetSize)
ASCH_TEXT_FRAME_ALIGNMENT
ASCH_LABEL_JUSTIFICATION
ASCH_PIN_SYMBOL_OUTER
ASCH_POLYLINE_LINESTYLE
ASCH_SHEET_SIZE
ASCH_POWER_PORT_STYLE
ASCH_SHEET_WORKSPACEORIENTATION
ASCH_PIN_SYMBOL_OUTEREDGE
Generic cubic Bezier representation.
Definition: bezier_curves.h:78
Represent basic circle geometry with utility geometry functions.
Definition: circle.h:33
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:85
This class was created to handle importing ellipses from other file formats that support them nativel...
Definition: ellipse.h:34
Manage an 8-bit channel image.
Definition: image.h:90
std::chrono::steady_clock CLOCK
std::vector< char > Data
int ownerpartdisplaymode
double m_StartAngle
VECTOR2I m_Center
double m_EndAngle
std::vector< VECTOR2I > points
VECTOR2I corner
VECTOR2I location
std::vector< VECTOR2I > points
ASCH_LABEL_JUSTIFICATION justification
ASCH_RECORD_ORIENTATION orientation
ASCH_RECORD_ORIENTATION orientation
int OwnerPartID
int TextStyle
int IndexInSheet
int TextFontID
int AreaColor
int DistanceFromTop
ASCH_SHEET_ENTRY_SIDE Side
int TextColor
int Color
wxString Name
bool OwnerIndexAdditionalList
VECTOR2I location
wxString filename
ASCH_RECORD_ORIENTATION orientation
VECTOR2I location
ASCH_LABEL_JUSTIFICATION justification
VECTOR2I point1
VECTOR2I point2
int ownerpartdisplaymode
ASCH_RECORD_ORIENTATION orientation
wxString author
ASCH_RECORD_ORIENTATION orientation
ASCH_LABEL_JUSTIFICATION justification
ASCH_PIN_SYMBOL_INNEREDGE symbolInnerEdge
ASCH_PIN_SYMBOL_OUTEREDGE symbolOuterEdge
ASCH_PIN_SYMBOL_OUTER symbolOuter
VECTOR2I location
int ownerpartdisplaymode
wxString name
wxString text
VECTOR2I kicadLocation
wxString designator
ASCH_PIN_ELECTRICAL electrical
ASCH_PIN_SYMBOL_INNER symbolInner
ASCH_RECORD_ORIENTATION orientation
std::vector< VECTOR2I > points
ASCH_POLYLINE_LINESTYLE LineStyle
std::vector< VECTOR2I > Points
VECTOR2I Location
ASCH_TEXT_FRAME_ALIGNMENT Alignment
ASCH_PORT_IOTYPE IOtype
wxString HarnessType
ASCH_PORT_STYLE Style
ASCH_POWER_PORT_STYLE style
ASCH_RECORD_ORIENTATION orientation
int ownerpartid
wxString name
int distanceFromTop
ASCH_SHEET_ENTRY_SIDE side
ASCH_PORT_IOTYPE iotype
ASCH_PORT_STYLE style
int ownerindex
ASCH_RECORD_ORIENTATION orientation
ASCH_SHEET_SIZE sheetSize
ASCH_SHEET_WORKSPACEORIENTATION sheetOrientation
std::vector< ASCH_SHEET_FONT > fonts
std::vector< VECTOR2I > Points
std::vector< char > data
wxString componentdescription
wxString libreference
wxString sourcelibraryname
ASCH_TEXT_FRAME_ALIGNMENT Alignment
std::vector< VECTOR2I > points