You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
10 KiB

  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. #include <layer_ids.h>
  20. #include <wx/translation.h>
  21. /**
  22. * Returns the default display name for a given layer. These are not the same as the canonical
  23. * name in LSET::Name(), which is used in board files and cannot be translated or changed.
  24. * WARNING: do not translate board physical layers names (F.Cu to User.9): because canonical names
  25. * are used in files (boards and fab files), using translated names in UI create mistakes for users.
  26. * Board physical layers names must be seen as proper nouns.
  27. */
  28. wxString LayerName( int aLayer )
  29. {
  30. switch( aLayer )
  31. {
  32. // PCB_LAYER_ID
  33. case F_Cu: return wxT( "F.Cu" );
  34. case In1_Cu: return wxT( "In1.Cu" );
  35. case In2_Cu: return wxT( "In2.Cu" );
  36. case In3_Cu: return wxT( "In3.Cu" );
  37. case In4_Cu: return wxT( "In4.Cu" );
  38. case In5_Cu: return wxT( "In5.Cu" );
  39. case In6_Cu: return wxT( "In6.Cu" );
  40. case In7_Cu: return wxT( "In7.Cu" );
  41. case In8_Cu: return wxT( "In8.Cu" );
  42. case In9_Cu: return wxT( "In9.Cu" );
  43. case In10_Cu: return wxT( "In10.Cu" );
  44. case In11_Cu: return wxT( "In11.Cu" );
  45. case In12_Cu: return wxT( "In12.Cu" );
  46. case In13_Cu: return wxT( "In13.Cu" );
  47. case In14_Cu: return wxT( "In14.Cu" );
  48. case In15_Cu: return wxT( "In15.Cu" );
  49. case In16_Cu: return wxT( "In16.Cu" );
  50. case In17_Cu: return wxT( "In17.Cu" );
  51. case In18_Cu: return wxT( "In18.Cu" );
  52. case In19_Cu: return wxT( "In19.Cu" );
  53. case In20_Cu: return wxT( "In20.Cu" );
  54. case In21_Cu: return wxT( "In21.Cu" );
  55. case In22_Cu: return wxT( "In22.Cu" );
  56. case In23_Cu: return wxT( "In23.Cu" );
  57. case In24_Cu: return wxT( "In24.Cu" );
  58. case In25_Cu: return wxT( "In25.Cu" );
  59. case In26_Cu: return wxT( "In26.Cu" );
  60. case In27_Cu: return wxT( "In27.Cu" );
  61. case In28_Cu: return wxT( "In28.Cu" );
  62. case In29_Cu: return wxT( "In29.Cu" );
  63. case In30_Cu: return wxT( "In30.Cu" );
  64. case B_Cu: return wxT( "B.Cu" );
  65. // Technicals
  66. case B_Adhes: return wxT( "B.Adhesive" );
  67. case F_Adhes: return wxT( "F.Adhesive" );
  68. case B_Paste: return wxT( "B.Paste" );
  69. case F_Paste: return wxT( "F.Paste" );
  70. case B_SilkS: return wxT( "B.Silkscreen" );
  71. case F_SilkS: return wxT( "F.Silkscreen" );
  72. case B_Mask: return wxT( "B.Mask" );
  73. case F_Mask: return wxT( "F.Mask" );
  74. // Users
  75. case Dwgs_User: return wxT( "User.Drawings" );
  76. case Cmts_User: return wxT( "User.Comments" );
  77. case Eco1_User: return wxT( "User.Eco1" );
  78. case Eco2_User: return wxT( "User.Eco2" );
  79. case Edge_Cuts: return wxT( "Edge.Cuts" );
  80. case Margin: return wxT( "Margin" );
  81. // Footprint
  82. case F_CrtYd: return wxT( "F.Courtyard" );
  83. case B_CrtYd: return wxT( "B.Courtyard" );
  84. case F_Fab: return wxT( "F.Fab" );
  85. case B_Fab: return wxT( "B.Fab" );
  86. // User definable layers.
  87. case User_1: return wxT( "User.1" );
  88. case User_2: return wxT( "User.2" );
  89. case User_3: return wxT( "User.3" );
  90. case User_4: return wxT( "User.4" );
  91. case User_5: return wxT( "User.5" );
  92. case User_6: return wxT( "User.6" );
  93. case User_7: return wxT( "User.7" );
  94. case User_8: return wxT( "User.8" );
  95. case User_9: return wxT( "User.9" );
  96. // Rescue
  97. case Rescue: return _( "Rescue" );
  98. // SCH_LAYER_ID
  99. case LAYER_WIRE: return _( "Wires" );
  100. case LAYER_BUS: return _( "Buses" );
  101. case LAYER_BUS_JUNCTION: return _( "Bus junctions" );
  102. case LAYER_JUNCTION: return _( "Junctions" );
  103. case LAYER_LOCLABEL: return _( "Labels" );
  104. case LAYER_GLOBLABEL: return _( "Global labels" );
  105. case LAYER_HIERLABEL: return _( "Hierarchical labels" );
  106. case LAYER_PINNUM: return _( "Pin numbers" );
  107. case LAYER_PINNAM: return _( "Pin names" );
  108. case LAYER_REFERENCEPART: return _( "Symbol references" );
  109. case LAYER_VALUEPART: return _( "Symbol values" );
  110. case LAYER_FIELDS: return _( "Symbol fields" );
  111. case LAYER_INTERSHEET_REFS: return _( "Sheet references" );
  112. case LAYER_NETCLASS_REFS: return _( "Net class references" );
  113. case LAYER_DEVICE: return _( "Symbol body outlines" );
  114. case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
  115. case LAYER_NOTES: return _( "Schematic text && graphics" );
  116. case LAYER_PRIVATE_NOTES: return _( "Symbol private text && graphics" );
  117. case LAYER_NOTES_BACKGROUND: return _( "Schematic text && graphics backgrounds" );
  118. case LAYER_PIN: return _( "Pins" );
  119. case LAYER_SHEET: return _( "Sheet borders" );
  120. case LAYER_SHEET_BACKGROUND: return _( "Sheet backgrounds" );
  121. case LAYER_SHEETNAME: return _( "Sheet names" );
  122. case LAYER_SHEETFIELDS: return _( "Sheet fields" );
  123. case LAYER_SHEETFILENAME: return _( "Sheet file names" );
  124. case LAYER_SHEETLABEL: return _( "Sheet pins" );
  125. case LAYER_NOCONNECT: return _( "No-connect symbols" );
  126. case LAYER_ERC_WARN: return _( "ERC warnings" );
  127. case LAYER_ERC_ERR: return _( "ERC errors" );
  128. case LAYER_ERC_EXCLUSION: return _( "ERC exclusions" );
  129. case LAYER_SCHEMATIC_ANCHOR: return _( "Anchors" );
  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_HOVERED: return _( "Hovered items" );
  136. case LAYER_BRIGHTENED: return _( "Highlighted items" );
  137. case LAYER_HIDDEN: return _( "Hidden items" );
  138. case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
  139. case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
  140. case LAYER_SCHEMATIC_PAGE_LIMITS: return _( "Page limits" );
  141. case LAYER_OP_VOLTAGES: return _( "Operating point voltages" );
  142. case LAYER_OP_CURRENTS: return _( "Operating point currents" );
  143. // GAL_LAYER_ID
  144. case LAYER_MOD_FR: return _( "Footprints front" );
  145. case LAYER_MOD_BK: return _( "Footprints back" );
  146. case LAYER_MOD_VALUES: return _( "Values" );
  147. case LAYER_MOD_REFERENCES: return _( "Reference designators" );
  148. case LAYER_MOD_TEXT: return _( "Footprint text" );
  149. case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden text" );
  150. case LAYER_PAD_FR: return _( "SMD pads front" );
  151. case LAYER_PAD_BK: return _( "SMD pads back" );
  152. case LAYER_PADS_TH: return _( "Through-hole pads" );
  153. case LAYER_TRACKS: return _( "Tracks" );
  154. case LAYER_VIA_THROUGH: return _( "Through vias" );
  155. case LAYER_VIA_BBLIND: return _( "Blind/Buried vias" );
  156. case LAYER_VIA_MICROVIA: return _( "Micro-vias" );
  157. case LAYER_VIA_HOLES: return _( "Via holes" );
  158. case LAYER_VIA_HOLEWALLS: return _( "Via hole walls" );
  159. case LAYER_PAD_PLATEDHOLES: return _( "Plated holes" );
  160. case LAYER_PAD_HOLEWALLS: return _( "Plated hole walls" );
  161. case LAYER_NON_PLATEDHOLES: return _( "Non-plated holes" );
  162. case LAYER_RATSNEST: return _( "Ratsnest" );
  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_PAGE_LIMITS: return _( "Page limits" );
  170. case LAYER_CURSOR: return _( "Cursor" );
  171. case LAYER_AUX_ITEMS: return _( "Helper items" );
  172. case LAYER_GRID: return _( "Grid" );
  173. case LAYER_GRID_AXES: return _( "Grid axes" );
  174. case LAYER_PCB_BACKGROUND: return _( "Background" );
  175. case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
  176. case LAYER_LOCKED_ITEM_SHADOW: return _( "Locked item shadow" );
  177. case LAYER_CONFLICTS_SHADOW: return _( "Courtyard collision shadow" );
  178. default:
  179. wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
  180. }
  181. }