KiCad PCB EDA Suite
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-2021 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 {
44 public:
45  explicit CADSTAR_PCB_ARCHIVE_PARSER( const wxString& aFilename )
46  : Filename( aFilename ), Header(), Assignments(), CADSTAR_ARCHIVE_PARSER()
47  {
48  KiCadUnitMultiplier = 10; // assume hundredth micron
49  }
50 
56  void Parse();
57 
58  typedef wxString MATERIAL_ID;
59  typedef long PHYSICAL_LAYER_ID;
60  typedef wxString COPPERCODE_ID;
61  typedef wxString PADCODE_ID;
62  typedef wxString VIACODE_ID;
63  typedef wxString SPACINGCODE_ID;
64  typedef wxString LAYERPAIR_ID;
65  typedef wxString RULESET_ID;
66  typedef wxString COMP_AREA_ID;
67  typedef long PAD_ID;
68  typedef wxString DIMENSION_ID;
69  typedef wxString BOARD_ID;
70  typedef wxString AREA_ID;
71  typedef wxString COMPONENT_ID;
72  typedef wxString TEMPLATE_ID;
73  typedef long COPPER_TERM_ID;
74  typedef wxString COPPER_ID;
75  typedef wxString DRILL_TABLE_ID;
76  typedef wxString TRUNK_ID;
77 
82  {
84  ELECTRICAL,
86  };
87 
88 
89  struct MATERIAL : PARSER
90  {
92  wxString Name;
94  EVALUE Permittivity;
95  EVALUE LossTangent;
96  EVALUE Resistivity;
97 
98  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
99  };
100 
101 
102  enum class LAYER_TYPE
103  {
104  UNDEFINED,
105  ALLLAYER,
106  ALLELEC,
107  ALLDOC,
108  NOLAYER,
109  ASSCOMPCOPP,
110  JUMPERLAYER,
111  ELEC,
112  POWER,
113  NONELEC,
114  CONSTRUCTION,
115  DOC
116  };
117 
118 
119  enum class LAYER_SUBTYPE
120  {
129  };
130 
131 
132  enum class ROUTING_BIAS
133  {
134  UNBIASED,
135  X,
136  Y,
137  ANTI_ROUTE,
138  OBSTACLE
139  };
140 
141 
142  enum class EMBEDDING
143  {
144  NONE,
145  ABOVE,
146  BELOW
147  };
148 
149 
150  struct LAYER : PARSER
151  {
153  wxString Name;
154  wxString Description = wxEmptyString;
163  long Thickness = 0;
166  bool ReferencePlane = false;
167  bool VariantLayer = false;
168 
169  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
170  };
171 
172 
173  struct LAYERDEFS : PARSER
174  {
175  std::map<MATERIAL_ID, MATERIAL> Materials;
176  std::map<LAYER_ID, LAYER> Layers;
177  std::vector<LAYER_ID> LayerStack;
178 
179  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
180  };
181 
182 
183  struct COPREASSIGN : PARSER
184  {
187 
188  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
189  };
190 
191 
192  struct COPPERCODE : PARSER
193  {
195  wxString Name;
197  std::vector<COPREASSIGN> Reassigns;
198 
199  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
200  };
201 
202 
203  struct SPACINGCODE : PARSER
204  {
205  struct REASSIGN : PARSER
206  {
208  long Spacing;
209 
210  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
211  };
212 
252  long Spacing;
253  std::vector<REASSIGN> Reassigns;
254 
255  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
256  };
257 
258 
259  enum class PAD_SHAPE_TYPE
260  {
261  ANNULUS,
262  BULLET,
263  CIRCLE,
264  DIAMOND,
265  FINGER,
266  OCTAGON,
267  RECTANGLE,
268  ROUNDED_RECT,
269  SQUARE
270  };
271 
272 
273  struct CADSTAR_PAD_SHAPE : PARSER
274  {
280  long OrientAngle = 0;
281 
282  static bool IsPadShape( XNODE* aNode );
283  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
284  };
285 
286 
287  struct PADREASSIGN : PARSER
288  {
291 
292  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
293  };
294 
295 
296  struct PADCODE : PARSER
297  {
299  wxString Name;
303  bool Plated = true;
307  long SlotOrientation = 0;
308  long DrillXoffset = 0;
309  long DrillYoffset = 0;
310 
311  std::map<LAYER_ID, CADSTAR_PAD_SHAPE> Reassigns;
312 
313  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
314  };
315 
316 
317  struct VIAREASSIGN : PARSER
318  {
321 
322  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
323  };
324 
325 
326  struct VIACODE : PARSER
327  {
329  wxString Name;
335 
336  std::map<LAYER_ID, CADSTAR_PAD_SHAPE> Reassigns;
337 
338  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
339  };
340 
341 
342  struct LAYERPAIR : PARSER
343  {
345  wxString Name;
349 
350  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
351  };
352 
353 
354  struct SPCCLASSSPACE : PARSER
355  {
359  long Spacing;
360 
361  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
362  };
363 
364 
365  struct RULESET : PARSER
366  {
368  wxString Name;
374 
377  std::map<SPACINGCODE_ID, SPACINGCODE>
379  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
381  };
382 
383 
385  {
386  std::map<COPPERCODE_ID, COPPERCODE> CopperCodes;
387  std::map<SPACINGCODE_ID, SPACINGCODE> SpacingCodes;
388  std::map<RULESET_ID, RULESET> Rulesets;
389  std::map<PADCODE_ID, PADCODE> PadCodes;
390  std::map<VIACODE_ID, VIACODE> ViaCodes;
391  std::map<LAYERPAIR_ID, LAYERPAIR>
393  std::vector<SPCCLASSSPACE> SpacingClasses;
394 
395  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
396  };
397 
398 
400  {
403  long MinUnneckedLength;
405  long MinMitre;
407  long MaxMitre;
409  long TrackGrid;
413  long ViaGrid;
414 
415  bool BackOffJunctions = false;
416  bool BackOffWidthChange = false;
417 
418  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
419  };
420 
421 
422  struct ASSIGNMENTS : PARSER
423  {
428  bool NetclassEditAttributeSettings = false; //< Unclear what this does
429  bool SpacingclassEditAttributeSettings = false; //< Unclear what this does
430 
431  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
432  };
433 
439  {
442  SHAPE Shape; //< Uses the component's coordinate frame.
444  std::vector<PAD_ID> AssociatedPadIDs;
445 
446  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
447  };
448 
455  struct COMPONENT_AREA : PARSER
456  {
460  SHAPE Shape; //< Uses the component's coordinate frame.
462 
463  bool NoTracks = false;
464  bool NoVias = false;
468 
472  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
473  };
474 
480  enum class PAD_SIDE
481  {
482  MINIMUM,
483  MAXIMUM,
485  THROUGH_HOLE
487  };
488 
489 
490  static PAD_SIDE GetPadSide( const wxString& aPadSideString );
491 
509  struct PAD_EXITS : PARSER
510  {
511  bool FreeAngle = false;
512  bool North = false;
513  bool NorthEast = false;
514  bool East = false;
515  bool SouthEast = false;
516  bool South = false;
517  bool SouthWest = false;
518  bool West = false;
519  bool NorthWest = false;
520 
521  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
522  };
523 
524 
525  struct COMPONENT_PAD : PARSER
526  {
531  long OrientAngle = 0;
533 
534  wxString Identifier;
535 
542  bool FirstPad = false;
543  bool PCBonlyPad = false;
548 
552  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
553  };
554 
558  struct DIMENSION : PARSER
559  {
560  enum class TYPE
561  {
562  LINEARDIM,
563  LEADERDIM,
564  ANGLEDIM
565  };
566 
567 
568  enum class SUBTYPE
569  {
570  ORTHOGONAL,
571  DIRECT,
573  ANGLED,
575  DIAMETER,
578  RADIUS,
579  ANGULAR
580  };
581 
582 
583  struct ARROW : PARSER //"DIMARROW"
584  {
585  enum class STYLE
586  {
587  OPEN,
588  CLOSED,
590  CLEAR,
597  };
599 
601  long UpperAngle;
602  long LowerAngle;
603  long ArrowLength;
604 
605  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
606  };
607 
622  struct TEXTFORMAT : PARSER
623  {
624  enum class STYLE
625  {
626  INSIDE,
627  OUTSIDE
629  };
631 
633  long TextGap;
634  long TextOffset;
635 
637  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
638  };
639 
640 
642  {
644 
647  long Overshoot;
648  long Offset;
649  bool SuppressFirst = false;
650 
652  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
653  };
654 
655 
656  struct LINE : PARSER
657  {
658  enum class TYPE
659  {
660  LINEARLINE,
661  LEADERLINE,
662  ANGULARLINE
665  };
666 
667  enum class STYLE //DIMLINETYPE
668  {
669  INTERNAL,
670  EXTERNAL
672  };
674 
678 
682 
687 
690  static bool IsLine( XNODE* aNode );
691  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
692  };
693 
698  long Precision;
707  bool Fixed = false;
708  GROUP_ID GroupID = wxEmptyString;
711 
712  static bool IsDimension( XNODE* aNode );
713  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
714  };
715 
720  enum class SYMDEF_TYPE
721  {
722  COMPONENT,
723  JUMPER,
724  STARPOINT,
746  TESTPOINT
764  };
772 
773 
775  {
777  long SymHeight = 0;
778 
779  std::vector<COMPONENT_COPPER> ComponentCoppers;
780  std::map<COMP_AREA_ID, COMPONENT_AREA> ComponentAreas;
781  std::map<PAD_ID, COMPONENT_PAD> ComponentPads;
782  std::map<DIMENSION_ID, DIMENSION> Dimensions;
783 
784  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
785  };
786 
787 
788  struct LIBRARY : PARSER
789  {
790  std::map<SYMDEF_ID, SYMDEF_PCB> ComponentDefinitions;
791 
792  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
793  };
794 
795 
796  struct CADSTAR_BOARD : PARSER
797  {
801  std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
802  bool Fixed = false;
803 
805  GROUP_ID GroupID = wxEmptyString;
806 
809 
810  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
811  };
812 
820  struct AREA : PARSER
821  {
824  wxString Name;
827 
828  //TODO find out what token is used for specifying "Rule Set"
829  RULESET_ID RuleSetID = wxEmptyString;
830 
831  bool Fixed = false;
832 
833  bool Placement = false;
834  bool Routing = false;
836  bool Keepout = false;
838  bool NoTracks = false;
840  bool NoVias = false;
842 
845 
850  GROUP_ID GroupID = wxEmptyString;
852  std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
853 
854  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
855  };
856 
857 
858  enum class TESTLAND_SIDE
859  {
860  NONE,
861  MAX,
862  MIN,
863  BOTH
864  };
865 
866 
867  static TESTLAND_SIDE ParseTestlandSide( XNODE* aNode );
868 
869 
870  struct PIN_ATTRIBUTE : PARSER
871  {
873  std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
875 
876  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
877  };
878 
879 
880  struct PADEXCEPTION : PARSER
881  {
883  PADCODE_ID PadCode = wxEmptyString;
884  bool OverrideExits = false;
886  bool OverrideSide = false;
888  bool OverrideOrientation = false;
889  long OrientAngle = 0;
890 
891  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
892  };
893 
894 
895  struct COMPONENT : PARSER
896  {
898  wxString Name;
902 
904  GROUP_ID GroupID = wxEmptyString;
907  VARIANT_ID VariantID = wxEmptyString;
908  long OrientAngle = 0;
909  bool TestPoint = false;
910  bool Mirror = false;
912  bool Fixed = false;
914 
915  std::map<ATTRIBUTE_ID, TEXT_LOCATION> TextLocations;
916  std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
919  std::map<PART_DEFINITION_PIN_ID, wxString> PinLabels;
920  std::map<PART_DEFINITION_PIN_ID, PIN_ATTRIBUTE> PinAttributes;
924  std::map<PAD_ID, PADEXCEPTION> PadExceptions;
925 
927  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
928  };
929 
930 
931  struct TRUNK : PARSER
932  {
934  wxString Definition; // TODO: more work required to fully parse the TRUNK structure
935 
936  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
937  };
938 
939 
941  {
942  struct PIN : PARSER
943  {
947 
948  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
949  };
950 
952  {
954 
955  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
956  };
957 
958  struct VIA : PARSER
959  {
963  POINT Location;
965  GROUP_ID GroupID = wxEmptyString;
966  REUSEBLOCKREF ReuseBlockRef;
968  bool Fixed = false;
969 
970  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
971  };
972 
974  {
978 
979  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
980  };
981 
982  struct ROUTE_VERTEX
983  {
986  bool Fixed = false;
987  VERTEX Vertex;
988 
990  XNODE* Parse( XNODE* aNode, PARSER_CONTEXT* aContext );
991  };
992 
993  struct ROUTE : PARSER
994  {
995  LAYER_ID LayerID = wxEmptyString;
996  POINT StartPoint;
997  std::vector<ROUTE_VERTEX> RouteVertices;
998 
999  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1000  };
1001 
1003  {
1005  bool Unrouted = false;
1006 
1010  LAYER_ID UnrouteLayerID = wxEmptyString;
1012 
1013  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1014  };
1015 
1016  std::map<NETELEMENT_ID, PIN> Pins;
1017  std::map<NETELEMENT_ID, JUNCTION_PCB> Junctions;
1018  std::map<NETELEMENT_ID, VIA> Vias;
1019  std::map<NETELEMENT_ID, COPPER_TERMINAL> CopperTerminals;
1020  std::vector<CONNECTION_PCB> Connections;
1021 
1022  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1023  };
1024 
1031  struct TEMPLATE : PARSER
1032  {
1033  struct POURING : PARSER
1034  {
1035  enum class COPPER_FILL_TYPE
1036  {
1037  FILLED,
1038  HATCHED
1039  };
1040 
1046  enum class RELIEF_TYPE
1047  {
1048  CROSS,
1049  CUTOUTS
1050  };
1053 
1054 
1062 
1070  long SliverWidth;
1073  long ThermalReliefPadsAngle;
1076  long ThermalReliefViasAngle;
1082 
1085  bool ThermalReliefOnPads = true;
1086  bool ThermalReliefOnVias = true;
1087  bool AllowInNoRouting = false;
1088  bool BoxIsolatedPins = false;
1089  bool AutomaticRepour = false;
1090  bool TargetForAutorouting = false;
1091 
1094  HATCHCODE_ID HatchCodeID = wxEmptyString;
1095 
1096  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1097  };
1098 
1101  wxString Name;
1106  bool Fixed = false;
1107  GROUP_ID GroupID = wxEmptyString;
1109 
1110  std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
1111 
1112  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1113  };
1114 
1115 
1116  struct COPPER : PARSER
1117  {
1118  struct NETREF : PARSER
1119  {
1120  struct COPPER_TERM : PARSER
1121  {
1123  POINT Location;
1124  bool Fixed = false;
1125 
1126  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1127  };
1128 
1129  NET_ID NetID = wxEmptyString;
1130  std::map<COPPER_TERM_ID, COPPER_TERM> CopperTerminals;
1131  bool Fixed = false;
1132 
1133  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1134  };
1135 
1141  TEMPLATE_ID PouredTemplateID = wxEmptyString;
1142  bool Fixed = false;
1144  GROUP_ID GroupID = wxEmptyString;
1145  REUSEBLOCKREF ReuseBlockRef;
1146 
1147  std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> AttributeValues;
1148 
1149  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1150  };
1151 
1152 
1153  enum class NETSYNCH
1154  {
1155  UNDEFINED,
1156  WARNING,
1157  FULL
1158  };
1159 
1160 
1161  struct DRILL_TABLE : PARSER
1162  {
1166  long OrientAngle = 0;
1167  bool Mirror = false;
1168  bool Fixed = false;
1170  GROUP_ID GroupID = wxEmptyString;
1173 
1174  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1175  };
1176 
1177 
1178  struct LAYOUT : PARSER
1179  {
1181 
1182  std::map<GROUP_ID, GROUP> Groups;
1183  std::map<REUSEBLOCK_ID, REUSEBLOCK> ReuseBlocks;
1184 
1185  std::map<BOARD_ID, CADSTAR_BOARD> Boards;
1186  std::map<FIGURE_ID, FIGURE> Figures;
1188  std::map<AREA_ID, AREA> Areas;
1189  std::map<COMPONENT_ID, COMPONENT> Components;
1190  std::map<DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOL> DocumentationSymbols;
1191  std::map<TRUNK_ID, TRUNK> Trunks;
1192  std::map<NET_ID, NET_PCB> Nets;
1193  std::map<TEMPLATE_ID, TEMPLATE> Templates;
1194  std::map<COPPER_ID, COPPER> Coppers;
1195  std::map<TEXT_ID, TEXT> Texts;
1196  std::map<DIMENSION_ID, DIMENSION> Dimensions;
1197  std::map<DRILL_TABLE_ID, DRILL_TABLE> DrillTables;
1199 
1200  void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
1201  };
1202 
1203 
1204  wxString Filename;
1205 
1211 
1213 
1214 }; //CADSTAR_PCB_ARCHIVE_PARSER
1215 
1216 #endif // CADSTAR_PCB_ARCHIVE_PARSER_H_
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< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
long PART_DEFINITION_PIN_ID
Pin identifier in the part definition.
READABILITY
Sets the readability direction of text.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
The lines are placed outside the measurement (typically used when limited space) token=DIMENSION_EXTE...
CADSTAR_PCB_ARCHIVE_PARSER(const wxString &aFilename)
bool Fixed
If not empty, this CADSTAR_BOARD is part of a group.
Embedded with the line (the Gap parameter specifies the gap between the text and the end of the line)...
POURING Pouring
Copper pour settings (e.g. relief / hatching /etc.)
PADCODE_ID PadCode
If not empty, override padcode.
#define UNDEFINED_MATERIAL_ID
long ViaGrid
Grid for Vias (equal X and Y steps)
Inbuilt layer type (cannot be assigned to user layers)
Inbuilt layer type (cannot be assigned to user layers)
Inbuilt layer type (cannot be assigned to user layers)
long LeaderAngle
Only for TYPE=LEADERLINE subnode "LEADERANG".
bool ThermalReliefOnVias
false when subnode "NOVIARELIEF" is present
bool PCBonlyPad
From CADSTAR Help: "The PCB Only Pad property can be used to stop ECO Update, Back Annotation,...
COPPERCODE_ID CopperCodeID
From CADSTAR Help: "Copper Code is for selecting the width of the line used to draw the outline and f...
bool TestPoint
Indicates whether this component should be treated as a testpoint.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
The highest PHYSICAL_LAYER_ID currently defined (i.e. back / bottom side).
bool Unrouted
Instead of a ROUTE, the CONNECTION might have an "UNROUTE" token.
bool NoVias
From CADSTAR Help: "Check this button to specify that any area created by the Rectangle,...
From CADSTAR Help: "A testpoint is an area of copper connected to a net.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< COMP_AREA_ID, COMPONENT_AREA > ComponentAreas
long ArrowLength
The length of the angled lines that make up the arrow head.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Helper functions and common structures for CADSTAR PCB and Schematic archive files.
EXTENSION_LINE ExtensionLineParams
Not applicable to TYPE=LEADERDIM.
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
VIACODE_ID AreaViaCodeID
For assigning a via code to a rule set.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Above the line (the Offset parameter specifies how far above the line the text is) DIMENSION_EXTERNAL...
bool BoxIsolatedPins
true when subnode "BOXPINS" is present
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< NETELEMENT_ID, COPPER_TERMINAL > CopperTerminals
bool NoTracks
From CADSTAR Help: "Check this button to specify that any area created by the Rectangle,...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Typically used for Radius/Diameter Dimension.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
#define UNDEFINED_LAYER_ID
std::map< RULESET_ID, RULESET > Rulesets
Used for area design rules.
std::map< PART_DEFINITION_PIN_ID, PIN_ATTRIBUTE > PinAttributes
long PAD_ID
Pad identifier (pin) in the PCB.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< COPPERCODE_ID, COPPERCODE > CopperCodes
std::map< MATERIAL_ID, MATERIAL > Materials
wxString Name
Designator e.g. "C1", "R1", etc.
ANGUNITS AngularUnits
Only Applicable to TYPE=ANGLEDIM.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are...
long MinIsolatedCopper
The value is the length of one side of a notional square.
NETELEMENT_ID ID
First character is "P".
Always display (Mirrored and Unmirrored)
Contains formatting specific for a CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION object.
LAYER_ID LayerID
ID on which to draw this [param1].
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool Routing
From CADSTAR Help: "Area can be used to place routes during Automatic Routing.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
This method applies short copper stubs to form a cross. (default)
std::map< DRILL_TABLE_ID, DRILL_TABLE > DrillTables
std::map< LAYERPAIR_ID, LAYERPAIR > LayerPairs
Default vias to use between pairs of layers.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
From CADSTAR help: "For specifying the directions in which routes can enter or exit the pad.
From CADSTAR Help: "Jumpers are components used primarily for the purpose of routing.
long Thickness
Note: Units of length are defined in file header.
long ReliefWidth
if undefined inherits from design
Helper functions and common defines between schematic and PCB Archive files.
long MaxPhysicalLayer
Should equal number of copper layers.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< TEMPLATE_ID, TEMPLATE > Templates
GROUP_ID GroupID
If not empty, this COPPER is part of a group.
The arrow head is made up of two angled lines either side of main line.
static PAD_SIDE GetPadSide(const wxString &aPadSideString)
From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are...
long ReliefWidth
if undefined inherits from design
long TextGap
Specifies the gap between the text and the end of the line.
A shape of copper in the component footprint.
std::map< NET_ID, NET_PCB > Nets
Contains tracks and vias.
GROUP_ID GroupID
If not empty, this AREA is part of a group.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
< Two sibbling nodes: first node being "ROUTEWIDTH" and next node being a VERTEX (e....
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< LAYER_ID, CADSTAR_PAD_SHAPE > Reassigns
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Represents a point in x,y coordinates.
A linear dimension parallel to measurement but with orthogonal extension lines (i....
long ThermalReliefPadsAngle
Orientation for the thermal reliefs.
bool FirstPad
From CADSTAR Help: "Only one pad can have this property; if an existing pad in the design already has...
bool AllowInNoRouting
true when subnode "IGNORETRN" is present
HATCHCODE_ID HatchCodeID
Only for FillType = HATCHED.
std::map< PAD_ID, COMPONENT_PAD > ComponentPads
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
References an element from a design reuse block.
DIMENSION_ID ID
Some ID (doesn't seem to be used) subnode="DIMREF".
bool Placement
From CADSTAR Help: "Auto Placement can place components within this area.
long AreaHeight
From CADSTAR Help: "The Height value specified for the PCB component is checked against the Height va...
long Precision
Number of decimal points to display in the measurement [param3].
long LeaderLineLength
Only for TYPE=LEADERLINE Length of the angled part of the leader line [param5].
Inbuilt layer type (cannot be assigned to user layers)
An orthogonal dimension (either x or y measurement) token=DIMENSION_ORTHOGONAL.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
The highest PHYSICAL_LAYER_ID currently defined (i.e.
XNODE * Parse(XNODE *aNode, PARSER_CONTEXT *aContext)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool ThermalReliefOnPads
false when subnode "NOPINRELIEF" is present
std::map< SYMDEF_ID, SYMDEF_PCB > ComponentDefinitions
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
< Token can be either "LEADERLINE", "LINEARLINE" or "ANGULARLINE"
The same as CLOSED or CLEAR arrows, but with a solid fill "DIMENSION_ARROWCLOSEDFILLED".
long TextOffset
Specifies how far above the line the text is (doesn't have an effect on actual position!...
std::vector< COMPONENT_COPPER > ComponentCoppers
SWAP_RULE
Corresponds to "Display when" Item property.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
LAYER_ID LayerID
Normally LAY0, which corresponds to (All Layers)
MATERIAL_LAYER_TYPE
Type of layer appropriate for the material being set up.
From CADSTAR Help: "Starpoints are special symbols/components that can be used to electrically connec...
Same as closed but the main line finishes at the start of the perpendicular lines.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
#define UNDEFINED_PHYSICAL_LAYER
Standard PCB Component definition.
wxString Identifier
This is an identifier that is displayed to the user.
All physical layers currently defined.
bool AutomaticRepour
true when subnode "REGENERATE" is present
GROUP_ID GroupID
If not empty, this VIA is part of a group.
long TrackGrid
Grid for Routes (equal X and Y steps)
GROUP_ID GroupID
Normally CADSTAR_BOARD cannot be part of a reuseblock, but included for completeness.
std::map< REUSEBLOCK_ID, REUSEBLOCK > ReuseBlocks
static const long UNDEFINED_VALUE
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
The lowest PHYSICAL_LAYER_ID currently defined (i.e. front / top side).
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Represents a CADSTAR PCB Archive (CPA) file.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Hold an XML or S-expression element.
Definition: xnode.h:43
std::map< SPACINGCODE_ID, SPACINGCODE > SpacingCodes
Spacing Design Rules.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< PAD_ID, PADEXCEPTION > PadExceptions
Override pad definitions for this instance.
LAYER_ID SwapLayerID
If UNDEFINED_LAYER_ID, no swap layer.
bool Keepout
From CADSTAR Help: "Auto Placement cannot place components within this area.
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< LAYER_ID, CADSTAR_PAD_SHAPE > Reassigns
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
NETELEMENT_ID ID
First character is "V".
long SymHeight
The Height of the component (3D height in z direction)
RELIEF_TYPE
From CADSTAR Help: "With this parameter you can select one of two ways in which to generate thermal r...
Inbuilt layer type (cannot be assigned to user layers)
GROUP_ID GroupID
If not empty, this component is part of a group.
std::map< DIMENSION_ID, DIMENSION > Dimensions
VERTEX Vertex
Returns a pointer to the last node.
bool NoTracks
From CADSTAR Help: "Area cannot be used to place routes during automatic routing.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< NETELEMENT_ID, JUNCTION_PCB > Junctions
GROUP_ID GroupID
If not empty, this DRILL_TABLE is part of a group.
The lines are placed inside the measurement token=DIMENSION_INTERNAL.
A linear dimension parallel to measurement with perpendicular extension lines token=DIMENSION_DIRECT.
long SliverWidth
Minimum width of copper that may be created.
std::map< SPACINGCODE_ID, SPACINGCODE > SpacingCodes
Overrides these spacing rules in the specific area.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< DIMENSION_ID, DIMENSION > Dimensions
inside "DIMENSIONS" subnode
long ReliefClearance
if undefined inherits from design
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
PHYSICAL_LAYER_ID PhysicalLayer
If UNDEFINED, no physical layer is assigned (e.g.
std::vector< REASSIGN > Reassigns
Can have different spacings on different layers.
COPPERCODE_ID ReliefCopperCodeID
From CADSTAR Help: "Relief Copper Code is for selecting the width of line used to draw the thermal re...
ROUTECODE_ID AreaRouteCodeID
For assigning a net route code to a rule set.
std::map< DOCUMENTATION_SYMBOL_ID, DOCUMENTATION_SYMBOL > DocumentationSymbols
long Overshoot
Overshoot of the extension line past the arrow line.
static TESTLAND_SIDE ParseTestlandSide(XNODE *aNode)
long MinMitre
Manufacturing Design Rule. Corresponds to "Minimum Mitre".
Inbuilt layer type (cannot be assigned to user layers)
long MinDisjointCopper
The value is the length of one side of a notional square.
bool TargetForAutorouting
true when subnode "AUTOROUTETARGET" is present
wxString LAYER_ID
ID of a Sheet (if schematic) or board Layer (if PCB)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long ClearanceWidth
Specifies the space around pads when pouring (i.e.
POINT Position
Pad position within the component's coordinate frame.
long LeaderLineExtensionLength
Only for TYPE=LEADERLINE Length of the horizontal part of the leader line [param6].
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long ThermalReliefViasAngle
Disabled when !ThermalReliefOnVias (param6)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
long MinRouteWidth
Manufacturing Design Rule. Corresponds to "Thin Route Width".
std::map< COMPONENT_ID, COMPONENT > Components
std::map< BOARD_ID, CADSTAR_BOARD > Boards
Normally CADSTAR only allows one board but.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Templates are CADSTAR's equivalent to a "filled zone".
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
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
GROUP_ID GroupID
If not empty, this TEMPLATE is part of a group.
long ReliefClearance
if undefined inherits from design
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
< "PIN" nodename (represents a PAD in a PCB component)
bool SuppressFirst
If true, excludes the first extension line (only shows extension line at end)
long AdditionalIsolation
This is the gap to apply in routes and pads in addition to the existing pad-to-copper or route-to-cop...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, TEXT_LOCATION > TextLocations
This contains location of any attributes, including designator position.
POINT Centre
Only for TYPE=ANGULARLINE [point3].
SYMDEF_TYPE
A symbol definition can represent a number of different objects in CADSTAR.
int KiCadUnitMultiplier
Use this value to convert units in this CPA file to KiCad units.
Linear, leader (radius/diameter) or angular dimension.
PAD_SIDE
From CADSTAR Help: "This parameter indicates the physical layers on which the selected pad is placed.
long MaxMitre
Manufacturing Design Rule. Corresponds to "Maximum Mitre".
The arrow head is made up of two angled lines either side of main line plus two other lines perpendic...
POINT Origin
Origin of the component (this is used as the reference point when placing the component in the design...
GROUP_ID GroupID
If not empty, this DIMENSION is part of a group.
SPACINGCODE_ID ID
Possible spacing rules:
This method uses four cutouts in the copper to leave the reliefs required.
std::map< COPPER_TERM_ID, COPPER_TERM > CopperTerminals
When text is vertical, show it rotated 90 degrees anticlockwise.