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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef ALTIUM_PARSER_SCH_H
22#define ALTIUM_PARSER_SCH_H
23
24#include <cstdint>
25#include <cstring>
26#include <map>
27#include <vector>
28
29#include <math/vector2d.h>
30#include <wx/string.h>
31
32// this constant specifies a item which is not inside an component
33const int ALTIUM_COMPONENT_NONE = -1;
34
36
38{
39 wxString filename;
40 std::vector<char> data;
41
42 explicit ASCH_STORAGE_FILE( const std::map<wxString, wxString>& aProps );
43 explicit ASCH_STORAGE_FILE( ALTIUM_BINARY_PARSER& aReader );
44};
45
47{
48 wxString FileName;
49 std::vector<char> Data;
50
51 explicit ASCH_ADDITIONAL_FILE( ALTIUM_BINARY_PARSER& aReader );
52};
53
106
107
109{
110 RIGHTWARDS = 0, // 0
111 UPWARDS = 1, // 90
112 LEFTWARDS = 2, // 180
113 DOWNWARDS = 3 // 270
114};
115
116
118{
124
125 explicit ASCH_OWNER_INTERFACE( const std::map<wxString, wxString>& aProps );
126};
127
129{
133
134 explicit ASCH_FILL_INTERFACE( const std::map<wxString, wxString>& aProps );
135};
136
138{
140 int Color;
141
142 explicit ASCH_BORDER_INTERFACE( const std::map<wxString, wxString>& aProps );
143};
144
145
147{
150 wxString uniqueid;
151 wxString libreference;
154
158
162
163 explicit ASCH_SYMBOL( const std::map<wxString, wxString>& aProps );
164};
165
166
168{
169 wxString filename;
170
171 explicit ASCH_TEMPLATE( const std::map<wxString, wxString>& aProps );
172};
173
174
176{
181 CLOCK = 3,
185 // 7 is missing
188 HIZ = 10,
190 PULSE = 12,
192 // 14-16 missing
194 // 18-21 missing
199 // 26-29 missing
201 // 31 is missing
204 BIDI = 34
205};
206
208{
209public:
210 enum PTYPE
211 {
216 CLOCK = 3,
220 // 7 is missing
223 HIZ = 10,
225 PULSE = 12,
227 // 14-16 missing
229 // 18-21 missing
234 // 26-29 missing
236 // 31 is missing
239 BIDI = 34
240 };
241
242 static PTYPE FromInt( int aInt )
243 {
244 switch( aInt )
245 {
246 case 0:
247 return NO_SYMBOL;
248 case 1:
249 return NEGATED;
250 case 2:
251 return RIGHTLEFT;
252 case 3:
253 return CLOCK;
254 case 4:
255 return LOW_INPUT;
256 case 5:
257 return ANALOG_IN;
258 case 6:
259 return NOLOGICCONNECT;
260 case 8:
261 return POSTPONE_OUTPUT;
262 case 9:
263 return OPEN_COLLECTOR;
264 case 10:
265 return HIZ;
266 case 11:
267 return HIGH_CURRENT;
268 case 12:
269 return PULSE;
270 case 13:
271 return SCHMITT;
272 case 17:
273 return LOW_OUTPUT;
274 case 22:
276 case 23:
277 return OPEN_EMITTER;
278 case 24:
280 case 25:
281 return DIGITAL_IN;
282 case 30:
283 return SHIFT_LEFT;
284 case 32:
285 return OPEN_OUTPUT;
286 case 33:
287 return LEFTRIGHT;
288 case 34:
289 return BIDI;
290 default:
291 return UNKNOWN;
292 }
293 }
294};
295
296
310
311
339
340
355
356
358{
359 LEFT = 1,
362};
363
364
366{
368 RIGHT = 1,
370};
371
372
374{
376
377 wxString text;
379
382
385
386 explicit ASCH_LABEL( const std::map<wxString, wxString>& aProps );
387};
388
390{
391 wxString url;
392
393 explicit ASCH_HYPERLINK( const std::map<wxString, wxString>& aProps );
394};
395
396
398{
401
402 // have both coordinates, for convenience
405
406 wxString Text;
407
408 bool IsWordWrapped; // to do when kicad supports this
410
412 int TextMargin; // to do when kicad supports this
418
420
421 explicit ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProps );
422};
423
424
426{
427 wxString author;
428
429 explicit ASCH_NOTE( const std::map<wxString, wxString>& aProperties );
430};
431
432
434{
435 std::vector<VECTOR2I> points;
436
437 explicit ASCH_BEZIER( const std::map<wxString, wxString>& aProps );
438};
439
440
448
449
451{
452 LEFT = 0,
453 RIGHT = 1,
454 TOP = 2,
456};
457
458
460{
461 std::vector<VECTOR2I> Points;
462
464
465 explicit ASCH_POLYLINE( const std::map<wxString, wxString>& aProps );
466};
467
468
470{
471 std::vector<VECTOR2I> points;
472
473 explicit ASCH_POLYGON( const std::map<wxString, wxString>& aProps );
474};
475
476
486
487
489{
496
497 explicit ASCH_ARC( const std::map<wxString, wxString>& aProps );
498};
499
500
502{
503 explicit ASCH_PIECHART( const std::map<wxString, wxString>& aProps );
504};
505
506
508{
512
513 explicit ASCH_ELLIPSE( const std::map<wxString, wxString>& aProps );
514};
515
516
518{
521
523
524 explicit ASCH_LINE( const std::map<wxString, wxString>& aProps );
525};
526
527
529{
532
533 std::vector<VECTOR2I> points;
534
535 int color;
537
538 explicit ASCH_SIGNAL_HARNESS( const std::map<wxString, wxString>& aProps );
539};
540
541
555
556
558{
560 int Color;
565
566 bool OwnerIndexAdditionalList; // what is that?
567
568 wxString Name;
570
571 explicit ASCH_HARNESS_ENTRY( const std::map<wxString, wxString>& aProps );
572};
573
574
576{
577 int Color;
579
581 bool OwnerIndexAdditionalList; // what is that?
582
584
585 wxString Text;
586
587 explicit ASCH_HARNESS_TYPE( const std::map<wxString, wxString>& aProps );
588};
589
590
592{
595
596 explicit ASCH_RECTANGLE( const std::map<wxString, wxString>& aProps );
597};
598
599
601{
604
606
607 int color;
609
610 explicit ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProps );
611};
612
613
615{
619 BIDI = 3,
620};
621
622
634
635
637{
639
643
644 wxString name;
645 wxString harnessType;
646
647 explicit ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProps );
648};
649
650
667
668
670{
671 wxString text;
673
677
678 explicit ASCH_POWER_PORT( const std::map<wxString, wxString>& aProps );
679};
680
681
683{
684 wxString Name;
685 wxString HarnessType;
686
688 int Width;
691 int Color;
694
696
699
700 explicit ASCH_PORT( const std::map<wxString, wxString>& aProps );
701};
702
703
705{
707
710
711 explicit ASCH_NO_ERC( const std::map<wxString, wxString>& aProps );
712};
713
714
716{
717 wxString text;
718
720
723
724 explicit ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps );
725};
726
727
729{
731
732 std::vector<VECTOR2I> points;
733
734 explicit ASCH_BUS( const std::map<wxString, wxString>& aProps );
735};
736
737
739{
741
742 std::vector<VECTOR2I> points;
743
744 explicit ASCH_WIRE( const std::map<wxString, wxString>& aProps );
745};
746
747
749{
751
752 explicit ASCH_JUNCTION( const std::map<wxString, wxString>& aProps );
753};
754
755
757{
758 wxString filename;
761
764
765 explicit ASCH_IMAGE( const std::map<wxString, wxString>& aProps );
766};
767
768
770{
771 wxString FontName;
772
773 int Size;
776
777 bool Italic;
778 bool Bold;
780
781 explicit ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProps, int aId );
782};
783
784
786{
787 UNKNOWN = -1, // use A4
788
789 A4 = 0, // 1150 × 760
790 A3 = 1, // 1550 × 1110
791 A2 = 2, // 2230 × 1570
792 A1 = 3, // 3150 × 2230
793 A0 = 4, // 4460 × 3150
794 A = 5, // 950 × 750
795 B = 6, // 1500 × 950
796 C = 7, // 2000 × 1500
797 D = 8, // 3200 × 2000
798 E = 9, // 4200 × 3200
799 LETTER = 10, // 1100 × 850
800 LEGAL = 11, // 1400 × 850
801 TABLOID = 12, // 1700 × 1100
802 ORCAD_A = 13, // 990 × 790
803 ORCAD_B = 14, // 1540 × 990
804 ORCAD_C = 15, // 2060 × 1560
805 ORCAD_D = 16, // 3260 × 2060
806 ORCAD_E = 17 // 4280 × 3280
807};
808
810
811
817
818
820{
821 std::vector<ASCH_SHEET_FONT> fonts;
822
825
828
829 explicit ASCH_SHEET( const std::map<wxString, wxString>& aProps );
830};
831
832
834{
835 wxString text;
836
839
841
842 explicit ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProps );
843};
844
845
847{
848 wxString text;
849
852
854
855 explicit ASCH_FILE_NAME( const std::map<wxString, wxString>& aProps );
856};
857
858
860{
861 wxString name;
862 wxString text;
864
868
869 explicit ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProps );
870};
871
872
874{
875 wxString name;
876 wxString type;
877 wxString libname;
878 wxString description;
880
881 explicit ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProps );
882};
883
884
886{
887 explicit ASCH_IMPLEMENTATION_LIST( const std::map<wxString, wxString>& aProps );
888};
889
890
892{
895
896 explicit ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProps );
897};
898
899
901{
905
906 wxString name;
907 wxString text;
908
913
914 explicit ASCH_PARAMETER( const std::map<wxString, wxString>& aProps );
915};
916
917#endif //ALTIUM_PARSER_SCH_H
ALTIUM_SCH_RECORD
ASCH_RECORD_ORIENTATION
ASCH_SHEET_ENTRY_SIDE
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_PIN_SYMBOL_EDGE
ASCH_LABEL_JUSTIFICATION
ASCH_POLYLINE_LINESTYLE
ASCH_SHEET_SIZE
ASCH_POWER_PORT_STYLE
ASCH_PORT_ALIGNMENT
ASCH_SHEET_WORKSPACEORIENTATION
static PTYPE FromInt(int aInt)
Generic cubic Bezier representation.
Represent basic circle geometry with utility geometry functions.
Definition circle.h:33
Store all of the related component information found in a netlist.
Plain ellipse / elliptical-arc data.
Definition ellipse.h:32
Manage an 8-bit channel image.
Definition image.h:86
Definition line.h:32
@ SOLID
Definition eda_shape.h:73
std::chrono::steady_clock CLOCK
#define D(x)
Definition ptree.cpp:37
@ BUS
This item represents a bus vector.
ASCH_ADDITIONAL_FILE(ALTIUM_BINARY_PARSER &aReader)
std::vector< char > Data
ASCH_ARC(const std::map< wxString, wxString > &aProps)
double m_StartAngle
VECTOR2I m_Center
ASCH_BEZIER(const std::map< wxString, wxString > &aProps)
std::vector< VECTOR2I > points
ASCH_BORDER_INTERFACE(const std::map< wxString, wxString > &aProps)
ASCH_BUS_ENTRY(const std::map< wxString, wxString > &aProps)
VECTOR2I corner
VECTOR2I location
ASCH_BUS(const std::map< wxString, wxString > &aProps)
std::vector< VECTOR2I > points
ASCH_LABEL_JUSTIFICATION justification
ASCH_DESIGNATOR(const std::map< wxString, wxString > &aProps)
ASCH_RECORD_ORIENTATION orientation
ASCH_ELLIPSE(const std::map< wxString, wxString > &aProps)
ASCH_FILE_NAME(const std::map< wxString, wxString > &aProps)
ASCH_RECORD_ORIENTATION orientation
ASCH_FILL_INTERFACE(const std::map< wxString, wxString > &aProps)
ASCH_HARNESS_CONNECTOR(const std::map< wxString, wxString > &aProps)
ASCH_SHEET_ENTRY_SIDE m_harnessConnectorSide
ASCH_HARNESS_ENTRY(const std::map< wxString, wxString > &aProps)
int TextStyle
int TextFontID
int AreaColor
int DistanceFromTop
ASCH_SHEET_ENTRY_SIDE Side
int TextColor
int Color
wxString Name
bool OwnerIndexAdditionalList
ASCH_HARNESS_TYPE(const std::map< wxString, wxString > &aProps)
ASCH_IMAGE(const std::map< wxString, wxString > &aProps)
ASCH_IMPLEMENTATION_LIST(const std::map< wxString, wxString > &aProps)
ASCH_IMPLEMENTATION(const std::map< wxString, wxString > &aProps)
ASCH_JUNCTION(const std::map< wxString, wxString > &aProps)
ASCH_RECORD_ORIENTATION orientation
ASCH_LABEL(const std::map< wxString, wxString > &aProps)
ASCH_LABEL_JUSTIFICATION justification
ASCH_POLYLINE_LINESTYLE LineStyle
ASCH_LINE(const std::map< wxString, wxString > &aProps)
ASCH_LABEL_JUSTIFICATION justification
ASCH_RECORD_ORIENTATION orientation
ASCH_NET_LABEL(const std::map< wxString, wxString > &aProps)
ASCH_NOTE(const std::map< wxString, wxString > &aProperties)
ASCH_NO_ERC(const std::map< wxString, wxString > &aProps)
ASCH_OWNER_INTERFACE(const std::map< wxString, wxString > &aProps)
ASCH_PARAMETER(const std::map< wxString, wxString > &aProps)
ASCH_RECORD_ORIENTATION orientation
ASCH_LABEL_JUSTIFICATION justification
ASCH_PIECHART(const std::map< wxString, wxString > &aProps)
VECTOR2I location
ASCH_PIN_SYMBOL::PTYPE symbolOuterEdge
VECTOR2I kicadLocation
wxString designator
ASCH_PIN_SYMBOL::PTYPE symbolOuter
ASCH_PIN_ELECTRICAL electrical
ASCH_PIN_SYMBOL::PTYPE symbolInner
ASCH_PIN_SYMBOL::PTYPE symbolInnerEdge
ASCH_RECORD_ORIENTATION orientation
ASCH_PIN(const std::map< wxString, wxString > &aProps)
std::vector< VECTOR2I > points
ASCH_POLYGON(const std::map< wxString, wxString > &aProps)
ASCH_POLYLINE(const std::map< wxString, wxString > &aProps)
ASCH_POLYLINE_LINESTYLE LineStyle
std::vector< VECTOR2I > Points
VECTOR2I Location
ASCH_PORT_IOTYPE IOtype
ASCH_PORT(const std::map< wxString, wxString > &aProps)
wxString HarnessType
ASCH_PORT_ALIGNMENT m_align
ASCH_PORT_STYLE Style
ASCH_POWER_PORT(const std::map< wxString, wxString > &aProps)
ASCH_POWER_PORT_STYLE style
ASCH_RECORD_ORIENTATION orientation
ASCH_RECTANGLE(const std::map< wxString, wxString > &aProps)
ASCH_ROUND_RECTANGLE(const std::map< wxString, wxString > &aProps)
wxString name
int distanceFromTop
ASCH_SHEET_ENTRY(const std::map< wxString, wxString > &aProps)
ASCH_SHEET_ENTRY_SIDE side
ASCH_PORT_IOTYPE iotype
wxString harnessType
ASCH_PORT_STYLE style
ASCH_SHEET_FONT(const std::map< wxString, wxString > &aProps, int aId)
ASCH_SHEET_NAME(const std::map< wxString, wxString > &aProps)
ASCH_RECORD_ORIENTATION orientation
ASCH_SHEET_SYMBOL(const std::map< wxString, wxString > &aProps)
ASCH_SHEET_SIZE sheetSize
ASCH_SHEET_WORKSPACEORIENTATION sheetOrientation
VECTOR2I customSize
ASCH_SHEET(const std::map< wxString, wxString > &aProps)
std::vector< ASCH_SHEET_FONT > fonts
std::vector< VECTOR2I > points
ASCH_SIGNAL_HARNESS(const std::map< wxString, wxString > &aProps)
std::vector< char > data
ASCH_STORAGE_FILE(const std::map< wxString, wxString > &aProps)
wxString componentdescription
ASCH_SYMBOL(const std::map< wxString, wxString > &aProps)
wxString libreference
wxString sourcelibraryname
ASCH_TEMPLATE(const std::map< wxString, wxString > &aProps)
ASCH_TEXT_FRAME_ALIGNMENT Alignment
ASCH_TEXT_FRAME(const std::map< wxString, wxString > &aProps)
ASCH_WIRE(const std::map< wxString, wxString > &aProps)
std::vector< VECTOR2I > points
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683