KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cadstar_pcb_archive_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) 2020 Roberto Fernandez Bautista <[email protected]>
5 * Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
26#ifndef CADSTAR_PCB_ARCHIVE_PARSER_H_
27#define CADSTAR_PCB_ARCHIVE_PARSER_H_
28
29#include <map>
31#include <vector>
32
33//=================================
34// MACRO DEFINITIONS
35//=================================
36#define UNDEFINED_MATERIAL_ID ( MATERIAL_ID ) wxEmptyString
37#define UNDEFINED_PHYSICAL_LAYER ( PHYSICAL_LAYER_ID ) - 1
38
43{
44public:
45 explicit CADSTAR_PCB_ARCHIVE_PARSER( const wxString& aFilename ) :
46 Filename( aFilename ), Header(), Assignments(),
48 {
49 KiCadUnitMultiplier = 10; // assume hundredth micron
50 }
51
52
54 {
55 if( m_rootNode )
56 delete m_rootNode;
57 }
58
64 void Parse( bool aLibrary = false );
65
66 typedef wxString MATERIAL_ID;
67 typedef long PHYSICAL_LAYER_ID;
68 typedef wxString COPPERCODE_ID;
69 typedef wxString PADCODE_ID;
70 typedef wxString VIACODE_ID;
71 typedef wxString SPACINGCODE_ID;
72 typedef wxString LAYERPAIR_ID;
73 typedef wxString RULESET_ID;
74 typedef wxString COMP_AREA_ID;
75 typedef long PAD_ID;
76 typedef wxString DIMENSION_ID;
77 typedef wxString BOARD_ID;
78 typedef wxString AREA_ID;
79 typedef wxString COMPONENT_ID;
80 typedef wxString TEMPLATE_ID;
81 typedef long COPPER_TERM_ID;
82 typedef wxString COPPER_ID;
83 typedef wxString DRILL_TABLE_ID;
84 typedef wxString TRUNK_ID;
85
90 {
94 };
95
96
98 {
100 wxString Name;
105
106 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
107 };
108
109
110 enum class LAYER_TYPE
111 {
112 UNDEFINED,
113 ALLLAYER,
114 ALLELEC,
115 ALLDOC,
116 NOLAYER,
119 ELEC,
120 POWER,
121 NONELEC,
123 DOC
124 };
125
126
127 enum class LAYER_SUBTYPE
128 {
137 };
138
139
140 enum class ROUTING_BIAS
141 {
142 UNBIASED,
143 X,
144 Y,
145 ANTI_ROUTE,
146 OBSTACLE
147 };
148
149
150 enum class EMBEDDING
151 {
152 NONE,
153 ABOVE,
154 BELOW
155 };
156
157
158 struct LAYER : PARSER
159 {
161 wxString Name;
162 wxString Description = wxEmptyString;
171 long Thickness = 0;
174 bool ReferencePlane = false;
175 bool VariantLayer = false;
176
177 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
178 };
179
180
182 {
183 std::map<MATERIAL_ID, MATERIAL> Materials;
184 std::map<LAYER_ID, LAYER> Layers;
185 std::vector<LAYER_ID> LayerStack;
186
187 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
188 };
189
190
192 {
195
196 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
197 };
198
199
201 {
203 wxString Name;
205 std::vector<COPREASSIGN> Reassigns;
206
207 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
208 };
209
210
212 {
214 {
217
218 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
219 };
220
261 std::vector<REASSIGN> Reassigns;
262
263 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
264 };
265
266
267 enum class PAD_SHAPE_TYPE
268 {
269 ANNULUS,
270 BULLET,
271 CIRCLE,
272 DIAMOND,
273 FINGER,
274 OCTAGON,
275 RECTANGLE,
277 SQUARE
278 };
279
280
282 {
288 long OrientAngle = 0;
289
290 static bool IsPadShape( XNODE* aNode );
291 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
292 };
293
294
296 {
299
300 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
301 };
302
303
305 {
307 wxString Name;
311 bool Plated = true;
316 long DrillXoffset = 0;
317 long DrillYoffset = 0;
318
319 std::map<LAYER_ID, CADSTAR_PAD_SHAPE> Reassigns;
320
321 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
322 };
323
324
326 {
329
330 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
331 };
332
333
335 {
337 wxString Name;
343
344 std::map<LAYER_ID, CADSTAR_PAD_SHAPE> Reassigns;
345
346 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
347 };
348
349
351 {
353 wxString Name;
357
358 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
359 };
360
361
363 {
368
369 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
370 };
371
372
374 {
376 wxString Name;
384
385 std::map<SPACINGCODE_ID, SPACINGCODE>
388 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
389 };
390
391
393 {
394 std::map<COPPERCODE_ID, COPPERCODE> CopperCodes;
395 std::map<SPACINGCODE_ID, SPACINGCODE> SpacingCodes;
396 std::map<RULESET_ID, RULESET> Rulesets;
397 std::map<PADCODE_ID, PADCODE> PadCodes;
398 std::map<VIACODE_ID, VIACODE> ViaCodes;
399 std::map<LAYERPAIR_ID, LAYERPAIR>
401 std::vector<SPCCLASSSPACE> SpacingClasses;
402
403 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
404 };
405
406
408 {
414 long MinMitre;
415 long MaxMitre;
421 long ViaGrid;
422
423 bool BackOffJunctions = false;
424 bool BackOffWidthChange = false;
425
426 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
427 };
428
429
431 {
436 bool NetclassEditAttributeSettings = false; //< Unclear what this does
437 bool SpacingclassEditAttributeSettings = false; //< Unclear what this does
438
439 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
440 };
441
447 {
450 SHAPE Shape; //< Uses the component's coordinate frame.
452 std::vector<PAD_ID> AssociatedPadIDs;
453
454 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
455 };
456
464 {
468 SHAPE Shape; //< Uses the component's coordinate frame.
470
471 bool NoTracks = false;
475 bool NoVias = false;
479
480 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
481 };
482
488 enum class PAD_SIDE
489 {
490 MINIMUM,
492 MAXIMUM,
495 };
496
497
498 static PAD_SIDE GetPadSide( const wxString& aPadSideString );
499
518 {
519 bool FreeAngle = false;
520 bool North = false;
521 bool NorthEast = false;
522 bool East = false;
523 bool SouthEast = false;
524 bool South = false;
525 bool SouthWest = false;
526 bool West = false;
527 bool NorthWest = false;
528
529 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
530 };
531
532
534 {
539 long OrientAngle = 0;
541
542 wxString Identifier;
549
550 bool FirstPad = false;
555 bool PCBonlyPad = false;
559
560 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
561 };
562
567 {
568 enum class TYPE
569 {
570 LINEARDIM,
571 LEADERDIM,
572 ANGLEDIM
573 };
574
575
576 enum class SUBTYPE
577 {
578 ORTHOGONAL,
580 DIRECT,
582 ANGLED,
585 DIAMETER,
586 RADIUS,
587 ANGULAR
588 };
589
590
591 struct ARROW : PARSER //"DIMARROW"
592 {
593 enum class STYLE
594 {
595 OPEN,
597 CLOSED,
602 CLEAR,
606 };
607
609 long UpperAngle = 0;
610 long LowerAngle = 0;
611 long ArrowLength = 0;
612
613 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
614 };
615
631 {
632 enum class STYLE
633 {
634 INSIDE,
636 OUTSIDE
638 };
639
641 long TextGap;
644
645 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
646 };
647
648
650 {
652
656 long Offset;
657 bool SuppressFirst = false;
659
660 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
661 };
662
663
664 struct LINE : PARSER
665 {
666 enum class TYPE
667 {
668 LINEARLINE,
669 LEADERLINE,
673 };
674
675 enum class STYLE //DIMLINETYPE
676 {
677 INTERNAL,
679 EXTERNAL
681 };
682
686
690
697
698 static bool IsLine( XNODE* aNode );
699 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
700 };
701
715 bool Fixed = false;
716 GROUP_ID GroupID = wxEmptyString;
719
720 static bool IsDimension( XNODE* aNode );
721 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
722 };
723
728 enum class SYMDEF_TYPE
729 {
730 COMPONENT,
731 JUMPER,
753 STARPOINT,
771 TESTPOINT
779 };
780
781
783 {
785 long SymHeight = 0;
786
787 std::vector<COMPONENT_COPPER> ComponentCoppers;
788 std::map<COMP_AREA_ID, COMPONENT_AREA> ComponentAreas;
789 std::map<PAD_ID, COMPONENT_PAD> ComponentPads;
790 std::map<DIMENSION_ID, DIMENSION> Dimensions;
791
792 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
793 };
794
795
797 {
798 std::map<SYMDEF_ID, SYMDEF_PCB> ComponentDefinitions;
799
800 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
801 };
802
803
805 {
809 std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
810 bool Fixed = false;
811
813 GROUP_ID GroupID = wxEmptyString;
814
817
818 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
819 };
820
828 struct AREA : PARSER
829 {
832 wxString Name;
835
836 //TODO find out what token is used for specifying "Rule Set"
837 RULESET_ID RuleSetID = wxEmptyString;
838
839 bool Fixed = false;
840
841 bool Placement = false;
843 bool Routing = false;
845 bool Keepout = false;
847 bool NoTracks = false;
849 bool NoVias = false;
851
857
858 GROUP_ID GroupID = wxEmptyString;
860 std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
861
862 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
863 };
864
865
866 enum class TESTLAND_SIDE
867 {
868 NONE,
869 MAX,
870 MIN,
871 BOTH
872 };
873
874
875 static TESTLAND_SIDE ParseTestlandSide( XNODE* aNode );
876
877
879 {
881 std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
883
884 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
885 };
886
887
889 {
891 PADCODE_ID PadCode = wxEmptyString;
892 bool OverrideExits = false;
894 bool OverrideSide = false;
897 long OrientAngle = 0;
898
899 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
900 };
901
902
904 {
906 wxString Name;
911
912 GROUP_ID GroupID = wxEmptyString;
915 VARIANT_ID VariantID = wxEmptyString;
916 long OrientAngle = 0;
917 bool TestPoint = false;
919 bool Mirror = false;
920 bool Fixed = false;
922
923 std::map<ATTRIBUTE_ID, TEXT_LOCATION> TextLocations;
926 std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
927 std::map<PART_DEFINITION_PIN_ID, wxString> PinLabels;
931 std::map<PART_DEFINITION_PIN_ID, PIN_ATTRIBUTE> PinAttributes;
932 std::map<PAD_ID, PADEXCEPTION> PadExceptions;
934
935 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
936 };
937
938
939 struct TRUNK : PARSER
940 {
942 wxString Definition; // TODO: more work required to fully parse the TRUNK structure
943
944 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
945 };
946
947
949 {
950 struct PIN : PARSER
951 {
955
956 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
957 };
958
960 {
962
963 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
964 };
965
966 struct VIA : PARSER
967 {
973 GROUP_ID GroupID = wxEmptyString;
976 bool Fixed = false;
977
978 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
979 };
980
982 {
986
987 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
988 };
989
992 {
994 bool TeardropAtStart = false;
995 bool TeardropAtEnd = false;
998 bool Fixed = false;
1000
1002 XNODE* Parse( XNODE* aNode, PARSER_CONTEXT* aContext );
1003 };
1004
1005 struct ROUTE : PARSER
1006 {
1007 LAYER_ID LayerID = wxEmptyString;
1009 std::vector<ROUTE_VERTEX> RouteVertices;
1010
1011 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1012 };
1013
1015 {
1017 bool Unrouted = false;
1021
1022 LAYER_ID UnrouteLayerID = wxEmptyString;
1024
1025 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1026 };
1027
1028 std::map<NETELEMENT_ID, PIN> Pins;
1029 std::map<NETELEMENT_ID, JUNCTION_PCB> Junctions;
1030 std::map<NETELEMENT_ID, VIA> Vias;
1031 std::map<NETELEMENT_ID, COPPER_TERMINAL> CopperTerminals;
1032 std::vector<CONNECTION_PCB> Connections;
1033
1034 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1035 };
1036
1044 {
1046 {
1048 {
1049 FILLED,
1050 HATCHED
1051 };
1052
1058 enum class RELIEF_TYPE
1059 {
1060 CROSS,
1061 CUTOUTS
1064 };
1065
1066
1080
1096
1099 bool AllowInNoRouting = false;
1100 bool BoxIsolatedPins = false;
1101 bool AutomaticRepour = false;
1103
1106 HATCHCODE_ID HatchCodeID = wxEmptyString;
1107
1108 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1109 };
1110
1113 wxString Name;
1118 bool Fixed = false;
1119 GROUP_ID GroupID = wxEmptyString;
1121
1122 std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
1123
1124 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1125 };
1126
1127
1129 {
1131 {
1133 {
1136 bool Fixed = false;
1137
1138 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1139 };
1140
1141 NET_ID NetID = wxEmptyString;
1142 std::map<COPPER_TERM_ID, COPPER_TERM> CopperTerminals;
1143 bool Fixed = false;
1144
1145 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1146 };
1147
1155 bool Fixed = false;
1156 GROUP_ID GroupID = wxEmptyString;
1158
1159 std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
1160
1161 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1162 };
1163
1164
1165 enum class NETSYNCH
1166 {
1167 UNDEFINED,
1168 WARNING,
1169 FULL
1170 };
1171
1172
1174 {
1178 long OrientAngle = 0;
1179 bool Mirror = false;
1180 bool Fixed = false;
1182 GROUP_ID GroupID = wxEmptyString;
1185
1186 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1187 };
1188
1189
1191 {
1193
1194 std::map<GROUP_ID, GROUP> Groups;
1195 std::map<REUSEBLOCK_ID, REUSEBLOCK> ReuseBlocks;
1196
1197 std::map<BOARD_ID, CADSTAR_BOARD> Boards;
1199 std::map<FIGURE_ID, FIGURE> Figures;
1200 std::map<AREA_ID, AREA> Areas;
1201 std::map<COMPONENT_ID, COMPONENT> Components;
1202 std::map<DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOL> DocumentationSymbols;
1203 std::map<TRUNK_ID, TRUNK> Trunks;
1204 std::map<NET_ID, NET_PCB> Nets;
1205 std::map<TEMPLATE_ID, TEMPLATE> Templates;
1206 std::map<COPPER_ID, COPPER> Coppers;
1207 std::map<TEXT_ID, TEXT> Texts;
1208 std::map<DIMENSION_ID, DIMENSION> Dimensions;
1209 std::map<DRILL_TABLE_ID, DRILL_TABLE> DrillTables;
1211
1212 void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1213 };
1214
1215
1216 wxString Filename;
1217
1223
1225
1226private:
1227 XNODE* m_rootNode; // Currently parsed root node
1228
1229}; //CADSTAR_PCB_ARCHIVE_PARSER
1230
1231#endif // CADSTAR_PCB_ARCHIVE_PARSER_H_
Helper functions and common defines between schematic and PCB Archive files.
#define UNDEFINED_LAYER_ID
#define UNDEFINED_MATERIAL_ID
#define UNDEFINED_PHYSICAL_LAYER
Helper functions and common structures for CADSTAR PCB and Schematic archive files.
READABILITY
Sets the readability direction of text.
@ BOTTOM_TO_TOP
When text is vertical, show it rotated 90 degrees anticlockwise.
SWAP_RULE
Corresponds to "Display when" Item property.
@ BOTH
Always display (Mirrored and Unmirrored)
static const long UNDEFINED_VALUE
wxString LAYER_ID
ID of a Sheet (if schematic) or board Layer (if PCB)
long PART_DEFINITION_PIN_ID
Pin identifier in the part definition.
Represents a CADSTAR PCB Archive (CPA) file.
static TESTLAND_SIDE ParseTestlandSide(XNODE *aNode)
SYMDEF_TYPE
A symbol definition can represent a number of different objects in CADSTAR.
@ STARPOINT
From CADSTAR Help: "Starpoints are special symbols/components that can be used to electrically connec...
@ JUMPER
From CADSTAR Help: "Jumpers are components used primarily for the purpose of routing.
@ COMPONENT
Standard PCB Component definition.
@ TESTPOINT
From CADSTAR Help: "A testpoint is an area of copper connected to a net.
@ UNBIASED
Keyword "UNBIASED" (default)
long PAD_ID
Pad identifier (pin) in the PCB.
void Parse(bool aLibrary=false)
Parses the file.
int KiCadUnitMultiplier
Use this value to convert units in this CPA file to KiCad units.
@ UNDEFINED
Only used for error detection.
@ ALLELEC
Inbuilt layer type (cannot be assigned to user layers)
@ ALLDOC
Inbuilt layer type (cannot be assigned to user layers)
@ NONELEC
This type has subtypes.
@ NOLAYER
Inbuilt layer type (cannot be assigned to user layers)
@ JUMPERLAYER
Inbuilt layer type (cannot be assigned to user layers)
@ ALLLAYER
Inbuilt layer type (cannot be assigned to user layers)
@ ASSCOMPCOPP
Inbuilt layer type (cannot be assigned to user layers)
CADSTAR_PCB_ARCHIVE_PARSER(const wxString &aFilename)
@ MAX
The highest PHYSICAL_LAYER_ID currently defined (i.e. back / bottom side).
@ MIN
The lowest PHYSICAL_LAYER_ID currently defined (i.e. front / top side).
MATERIAL_LAYER_TYPE
Type of layer appropriate for the material being set up.
static PAD_SIDE GetPadSide(const wxString &aPadSideString)
PAD_SIDE
From CADSTAR Help: "This parameter indicates the physical layers on which the selected pad is placed.
@ MAXIMUM
The highest PHYSICAL_LAYER_ID currently defined (i.e.
@ MINIMUM
PHYSICAL_LAYER_ID 1 (i.e.
@ THROUGH_HOLE
All physical layers currently defined.
Hold an XML or S-expression element.
Definition: xnode.h:44
Represents a floating value in E notation.
Represents a point in x,y coordinates.
References an element from a design reuse block.
Represents a vertex in a shape.
From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are...
GROUP_ID GroupID
If not empty, this AREA is part of a group.
bool Keepout
From CADSTAR Help: "Auto Placement cannot place components within this area.
bool Placement
From CADSTAR Help: "Auto Placement can place components within this area.
bool NoVias
From CADSTAR Help: "No vias will be placed within this area by the automatic router.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long AreaHeight
From CADSTAR Help: "The Height value specified for the PCB component is checked against the Height va...
bool Routing
From CADSTAR Help: "Area can be used to place routes during Automatic Routing.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
bool NoTracks
From CADSTAR Help: "Area cannot be used to place routes during automatic routing.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
Normally CADSTAR_BOARD cannot be part of a reuseblock, but included for completeness.
bool Fixed
If not empty, this CADSTAR_BOARD is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< COPPERCODE_ID, COPPERCODE > CopperCodes
std::map< RULESET_ID, RULESET > Rulesets
Used for area design rules.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< SPACINGCODE_ID, SPACINGCODE > SpacingCodes
Spacing Design Rules.
std::map< LAYERPAIR_ID, LAYERPAIR > LayerPairs
Default vias to use between pairs of layers.
From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool NoVias
From CADSTAR Help: "Check this button to specify that any area created by the Rectangle,...
bool NoTracks
From CADSTAR Help: "Check this button to specify that any area created by the Rectangle,...
A shape of copper in the component footprint.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool PCBonlyPad
From CADSTAR Help: "The PCB Only Pad property can be used to stop ECO Update, Back Annotation,...
POINT Position
Pad position within the component's coordinate frame.
wxString Identifier
This is an identifier that is displayed to the user.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool FirstPad
From CADSTAR Help: "Only one pad can have this property; if an existing pad in the design already has...
wxString Name
Designator e.g. "C1", "R1", etc.
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
bool TestPoint
Indicates whether this component should be treated as a testpoint.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
std::map< PAD_ID, PADEXCEPTION > PadExceptions
Override pad definitions for this instance.
std::map< ATTRIBUTE_ID, TEXT_LOCATION > TextLocations
This contains location of any attributes, including designator position.
std::map< PART_DEFINITION_PIN_ID, PIN_ATTRIBUTE > PinAttributes
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this component is part of a group.
std::map< PART_DEFINITION_PIN_ID, wxString > PinLabels
This is inherited from the PARTS library but is allowed to be out of sync.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< COPPER_TERM_ID, COPPER_TERM > CopperTerminals
GROUP_ID GroupID
If not empty, this COPPER is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
TEMPLATE_ID PouredTemplateID
If not empty, it means this COPPER is part of a poured template.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
@ CLOSED
The arrow head is made up of two angled lines either side of main line plus two other lines perpendic...
@ CLEAR
Same as closed but the main line finishes at the start of the perpendicular lines.
@ CLOSED_FILLED
The same as CLOSED or CLEAR arrows, but with a solid fill "DIMENSION_ARROWCLOSEDFILLED".
@ OPEN
The arrow head is made up of two angled lines either side of main line.
long ArrowLength
The length of the angled lines that make up the arrow head.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool SuppressFirst
If true, excludes the first extension line (only shows extension line at end)
long Overshoot
Overshoot of the extension line past the arrow line.
< Token can be either "LEADERLINE", "LINEARLINE" or "ANGULARLINE"
@ INTERNAL
The lines are placed inside the measurement token=DIMENSION_INTERNAL.
@ EXTERNAL
The lines are placed outside the measurement (typically used when limited space) token=DIMENSION_EXTE...
@ LEADERLINE
Only for dimensions of type LEADERRDIM.
@ LINEARLINE
Only for dimensions of type LINEARDIM.
@ ANGULARLINE
Only for dimensions of type ANGULARDIM.
long LeaderLineExtensionLength
Only for TYPE=LEADERLINE Length of the horizontal part of the leader line [param6].
long LeaderLineLength
Only for TYPE=LEADERLINE Length of the angled part of the leader line [param5].
long LeaderAngle
Only for TYPE=LEADERLINE subnode "LEADERANG".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
POINT Centre
Only for TYPE=ANGULARLINE [point3].
Contains formatting specific for a CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION object.
long TextGap
Specifies the gap between the text and the end of the line.
long TextOffset
Specifies how far above the line the text is (doesn't have an effect on actual position!...
@ INSIDE
Embedded with the line (the Gap parameter specifies the gap between the text and the end of the line)...
@ OUTSIDE
Above the line (the Offset parameter specifies how far above the line the text is) DIMENSION_EXTERNAL...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Linear, leader (radius/diameter) or angular dimension.
LAYER_ID LayerID
ID on which to draw this [param1].
@ DIRECT
A linear dimension parallel to measurement with perpendicular extension lines token=DIMENSION_DIRECT.
@ ORTHOGONAL
An orthogonal dimension (either x or y measurement) token=DIMENSION_ORTHOGONAL.
@ ANGLED
A linear dimension parallel to measurement but with orthogonal extension lines (i....
GROUP_ID GroupID
If not empty, this DIMENSION is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
EXTENSION_LINE ExtensionLineParams
Not applicable to TYPE=LEADERDIM.
DIMENSION_ID ID
Some ID (doesn't seem to be used) subnode="DIMREF".
@ LEADERDIM
Typically used for Radius/Diameter Dimension.
long Precision
Number of decimal points to display in the measurement [param3].
ANGUNITS AngularUnits
Only Applicable to TYPE=ANGLEDIM.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this DRILL_TABLE is part of a group.
std::map< MATERIAL_ID, MATERIAL > Materials
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
PHYSICAL_LAYER_ID PhysicalLayer
If UNDEFINED, no physical layer is assigned (e.g.
LAYER_ID SwapLayerID
If UNDEFINED_LAYER_ID, no swap layer.
long Thickness
Note: Units of length are defined in file header.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< TEMPLATE_ID, TEMPLATE > Templates
std::map< BOARD_ID, CADSTAR_BOARD > Boards
Normally CADSTAR only allows one board but.
std::map< NET_ID, NET_PCB > Nets
Contains tracks and vias.
std::map< COMPONENT_ID, COMPONENT > Components
std::map< DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOL > DocumentationSymbols
std::map< DIMENSION_ID, DIMENSION > Dimensions
std::map< REUSEBLOCK_ID, REUSEBLOCK > ReuseBlocks
std::map< DRILL_TABLE_ID, DRILL_TABLE > DrillTables
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< SYMDEF_ID, SYMDEF_PCB > ComponentDefinitions
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool Unrouted
Instead of a ROUTE, the CONNECTION might have an "UNROUTE" token.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
< "PIN" nodename (represents a PAD in a PCB component)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
NETELEMENT_ID ID
First character is "P".
< Two sibbling nodes: first node being "ROUTEWIDTH" and next node being a VERTEX (e....
XNODE * Parse(XNODE *aNode, PARSER_CONTEXT *aContext)
VERTEX Vertex
Returns a pointer to the last node.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this VIA is part of a group.
NETELEMENT_ID ID
First character is "V".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< NETELEMENT_ID, COPPER_TERMINAL > CopperTerminals
std::map< NETELEMENT_ID, JUNCTION_PCB > Junctions
long ReliefWidth
if undefined inherits from design
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< LAYER_ID, CADSTAR_PAD_SHAPE > Reassigns
long ReliefClearance
if undefined inherits from design
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
PADCODE_ID PadCode
If not empty, override padcode.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
From CADSTAR help: "For specifying the directions in which routes can enter or exit the pad.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
ROUTECODE_ID AreaRouteCodeID
For assigning a net route code to a rule set.
VIACODE_ID AreaViaCodeID
For assigning a via code to a rule set.
std::map< SPACINGCODE_ID, SPACINGCODE > SpacingCodes
Overrides these spacing rules in the specific area.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::vector< REASSIGN > Reassigns
Can have different spacings on different layers.
SPACINGCODE_ID ID
Possible spacing rules:
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
LAYER_ID LayerID
Normally LAY0, which corresponds to (All Layers)
std::map< PAD_ID, COMPONENT_PAD > ComponentPads
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< DIMENSION_ID, DIMENSION > Dimensions
inside "DIMENSIONS" subnode
std::vector< COMPONENT_COPPER > ComponentCoppers
long SymHeight
The Height of the component (3D height in z direction)
std::map< COMP_AREA_ID, COMPONENT_AREA > ComponentAreas
long MinRouteWidth
Manufacturing Design Rule. Corresponds to "Thin Route Width".
long TrackGrid
Grid for Routes (equal X and Y steps)
long MaxPhysicalLayer
Should equal number of copper layers.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long MaxMitre
Manufacturing Design Rule. Corresponds to "Maximum Mitre".
long ViaGrid
Grid for Vias (equal X and Y steps)
long MinMitre
Manufacturing Design Rule. Corresponds to "Minimum Mitre".
long AdditionalIsolation
This is the gap to apply in routes and pads in addition to the existing pad-to-copper or route-to-cop...
bool TargetForAutorouting
true when subnode "AUTOROUTETARGET" is present
bool ThermalReliefOnVias
false when subnode "NOVIARELIEF" is present
RELIEF_TYPE
From CADSTAR Help: "With this parameter you can select one of two ways in which to generate thermal r...
@ CROSS
This method applies short copper stubs to form a cross. (default)
@ CUTOUTS
This method uses four cutouts in the copper to leave the reliefs required.
HATCHCODE_ID HatchCodeID
Only for FillType = HATCHED.
bool ThermalReliefOnPads
false when subnode "NOPINRELIEF" is present
long ThermalReliefPadsAngle
Orientation for the thermal reliefs.
long MinDisjointCopper
The value is the length of one side of a notional square.
bool AutomaticRepour
true when subnode "REGENERATE" is present
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool AllowInNoRouting
true when subnode "IGNORETRN" is present
bool BoxIsolatedPins
true when subnode "BOXPINS" is present
long ClearanceWidth
Specifies the space around pads when pouring (i.e.
COPPERCODE_ID ReliefCopperCodeID
From CADSTAR Help: "Relief Copper Code is for selecting the width of line used to draw the thermal re...
COPPERCODE_ID CopperCodeID
From CADSTAR Help: "Copper Code is for selecting the width of the line used to draw the outline and f...
long ThermalReliefViasAngle
Disabled when !ThermalReliefOnVias (param6)
long MinIsolatedCopper
The value is the length of one side of a notional square.
long SliverWidth
Minimum width of copper that may be created.
Templates are CADSTAR's equivalent to a "filled zone".
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
POURING Pouring
Copper pour settings (e.g. relief / hatching /etc.)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this TEMPLATE is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long ReliefClearance
if undefined inherits from design
long ReliefWidth
if undefined inherits from design
std::map< LAYER_ID, CADSTAR_PAD_SHAPE > Reassigns
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override