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