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) 2022 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
20#include <layer_ids.h>
21#include <wx/translation.h>
22
30wxString LayerName( int aLayer )
31{
32 switch( aLayer )
33 {
34 // PCB_LAYER_ID
35 case F_Cu: return wxT( "F.Cu" );
36 case In1_Cu: return wxT( "In1.Cu" );
37 case In2_Cu: return wxT( "In2.Cu" );
38 case In3_Cu: return wxT( "In3.Cu" );
39 case In4_Cu: return wxT( "In4.Cu" );
40 case In5_Cu: return wxT( "In5.Cu" );
41 case In6_Cu: return wxT( "In6.Cu" );
42 case In7_Cu: return wxT( "In7.Cu" );
43 case In8_Cu: return wxT( "In8.Cu" );
44 case In9_Cu: return wxT( "In9.Cu" );
45 case In10_Cu: return wxT( "In10.Cu" );
46 case In11_Cu: return wxT( "In11.Cu" );
47 case In12_Cu: return wxT( "In12.Cu" );
48 case In13_Cu: return wxT( "In13.Cu" );
49 case In14_Cu: return wxT( "In14.Cu" );
50 case In15_Cu: return wxT( "In15.Cu" );
51 case In16_Cu: return wxT( "In16.Cu" );
52 case In17_Cu: return wxT( "In17.Cu" );
53 case In18_Cu: return wxT( "In18.Cu" );
54 case In19_Cu: return wxT( "In19.Cu" );
55 case In20_Cu: return wxT( "In20.Cu" );
56 case In21_Cu: return wxT( "In21.Cu" );
57 case In22_Cu: return wxT( "In22.Cu" );
58 case In23_Cu: return wxT( "In23.Cu" );
59 case In24_Cu: return wxT( "In24.Cu" );
60 case In25_Cu: return wxT( "In25.Cu" );
61 case In26_Cu: return wxT( "In26.Cu" );
62 case In27_Cu: return wxT( "In27.Cu" );
63 case In28_Cu: return wxT( "In28.Cu" );
64 case In29_Cu: return wxT( "In29.Cu" );
65 case In30_Cu: return wxT( "In30.Cu" );
66 case B_Cu: return wxT( "B.Cu" );
67
68 // Technicals
69 case B_Adhes: return wxT( "B.Adhesive" );
70 case F_Adhes: return wxT( "F.Adhesive" );
71 case B_Paste: return wxT( "B.Paste" );
72 case F_Paste: return wxT( "F.Paste" );
73 case B_SilkS: return wxT( "B.Silkscreen" );
74 case F_SilkS: return wxT( "F.Silkscreen" );
75 case B_Mask: return wxT( "B.Mask" );
76 case F_Mask: return wxT( "F.Mask" );
77
78 // Users
79 case Dwgs_User: return wxT( "User.Drawings" );
80 case Cmts_User: return wxT( "User.Comments" );
81 case Eco1_User: return wxT( "User.Eco1" );
82 case Eco2_User: return wxT( "User.Eco2" );
83 case Edge_Cuts: return wxT( "Edge.Cuts" );
84 case Margin: return wxT( "Margin" );
85
86 // Footprint
87 case F_CrtYd: return wxT( "F.Courtyard" );
88 case B_CrtYd: return wxT( "B.Courtyard" );
89 case F_Fab: return wxT( "F.Fab" );
90 case B_Fab: return wxT( "B.Fab" );
91
92 // User definable layers.
93 case User_1: return wxT( "User.1" );
94 case User_2: return wxT( "User.2" );
95 case User_3: return wxT( "User.3" );
96 case User_4: return wxT( "User.4" );
97 case User_5: return wxT( "User.5" );
98 case User_6: return wxT( "User.6" );
99 case User_7: return wxT( "User.7" );
100 case User_8: return wxT( "User.8" );
101 case User_9: return wxT( "User.9" );
102
103 // Rescue
104 case Rescue: return _( "Rescue" );
105
106 // SCH_LAYER_ID
107
108 case LAYER_WIRE: return _( "Wires" );
109 case LAYER_BUS: return _( "Buses" );
110 case LAYER_BUS_JUNCTION: return _( "Bus junctions" );
111 case LAYER_JUNCTION: return _( "Junctions" );
112 case LAYER_LOCLABEL: return _( "Labels" );
113 case LAYER_GLOBLABEL: return _( "Global labels" );
114 case LAYER_HIERLABEL: return _( "Hierarchical labels" );
115 case LAYER_PINNUM: return _( "Pin numbers" );
116 case LAYER_PINNAM: return _( "Pin names" );
117 case LAYER_REFERENCEPART: return _( "Symbol references" );
118 case LAYER_VALUEPART: return _( "Symbol values" );
119 case LAYER_FIELDS: return _( "Symbol fields" );
120 case LAYER_INTERSHEET_REFS: return _( "Sheet references" );
121 case LAYER_NETCLASS_REFS: return _( "Net class references" );
122 case LAYER_DEVICE: return _( "Symbol body outlines" );
123 case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
124 case LAYER_NOTES: return _( "Schematic text && graphics" );
125 case LAYER_PRIVATE_NOTES: return _( "Symbol private text && graphics" );
126 case LAYER_NOTES_BACKGROUND: return _( "Schematic text && graphics backgrounds" );
127 case LAYER_PIN: return _( "Pins" );
128 case LAYER_SHEET: return _( "Sheet borders" );
129 case LAYER_SHEET_BACKGROUND: return _( "Sheet backgrounds" );
130 case LAYER_SHEETNAME: return _( "Sheet names" );
131 case LAYER_SHEETFIELDS: return _( "Sheet fields" );
132 case LAYER_SHEETFILENAME: return _( "Sheet file names" );
133 case LAYER_SHEETLABEL: return _( "Sheet pins" );
134 case LAYER_NOCONNECT: return _( "No-connect symbols" );
135 case LAYER_ERC_WARN: return _( "ERC warnings" );
136 case LAYER_ERC_ERR: return _( "ERC errors" );
137 case LAYER_ERC_EXCLUSION: return _( "ERC exclusions" );
138 case LAYER_SCHEMATIC_ANCHOR: return _( "Anchors" );
139 case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
140 case LAYER_SCHEMATIC_GRID: return _( "Grid" );
141 case LAYER_SCHEMATIC_GRID_AXES: return _( "Axes" );
142 case LAYER_SCHEMATIC_BACKGROUND: return _( "Background" );
143 case LAYER_SCHEMATIC_CURSOR: return _( "Cursor" );
144 case LAYER_HOVERED: return _( "Hovered items" );
145 case LAYER_BRIGHTENED: return _( "Highlighted items" );
146 case LAYER_HIDDEN: return _( "Hidden items" );
147 case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
148 case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
149 case LAYER_SCHEMATIC_PAGE_LIMITS: return _( "Page limits" );
150
151 // GAL_LAYER_ID
152
153 case LAYER_MOD_FR: return _( "Footprints front" );
154 case LAYER_MOD_BK: return _( "Footprints back" );
155 case LAYER_MOD_VALUES: return _( "Values" );
156 case LAYER_MOD_REFERENCES: return _( "Reference designators" );
157 case LAYER_MOD_TEXT: return _( "Footprint text" );
158 case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden text" );
159 case LAYER_PAD_FR: return _( "SMD pads front" );
160 case LAYER_PAD_BK: return _( "SMD pads back" );
161 case LAYER_PADS_TH: return _( "Through-hole pads" );
162 case LAYER_TRACKS: return _( "Tracks" );
163 case LAYER_VIA_THROUGH: return _( "Through vias" );
164 case LAYER_VIA_BBLIND: return _( "Blind/Buried vias" );
165 case LAYER_VIA_MICROVIA: return _( "Micro-vias" );
166 case LAYER_VIA_HOLES: return _( "Via holes" );
167 case LAYER_VIA_HOLEWALLS: return _( "Via hole walls" );
168 case LAYER_PAD_PLATEDHOLES: return _( "Plated holes" );
169 case LAYER_PAD_HOLEWALLS: return _( "Plated hole walls" );
170 case LAYER_NON_PLATEDHOLES: return _( "Non-plated holes" );
171 case LAYER_RATSNEST: return _( "Ratsnest" );
172 case LAYER_DRC_WARNING: return _( "DRC warnings" );
173 case LAYER_DRC_ERROR: return _( "DRC errors" );
174 case LAYER_DRC_EXCLUSION: return _( "DRC exclusions" );
175 case LAYER_MARKER_SHADOWS: return _( "DRC marker shadows" );
176 case LAYER_ANCHOR: return _( "Anchors" );
177 case LAYER_DRAWINGSHEET: return _( "Drawing sheet" );
178 case LAYER_PAGE_LIMITS: return _( "Page limits" );
179 case LAYER_CURSOR: return _( "Cursor" );
180 case LAYER_AUX_ITEMS: return _( "Helper items" );
181 case LAYER_GRID: return _( "Grid" );
182 case LAYER_GRID_AXES: return _( "Grid axes" );
183 case LAYER_PCB_BACKGROUND: return _( "Background" );
184 case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
185 case LAYER_LOCKED_ITEM_SHADOW: return _( "Locked item shadow" );
186 case LAYER_CONFLICTS_SHADOW: return _( "Courtyard collision shadow" );
187
188 default:
189 wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
190 }
191}
#define _(s)
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:30
@ LAYER_GRID
Definition: layer_ids.h:205
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
Definition: layer_ids.h:200
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:249
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:239
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:234
@ LAYER_GRID_AXES
Definition: layer_ids.h:206
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:241
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:197
@ LAYER_PAD_FR
smd pads, front layer
Definition: layer_ids.h:202
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:217
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
Definition: layer_ids.h:236
@ LAYER_MOD_TEXT
Definition: layer_ids.h:198
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:220
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:235
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:214
@ LAYER_TRACKS
Definition: layer_ids.h:212
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:221
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:222
@ LAYER_RATSNEST
Definition: layer_ids.h:204
@ LAYER_MOD_FR
show footprints on front
Definition: layer_ids.h:208
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:201
@ LAYER_PAD_BK
smd pads, back layer
Definition: layer_ids.h:203
@ LAYER_MOD_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:210
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:213
@ LAYER_MARKER_SHADOWS
shadows for drc markers
Definition: layer_ids.h:237
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:215
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:194
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:219
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:196
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:216
@ LAYER_MOD_BK
show footprints on back
Definition: layer_ids.h:209
@ LAYER_MOD_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:211
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:195
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:233
@ LAYER_SHEETNAME
Definition: layer_ids.h:363
@ LAYER_ERC_WARN
Definition: layer_ids.h:369
@ LAYER_SCHEMATIC_ANCHOR
Definition: layer_ids.h:386
@ LAYER_SHEETLABEL
Definition: layer_ids.h:366
@ LAYER_PINNUM
Definition: layer_ids.h:350
@ LAYER_DEVICE
Definition: layer_ids.h:357
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:373
@ LAYER_BRIGHTENED
Definition: layer_ids.h:379
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:371
@ LAYER_HIDDEN
Definition: layer_ids.h:380
@ LAYER_HIERLABEL
Definition: layer_ids.h:349
@ LAYER_PINNAM
Definition: layer_ids.h:351
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:359
@ LAYER_HOVERED
Definition: layer_ids.h:378
@ LAYER_GLOBLABEL
Definition: layer_ids.h:348
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_NOTES
Definition: layer_ids.h:358
@ LAYER_ERC_ERR
Definition: layer_ids.h:370
@ LAYER_PIN
Definition: layer_ids.h:361
@ LAYER_VALUEPART
Definition: layer_ids.h:353
@ LAYER_BUS
Definition: layer_ids.h:345
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:377
@ LAYER_FIELDS
Definition: layer_ids.h:354
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:372
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:382
@ LAYER_LOCLABEL
Definition: layer_ids.h:347
@ LAYER_JUNCTION
Definition: layer_ids.h:346
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:365
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:375
@ LAYER_REFERENCEPART
Definition: layer_ids.h:352
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:356
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:360
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:383
@ LAYER_SHEET
Definition: layer_ids.h:362
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:381
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:376
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition: layer_ids.h:385
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:355
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:364
@ LAYER_BUS_JUNCTION
Definition: layer_ids.h:384
@ LAYER_NOCONNECT
Definition: layer_ids.h:367
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:374
@ In22_Cu
Definition: layer_ids.h:86
@ In11_Cu
Definition: layer_ids.h:75
@ In29_Cu
Definition: layer_ids.h:93
@ In30_Cu
Definition: layer_ids.h:94
@ User_8
Definition: layer_ids.h:130
@ F_CrtYd
Definition: layer_ids.h:117
@ In17_Cu
Definition: layer_ids.h:81
@ B_Adhes
Definition: layer_ids.h:97
@ Edge_Cuts
Definition: layer_ids.h:113
@ Dwgs_User
Definition: layer_ids.h:109
@ F_Paste
Definition: layer_ids.h:101
@ In9_Cu
Definition: layer_ids.h:73
@ Cmts_User
Definition: layer_ids.h:110
@ User_6
Definition: layer_ids.h:128
@ User_7
Definition: layer_ids.h:129
@ In19_Cu
Definition: layer_ids.h:83
@ In7_Cu
Definition: layer_ids.h:71
@ In28_Cu
Definition: layer_ids.h:92
@ In26_Cu
Definition: layer_ids.h:90
@ F_Adhes
Definition: layer_ids.h:98
@ B_Mask
Definition: layer_ids.h:106
@ B_Cu
Definition: layer_ids.h:95
@ User_5
Definition: layer_ids.h:127
@ Eco1_User
Definition: layer_ids.h:111
@ F_Mask
Definition: layer_ids.h:107
@ In21_Cu
Definition: layer_ids.h:85
@ In23_Cu
Definition: layer_ids.h:87
@ B_Paste
Definition: layer_ids.h:100
@ In15_Cu
Definition: layer_ids.h:79
@ In2_Cu
Definition: layer_ids.h:66
@ User_9
Definition: layer_ids.h:131
@ F_Fab
Definition: layer_ids.h:120
@ In10_Cu
Definition: layer_ids.h:74
@ Margin
Definition: layer_ids.h:114
@ F_SilkS
Definition: layer_ids.h:104
@ In4_Cu
Definition: layer_ids.h:68
@ B_CrtYd
Definition: layer_ids.h:116
@ Eco2_User
Definition: layer_ids.h:112
@ In16_Cu
Definition: layer_ids.h:80
@ In24_Cu
Definition: layer_ids.h:88
@ In1_Cu
Definition: layer_ids.h:65
@ Rescue
Definition: layer_ids.h:133
@ User_3
Definition: layer_ids.h:125
@ User_1
Definition: layer_ids.h:123
@ B_SilkS
Definition: layer_ids.h:103
@ In13_Cu
Definition: layer_ids.h:77
@ User_4
Definition: layer_ids.h:126
@ In8_Cu
Definition: layer_ids.h:72
@ In14_Cu
Definition: layer_ids.h:78
@ User_2
Definition: layer_ids.h:124
@ In12_Cu
Definition: layer_ids.h:76
@ In27_Cu
Definition: layer_ids.h:91
@ In6_Cu
Definition: layer_ids.h:70
@ In5_Cu
Definition: layer_ids.h:69
@ In3_Cu
Definition: layer_ids.h:67
@ In20_Cu
Definition: layer_ids.h:84
@ F_Cu
Definition: layer_ids.h:64
@ In18_Cu
Definition: layer_ids.h:82
@ In25_Cu
Definition: layer_ids.h:89
@ B_Fab
Definition: layer_ids.h:119
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200