KiCad PCB EDA Suite
layer_id.cpp
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 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
21 #include <wx/wx.h>
22 
27 wxString LayerName( int aLayer )
28 {
29  switch( aLayer )
30  {
31  // PCB_LAYER_ID
32  case F_Cu: return _( "F.Cu" );
33  case In1_Cu: return _( "In1.Cu" );
34  case In2_Cu: return _( "In2.Cu" );
35  case In3_Cu: return _( "In3.Cu" );
36  case In4_Cu: return _( "In4.Cu" );
37  case In5_Cu: return _( "In5.Cu" );
38  case In6_Cu: return _( "In6.Cu" );
39  case In7_Cu: return _( "In7.Cu" );
40  case In8_Cu: return _( "In8.Cu" );
41  case In9_Cu: return _( "In9.Cu" );
42  case In10_Cu: return _( "In10.Cu" );
43  case In11_Cu: return _( "In11.Cu" );
44  case In12_Cu: return _( "In12.Cu" );
45  case In13_Cu: return _( "In13.Cu" );
46  case In14_Cu: return _( "In14.Cu" );
47  case In15_Cu: return _( "In15.Cu" );
48  case In16_Cu: return _( "In16.Cu" );
49  case In17_Cu: return _( "In17.Cu" );
50  case In18_Cu: return _( "In18.Cu" );
51  case In19_Cu: return _( "In19.Cu" );
52  case In20_Cu: return _( "In20.Cu" );
53  case In21_Cu: return _( "In21.Cu" );
54  case In22_Cu: return _( "In22.Cu" );
55  case In23_Cu: return _( "In23.Cu" );
56  case In24_Cu: return _( "In24.Cu" );
57  case In25_Cu: return _( "In25.Cu" );
58  case In26_Cu: return _( "In26.Cu" );
59  case In27_Cu: return _( "In27.Cu" );
60  case In28_Cu: return _( "In28.Cu" );
61  case In29_Cu: return _( "In29.Cu" );
62  case In30_Cu: return _( "In30.Cu" );
63  case B_Cu: return _( "B.Cu" );
64 
65  // Technicals
66  case B_Adhes: return _( "B.Adhesive" );
67  case F_Adhes: return _( "F.Adhesive" );
68  case B_Paste: return _( "B.Paste" );
69  case F_Paste: return _( "F.Paste" );
70  case B_SilkS: return _( "B.Silkscreen" );
71  case F_SilkS: return _( "F.Silkscreen" );
72  case B_Mask: return _( "B.Mask" );
73  case F_Mask: return _( "F.Mask" );
74 
75  // Users
76  case Dwgs_User: return _( "User.Drawings" );
77  case Cmts_User: return _( "User.Comments" );
78  case Eco1_User: return _( "User.Eco1" );
79  case Eco2_User: return _( "User.Eco2" );
80  case Edge_Cuts: return _( "Edge.Cuts" );
81  case Margin: return _( "Margin" );
82 
83  // Footprint
84  case F_CrtYd: return _( "F.Courtyard" );
85  case B_CrtYd: return _( "B.Courtyard" );
86  case F_Fab: return _( "F.Fab" );
87  case B_Fab: return _( "B.Fab" );
88 
89  // User definable layers.
90  case User_1: return _( "User.1" );
91  case User_2: return _( "User.2" );
92  case User_3: return _( "User.3" );
93  case User_4: return _( "User.4" );
94  case User_5: return _( "User.5" );
95  case User_6: return _( "User.6" );
96  case User_7: return _( "User.7" );
97  case User_8: return _( "User.8" );
98  case User_9: return _( "User.9" );
99 
100  // Rescue
101  case Rescue: return _( "Rescue" );
102 
103  // SCH_LAYER_ID
104 
105  case LAYER_WIRE: return _( "Wire" );
106  case LAYER_BUS: return _( "Bus" );
107  case LAYER_BUS_JUNCTION: return _( "Bus Junction" );
108  case LAYER_JUNCTION: return _( "Junction" );
109  case LAYER_LOCLABEL: return _( "Label" );
110  case LAYER_GLOBLABEL: return _( "Global label" );
111  case LAYER_HIERLABEL: return _( "Hierarchical label" );
112  case LAYER_PINNUM: return _( "Pin number" );
113  case LAYER_PINNAM: return _( "Pin name" );
114  case LAYER_REFERENCEPART: return _( "Symbol reference" );
115  case LAYER_VALUEPART: return _( "Symbol value" );
116  case LAYER_FIELDS: return _( "Symbol fields" );
117  case LAYER_DEVICE: return _( "Symbol body outline" );
118  case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fill" );
119  case LAYER_NOTES: return _( "Notes" );
120  case LAYER_NETNAM: return _( "Net name" );
121  case LAYER_PIN: return _( "Pin" );
122  case LAYER_SHEET: return _( "Sheet border" );
123  case LAYER_SHEET_BACKGROUND: return _( "Sheet background" );
124  case LAYER_SHEETNAME: return _( "Sheet name" );
125  case LAYER_SHEETFIELDS: return _( "Sheet fields" );
126  case LAYER_SHEETFILENAME: return _( "Sheet file name" );
127  case LAYER_SHEETLABEL: return _( "Sheet label" );
128  case LAYER_NOCONNECT: return _( "No connect symbol" );
129  case LAYER_ERC_WARN: return _( "ERC warning" );
130  case LAYER_ERC_ERR: return _( "ERC error" );
131  case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
132  case LAYER_SCHEMATIC_GRID: return _( "Grid" );
133  case LAYER_SCHEMATIC_GRID_AXES: return _( "Axes" );
134  case LAYER_SCHEMATIC_BACKGROUND: return _( "Background" );
135  case LAYER_SCHEMATIC_CURSOR: return _( "Cursor" );
136  case LAYER_BRIGHTENED: return _( "Highlighted items" );
137  case LAYER_HIDDEN: return _( "Hidden item" );
138  case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
139  case LAYER_SCHEMATIC_WORKSHEET: return _( "Worksheet" );
140 
141  // GAL_LAYER_ID
142 
143  case LAYER_MOD_FR: return _( "Footprints Front" );
144  case LAYER_MOD_BK: return _( "Footprints Back" );
145  case LAYER_MOD_VALUES: return _( "Values" );
146  case LAYER_MOD_REFERENCES: return _( "Reference Designators" );
147  case LAYER_MOD_TEXT_FR: return _( "Footprint Text Front" );
148  case LAYER_MOD_TEXT_BK: return _( "Footprint Text Back" );
149  case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden Text" );
150  case LAYER_PAD_FR: return _( "Pads Front" );
151  case LAYER_PAD_BK: return _( "Pads Back" );
152  case LAYER_PADS_TH: return _( "Through Hole Pads" );
153  case LAYER_TRACKS: return _( "Tracks" );
154  case LAYER_VIA_THROUGH: return _( "Through Via" );
155  case LAYER_VIA_BBLIND: return _( "Bl/Buried Via" );
156  case LAYER_VIA_MICROVIA: return _( "Micro Via" );
157  case LAYER_VIAS_HOLES: return _( "Via Holes" );
158  case LAYER_NON_PLATEDHOLES: return _( "Non Plated Holes" );
159  case LAYER_RATSNEST: return _( "Ratsnest" );
160  case LAYER_NO_CONNECTS: return _( "No-Connects" );
161  case LAYER_DRC_WARNING: return _( "DRC Warnings" );
162  case LAYER_DRC_ERROR: return _( "DRC Errors" );
163  case LAYER_DRC_EXCLUSION: return _( "DRC Exclusions" );
164  case LAYER_MARKER_SHADOWS: return _( "DRC Marker Shadows" );
165  case LAYER_ANCHOR: return _( "Anchors" );
166  case LAYER_WORKSHEET: return _( "Worksheet" );
167  case LAYER_CURSOR: return _( "Cursor" );
168  case LAYER_AUX_ITEMS: return _( "Helper items" );
169  case LAYER_GRID: return _( "Grid" );
170  case LAYER_GRID_AXES: return _( "Grid Axes" );
171  case LAYER_PCB_BACKGROUND: return _( "Background" );
172  case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
173 
174  default:
175  wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
176  }
177 }
to draw blind/buried vias
show a marker on pads with no nets
multilayer pads, usually with holes
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
show footprints on back
to draw via holes (pad holes do not use this layer)
show footprints values (when texts are visibles)
show footprints on front
Auxiliary items (guides, rule, etc)
to draw usual through hole vias
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:27
layer for drc markers which have been individually excluded
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
layer for drc markers with SEVERITY_WARNING
smd pads, front layer
Board layer functions and definitions.
#define _(s)
Definition: 3d_actions.cpp:33
currently selected items overlay
show footprints references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR