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.

Definition at line 27 of file layer_id.cpp.

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 _( "Wires" );
106  case LAYER_BUS: return _( "Buses" );
107  case LAYER_BUS_JUNCTION: return _( "Bus junctions" );
108  case LAYER_JUNCTION: return _( "Junctions" );
109  case LAYER_LOCLABEL: return _( "Labels" );
110  case LAYER_GLOBLABEL: return _( "Global labels" );
111  case LAYER_HIERLABEL: return _( "Hierarchical labels" );
112  case LAYER_PINNUM: return _( "Pin numbers" );
113  case LAYER_PINNAM: return _( "Pin names" );
114  case LAYER_REFERENCEPART: return _( "Symbol references" );
115  case LAYER_VALUEPART: return _( "Symbol values" );
116  case LAYER_FIELDS: return _( "Symbol fields" );
117  case LAYER_DEVICE: return _( "Symbol body outlines" );
118  case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
119  case LAYER_NOTES: return _( "Notes" );
120  case LAYER_PIN: return _( "Pins" );
121  case LAYER_SHEET: return _( "Sheet borders" );
122  case LAYER_SHEET_BACKGROUND: return _( "Sheet backgrounds" );
123  case LAYER_SHEETNAME: return _( "Sheet names" );
124  case LAYER_SHEETFIELDS: return _( "Sheet fields" );
125  case LAYER_SHEETFILENAME: return _( "Sheet file names" );
126  case LAYER_SHEETLABEL: return _( "Sheet pins" );
127  case LAYER_NOCONNECT: return _( "No-connect symbols" );
128  case LAYER_ERC_WARN: return _( "ERC warnings" );
129  case LAYER_ERC_ERR: return _( "ERC errors" );
130  case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
131  case LAYER_SCHEMATIC_GRID: return _( "Grid" );
132  case LAYER_SCHEMATIC_GRID_AXES: return _( "Axes" );
133  case LAYER_SCHEMATIC_BACKGROUND: return _( "Background" );
134  case LAYER_SCHEMATIC_CURSOR: return _( "Cursor" );
135  case LAYER_BRIGHTENED: return _( "Highlighted items" );
136  case LAYER_HIDDEN: return _( "Hidden items" );
137  case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
138  case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
139 
140  // GAL_LAYER_ID
141 
142  case LAYER_MOD_FR: return _( "Footprints front" );
143  case LAYER_MOD_BK: return _( "Footprints back" );
144  case LAYER_MOD_VALUES: return _( "Values" );
145  case LAYER_MOD_REFERENCES: return _( "Reference designators" );
146  case LAYER_MOD_TEXT_FR: return _( "Footprint text front" );
147  case LAYER_MOD_TEXT_BK: return _( "Footprint text back" );
148  case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden text" );
149  case LAYER_PAD_FR: return _( "SMD pads front" );
150  case LAYER_PAD_BK: return _( "SMD pads back" );
151  case LAYER_PADS_TH: return _( "Through-hole pads" );
152  case LAYER_TRACKS: return _( "Tracks" );
153  case LAYER_VIA_THROUGH: return _( "Through vias" );
154  case LAYER_VIA_BBLIND: return _( "Bl/Buried vias" );
155  case LAYER_VIA_MICROVIA: return _( "Micro-vias" );
156  case LAYER_VIA_HOLES: return _( "Via holes" );
157  case LAYER_VIA_HOLEWALLS: return _( "Via hole walls" );
158  case LAYER_PAD_PLATEDHOLES: return _( "Plated holes" );
159  case LAYER_PAD_HOLEWALLS: return _( "Plated hole walls" );
160  case LAYER_NON_PLATEDHOLES: return _( "Non-plated holes" );
161  case LAYER_RATSNEST: return _( "Ratsnest" );
162  case LAYER_NO_CONNECTS: return _( "No-connects" );
163  case LAYER_DRC_WARNING: return _( "DRC warnings" );
164  case LAYER_DRC_ERROR: return _( "DRC errors" );
165  case LAYER_DRC_EXCLUSION: return _( "DRC exclusions" );
166  case LAYER_MARKER_SHADOWS: return _( "DRC marker shadows" );
167  case LAYER_ANCHOR: return _( "Anchors" );
168  case LAYER_DRAWINGSHEET: return _( "Drawing sheet" );
169  case LAYER_CURSOR: return _( "Cursor" );
170  case LAYER_AUX_ITEMS: return _( "Helper items" );
171  case LAYER_GRID: return _( "Grid" );
172  case LAYER_GRID_AXES: return _( "Grid axes" );
173  case LAYER_PCB_BACKGROUND: return _( "Background" );
174  case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
175 
176  default:
177  wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
178  }
179 }
currently selected items overlay
Definition: layer_ids.h:214
smd pads, front layer
Definition: layer_ids.h:197
to draw micro vias
Definition: layer_ids.h:189
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:217
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:211
PCB cursor.
Definition: layer_ids.h:216
show footprints values (when texts are visible)
Definition: layer_ids.h:205
smd pads, back layer
Definition: layer_ids.h:198
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:196
show footprints on back
Definition: layer_ids.h:204
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:210
to draw usual through hole vias
Definition: layer_ids.h:191
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:192
shadows for drc markers
Definition: layer_ids.h:232
text marked as invisible
Definition: layer_ids.h:195
show footprints on front
Definition: layer_ids.h:203
#define _(s)
drawingsheet frame and titleblock
Definition: layer_ids.h:212
show a marker on pads with no nets
Definition: layer_ids.h:202
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:206
multilayer pads, usually with holes
Definition: layer_ids.h:208
to draw blind/buried vias
Definition: layer_ids.h:190
layer for drc markers which have been individually excluded
Definition: layer_ids.h:231
Definition: layer_ids.h:70
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:230
PCB background color.
Definition: layer_ids.h:215
to draw pad holes (plated)
Definition: layer_ids.h:209

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_BK, LAYER_MOD_TEXT_FR, 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_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().