KiCad PCB EDA Suite
layer_id.cpp File Reference
#include <layer_ids.h>
#include <wx/translation.h>

Go to the source code of this file.

Functions

wxString LayerName (int aLayer)
 Returns the default display name for a given layer. More...
 

Function Documentation

◆ LayerName()

wxString LayerName ( int  aLayer)

Returns the default display name for a given layer.

Returns the string equivalent of a given layer.

These are not the same as the canonical name in LSET::Name(), which is used in board files and cannot be translated or changed. WARNING: do not translate board physical layers names (F.Cu to User.9): because canonical names are used in files (boards and fab files), using translated names in UI create mistakes for users. Board physical layers names must be seen as proper nouns.

Definition at line 30 of file layer_id.cpp.

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_DEVICE: return _( "Symbol body outlines" );
121  case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
122  case LAYER_NOTES: return _( "Schematic text && graphics" );
123  case LAYER_PIN: return _( "Pins" );
124  case LAYER_SHEET: return _( "Sheet borders" );
125  case LAYER_SHEET_BACKGROUND: return _( "Sheet backgrounds" );
126  case LAYER_SHEETNAME: return _( "Sheet names" );
127  case LAYER_SHEETFIELDS: return _( "Sheet fields" );
128  case LAYER_SHEETFILENAME: return _( "Sheet file names" );
129  case LAYER_SHEETLABEL: return _( "Sheet pins" );
130  case LAYER_NOCONNECT: return _( "No-connect symbols" );
131  case LAYER_ERC_WARN: return _( "ERC warnings" );
132  case LAYER_ERC_ERR: return _( "ERC errors" );
133  case LAYER_SCHEMATIC_ANCHOR: return _( "Anchors" );
134  case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
135  case LAYER_SCHEMATIC_GRID: return _( "Grid" );
136  case LAYER_SCHEMATIC_GRID_AXES: return _( "Axes" );
137  case LAYER_SCHEMATIC_BACKGROUND: return _( "Background" );
138  case LAYER_SCHEMATIC_CURSOR: return _( "Cursor" );
139  case LAYER_BRIGHTENED: return _( "Highlighted items" );
140  case LAYER_HIDDEN: return _( "Hidden items" );
141  case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
142  case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
143 
144  // GAL_LAYER_ID
145 
146  case LAYER_MOD_FR: return _( "Footprints front" );
147  case LAYER_MOD_BK: return _( "Footprints back" );
148  case LAYER_MOD_VALUES: return _( "Values" );
149  case LAYER_MOD_REFERENCES: return _( "Reference designators" );
150  case LAYER_MOD_TEXT: return _( "Footprint text" );
151  case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden text" );
152  case LAYER_PAD_FR: return _( "SMD pads front" );
153  case LAYER_PAD_BK: return _( "SMD pads back" );
154  case LAYER_PADS_TH: return _( "Through-hole pads" );
155  case LAYER_TRACKS: return _( "Tracks" );
156  case LAYER_VIA_THROUGH: return _( "Through vias" );
157  case LAYER_VIA_BBLIND: return _( "Bl/Buried vias" );
158  case LAYER_VIA_MICROVIA: return _( "Micro-vias" );
159  case LAYER_VIA_HOLES: return _( "Via holes" );
160  case LAYER_VIA_HOLEWALLS: return _( "Via hole walls" );
161  case LAYER_PAD_PLATEDHOLES: return _( "Plated holes" );
162  case LAYER_PAD_HOLEWALLS: return _( "Plated hole walls" );
163  case LAYER_NON_PLATEDHOLES: return _( "Non-plated holes" );
164  case LAYER_RATSNEST: return _( "Ratsnest" );
165  case LAYER_NO_CONNECTS: return _( "No-connects" );
166  case LAYER_DRC_WARNING: return _( "DRC warnings" );
167  case LAYER_DRC_ERROR: return _( "DRC errors" );
168  case LAYER_DRC_EXCLUSION: return _( "DRC exclusions" );
169  case LAYER_MARKER_SHADOWS: return _( "DRC marker shadows" );
170  case LAYER_ANCHOR: return _( "Anchors" );
171  case LAYER_DRAWINGSHEET: return _( "Drawing sheet" );
172  case LAYER_CURSOR: return _( "Cursor" );
173  case LAYER_AUX_ITEMS: return _( "Helper items" );
174  case LAYER_GRID: return _( "Grid" );
175  case LAYER_GRID_AXES: return _( "Grid axes" );
176  case LAYER_PCB_BACKGROUND: return _( "Background" );
177  case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
178 
179  default:
180  wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
181  }
182 }
currently selected items overlay
Definition: layer_ids.h:226
smd pads, front layer
Definition: layer_ids.h:209
to draw micro vias
Definition: layer_ids.h:201
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:229
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:223
PCB cursor.
Definition: layer_ids.h:228
show footprints values (when texts are visible)
Definition: layer_ids.h:217
smd pads, back layer
Definition: layer_ids.h:210
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:208
show footprints on back
Definition: layer_ids.h:216
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:222
to draw usual through hole vias
Definition: layer_ids.h:203
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:204
shadows for drc markers
Definition: layer_ids.h:244
text marked as invisible
Definition: layer_ids.h:207
show footprints on front
Definition: layer_ids.h:215
#define _(s)
drawingsheet frame and titleblock
Definition: layer_ids.h:224
show a marker on pads with no nets
Definition: layer_ids.h:214
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
show footprints references (when texts are visible)
Definition: layer_ids.h:218
multilayer pads, usually with holes
Definition: layer_ids.h:220
to draw blind/buried vias
Definition: layer_ids.h:202
layer for drc markers which have been individually excluded
Definition: layer_ids.h:243
Definition: layer_ids.h:71
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:242
PCB background color.
Definition: layer_ids.h:227
to draw pad holes (plated)
Definition: layer_ids.h:221

References _, B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, Format(), In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, LAYER_ANCHOR, LAYER_AUX_ITEMS, LAYER_BRIGHTENED, LAYER_BUS, LAYER_BUS_JUNCTION, LAYER_CURSOR, LAYER_DEVICE, LAYER_DEVICE_BACKGROUND, LAYER_DRAWINGSHEET, LAYER_DRC_ERROR, LAYER_DRC_EXCLUSION, LAYER_DRC_WARNING, LAYER_ERC_ERR, LAYER_ERC_WARN, LAYER_FIELDS, LAYER_GLOBLABEL, LAYER_GRID, LAYER_GRID_AXES, LAYER_HIDDEN, LAYER_HIERLABEL, LAYER_JUNCTION, LAYER_LOCLABEL, LAYER_MARKER_SHADOWS, LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_NO_CONNECTS, LAYER_NOCONNECT, LAYER_NON_PLATEDHOLES, LAYER_NOTES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_PADS_TH, LAYER_PCB_BACKGROUND, LAYER_PIN, LAYER_PINNAM, LAYER_PINNUM, LAYER_RATSNEST, LAYER_REFERENCEPART, LAYER_SCHEMATIC_ANCHOR, LAYER_SCHEMATIC_AUX_ITEMS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_CURSOR, LAYER_SCHEMATIC_DRAWINGSHEET, LAYER_SCHEMATIC_GRID, LAYER_SCHEMATIC_GRID_AXES, LAYER_SELECT_OVERLAY, LAYER_SELECTION_SHADOWS, LAYER_SHEET, LAYER_SHEET_BACKGROUND, LAYER_SHEETFIELDS, LAYER_SHEETFILENAME, LAYER_SHEETLABEL, LAYER_SHEETNAME, LAYER_TRACKS, LAYER_VALUEPART, LAYER_VIA_BBLIND, LAYER_VIA_HOLES, LAYER_VIA_HOLEWALLS, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_WIRE, Margin, Rescue, User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.

Referenced by DIALOG_IMPORTED_LAYERS::AddMappings(), PANEL_SETUP_LAYERS::addUserDefinedLayer(), AUTOPLACE_TOOL::autoplace(), PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), DIALOG_IMPORTED_LAYERS::GetSelectedLayerID(), BOARD::GetStandardLayerName(), DIALOG_IMPORTED_LAYERS::OnAutoMatchLayersClicked(), and DRC_TEST_PROVIDER_MISC::testDisabledLayers().