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, 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#include <wx/string.h>
35
36// this constant specifies a item which is not inside an component
37const int ALTIUM_COMPONENT_NONE = -1;
38
40
42{
43 wxString filename;
44 std::vector<char> data;
45
46 explicit ASCH_STORAGE_FILE( const std::map<wxString, wxString>& aProps );
47 explicit ASCH_STORAGE_FILE( ALTIUM_BINARY_PARSER& aReader );
48};
49
51{
52 wxString FileName;
53 std::vector<char> Data;
54
55 explicit ASCH_ADDITIONAL_FILE( ALTIUM_BINARY_PARSER& aReader );
56};
57
110
111
113{
114 RIGHTWARDS = 0, // 0
115 UPWARDS = 1, // 90
116 LEFTWARDS = 2, // 180
117 DOWNWARDS = 3 // 270
118};
119
120
122{
128
129 explicit ASCH_OWNER_INTERFACE( const std::map<wxString, wxString>& aProps );
130};
131
133{
137
138 explicit ASCH_FILL_INTERFACE( const std::map<wxString, wxString>& aProps );
139};
140
142{
144 int Color;
145
146 explicit ASCH_BORDER_INTERFACE( const std::map<wxString, wxString>& aProps );
147};
148
149
151{
154 wxString uniqueid;
155 wxString libreference;
158
162
166
167 explicit ASCH_SYMBOL( const std::map<wxString, wxString>& aProps );
168};
169
170
172{
173 wxString filename;
174
175 explicit ASCH_TEMPLATE( const std::map<wxString, wxString>& aProps );
176};
177
178
180{
185 CLOCK = 3,
189 // 7 is missing
192 HIZ = 10,
194 PULSE = 12,
196 // 14-16 missing
198 // 18-21 missing
203 // 26-29 missing
205 // 31 is missing
208 BIDI = 34
209};
210
212{
213public:
214 enum PTYPE
215 {
220 CLOCK = 3,
224 // 7 is missing
227 HIZ = 10,
229 PULSE = 12,
231 // 14-16 missing
233 // 18-21 missing
238 // 26-29 missing
240 // 31 is missing
243 BIDI = 34
244 };
245
246 static PTYPE FromInt( int aInt )
247 {
248 switch( aInt )
249 {
250 case 0:
251 return NO_SYMBOL;
252 case 1:
253 return NEGATED;
254 case 2:
255 return RIGHTLEFT;
256 case 3:
257 return CLOCK;
258 case 4:
259 return LOW_INPUT;
260 case 5:
261 return ANALOG_IN;
262 case 6:
263 return NOLOGICCONNECT;
264 case 8:
265 return POSTPONE_OUTPUT;
266 case 9:
267 return OPEN_COLLECTOR;
268 case 10:
269 return HIZ;
270 case 11:
271 return HIGH_CURRENT;
272 case 12:
273 return PULSE;
274 case 13:
275 return SCHMITT;
276 case 17:
277 return LOW_OUTPUT;
278 case 22:
280 case 23:
281 return OPEN_EMITTER;
282 case 24:
284 case 25:
285 return DIGITAL_IN;
286 case 30:
287 return SHIFT_LEFT;
288 case 32:
289 return OPEN_OUTPUT;
290 case 33:
291 return LEFTRIGHT;
292 case 34:
293 return BIDI;
294 default:
295 return UNKNOWN;
296 }
297 }
298};
299
300
314
315
343
344
359
360
362{
363 LEFT = 1,
366};
367
368
370{
372 RIGHT = 1,
374};
375
376
378{
380
381 wxString text;
383
386
389
390 explicit ASCH_LABEL( const std::map<wxString, wxString>& aProps );
391};
392
394{
395 wxString url;
396
397 explicit ASCH_HYPERLINK( const std::map<wxString, wxString>& aProps );
398};
399
400
402{
405
406 // have both coordinates, for convenience
409
410 wxString Text;
411
412 bool IsWordWrapped; // to do when kicad supports this
414
416 int TextMargin; // to do when kicad supports this
422
424
425 explicit ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProps );
426};
427
428
430{
431 wxString author;
432
433 explicit ASCH_NOTE( const std::map<wxString, wxString>& aProperties );
434};
435
436
438{
439 std::vector<VECTOR2I> points;
440
441 explicit ASCH_BEZIER( const std::map<wxString, wxString>& aProps );
442};
443
444
452
453
455{
456 LEFT = 0,
457 RIGHT = 1,
458 TOP = 2,
460};
461
462
464{
465 std::vector<VECTOR2I> Points;
466
468
469 explicit ASCH_POLYLINE( const std::map<wxString, wxString>& aProps );
470};
471
472
474{
475 std::vector<VECTOR2I> points;
476
477 explicit ASCH_POLYGON( const std::map<wxString, wxString>& aProps );
478};
479
480
490
491
493{
500
501 explicit ASCH_ARC( const std::map<wxString, wxString>& aProps );
502};
503
504
506{
507 explicit ASCH_PIECHART( const std::map<wxString, wxString>& aProps );
508};
509
510
512{
516
517 explicit ASCH_ELLIPSE( const std::map<wxString, wxString>& aProps );
518};
519
520
522{
525
527
528 explicit ASCH_LINE( const std::map<wxString, wxString>& aProps );
529};
530
531
533{
536
537 std::vector<VECTOR2I> points;
538
539 int color;
541
542 explicit ASCH_SIGNAL_HARNESS( const std::map<wxString, wxString>& aProps );
543};
544
545
559
560
562{
564 int Color;
569
570 bool OwnerIndexAdditionalList; // what is that?
571
572 wxString Name;
574
575 explicit ASCH_HARNESS_ENTRY( const std::map<wxString, wxString>& aProps );
576};
577
578
580{
581 int Color;
583
585 bool OwnerIndexAdditionalList; // what is that?
586
588
589 wxString Text;
590
591 explicit ASCH_HARNESS_TYPE( const std::map<wxString, wxString>& aProps );
592};
593
594
596{
599
600 explicit ASCH_RECTANGLE( const std::map<wxString, wxString>& aProps );
601};
602
603
605{
608
610
611 int color;
613
614 explicit ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProps );
615};
616
617
619{
623 BIDI = 3,
624};
625
626
638
639
641{
643
647
648 wxString name;
649
650 explicit ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProps );
651};
652
653
670
671
673{
674 wxString text;
676
680
681 explicit ASCH_POWER_PORT( const std::map<wxString, wxString>& aProps );
682};
683
684
686{
687 wxString Name;
688 wxString HarnessType;
689
691 int Width;
694 int Color;
697
699
702
703 explicit ASCH_PORT( const std::map<wxString, wxString>& aProps );
704};
705
706
708{
710
713
714 explicit ASCH_NO_ERC( const std::map<wxString, wxString>& aProps );
715};
716
717
719{
720 wxString text;
721
723
726
727 explicit ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps );
728};
729
730
732{
734
735 std::vector<VECTOR2I> points;
736
737 explicit ASCH_BUS( const std::map<wxString, wxString>& aProps );
738};
739
740
742{
744
745 std::vector<VECTOR2I> points;
746
747 explicit ASCH_WIRE( const std::map<wxString, wxString>& aProps );
748};
749
750
752{
754
755 explicit ASCH_JUNCTION( const std::map<wxString, wxString>& aProps );
756};
757
758
760{
761 wxString filename;
764
767
768 explicit ASCH_IMAGE( const std::map<wxString, wxString>& aProps );
769};
770
771
773{
774 wxString FontName;
775
776 int Size;
779
780 bool Italic;
781 bool Bold;
783
784 explicit ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProps, int aId );
785};
786
787
789{
790 UNKNOWN = -1, // use A4
791
792 A4 = 0, // 1150 × 760
793 A3 = 1, // 1550 × 1110
794 A2 = 2, // 2230 × 1570
795 A1 = 3, // 3150 × 2230
796 A0 = 4, // 4460 × 3150
797 A = 5, // 950 × 750
798 B = 6, // 1500 × 950
799 C = 7, // 2000 × 1500
800 D = 8, // 3200 × 2000
801 E = 9, // 4200 × 3200
802 LETTER = 10, // 1100 × 850
803 LEGAL = 11, // 1400 × 850
804 TABLOID = 12, // 1700 × 1100
805 ORCAD_A = 13, // 990 × 790
806 ORCAD_B = 14, // 1540 × 990
807 ORCAD_C = 15, // 2060 × 1560
808 ORCAD_D = 16, // 3260 × 2060
809 ORCAD_E = 17 // 4280 × 3280
810};
811
813
814
820
821
823{
824 std::vector<ASCH_SHEET_FONT> fonts;
825
828
831
832 explicit ASCH_SHEET( const std::map<wxString, wxString>& aProps );
833};
834
835
837{
838 wxString text;
839
842
844
845 explicit ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProps );
846};
847
848
850{
851 wxString text;
852
855
857
858 explicit ASCH_FILE_NAME( const std::map<wxString, wxString>& aProps );
859};
860
861
863{
864 wxString name;
865 wxString text;
867
871
872 explicit ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProps );
873};
874
875
877{
878 wxString name;
879 wxString type;
880 wxString libname;
881 wxString description;
883
884 explicit ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProps );
885};
886
887
889{
890 explicit ASCH_IMPLEMENTATION_LIST( const std::map<wxString, wxString>& aProps );
891};
892
893
895{
898
899 explicit ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProps );
900};
901
902
904{
908
909 wxString name;
910 wxString text;
911
916
917 explicit ASCH_PARAMETER( const std::map<wxString, wxString>& aProps );
918};
919
920#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 footprint information found in a netlist.
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
Definition line.h:36
@ SOLID
Definition eda_shape.h:70
std::chrono::steady_clock CLOCK
#define D(x)
Definition ptree.cpp:41
@ 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
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:695