22#include <api/common/types/enums.pb.h>
23#include <api/board/board_types.pb.h>
24#include <api/schematic/schematic_types.pb.h>
40 case types::KiCadObjectType::KOT_PCB_PAD:
return PCB_PAD_T;
41 case types::KiCadObjectType::KOT_PCB_SHAPE:
return PCB_SHAPE_T;
43 case types::KiCadObjectType::KOT_PCB_FIELD:
return PCB_FIELD_T;
45 case types::KiCadObjectType::KOT_PCB_TEXT:
return PCB_TEXT_T;
46 case types::KiCadObjectType::KOT_PCB_TEXTBOX:
return PCB_TEXTBOX_T;
47 case types::KiCadObjectType::KOT_PCB_TABLE:
return PCB_TABLE_T;
49 case types::KiCadObjectType::KOT_PCB_TRACE:
return PCB_TRACE_T;
50 case types::KiCadObjectType::KOT_PCB_VIA:
return PCB_VIA_T;
51 case types::KiCadObjectType::KOT_PCB_ARC:
return PCB_ARC_T;
52 case types::KiCadObjectType::KOT_PCB_MARKER:
return PCB_MARKER_T;
54 case types::KiCadObjectType::KOT_PCB_ZONE:
return PCB_ZONE_T;
55 case types::KiCadObjectType::KOT_PCB_GROUP:
return PCB_GROUP_T;
56 case types::KiCadObjectType::KOT_SCH_MARKER:
return SCH_MARKER_T;
57 case types::KiCadObjectType::KOT_SCH_JUNCTION:
return SCH_JUNCTION_T;
61 case types::KiCadObjectType::KOT_SCH_LINE:
return SCH_LINE_T;
62 case types::KiCadObjectType::KOT_SCH_SHAPE:
return SCH_SHAPE_T;
63 case types::KiCadObjectType::KOT_SCH_BITMAP:
return SCH_BITMAP_T;
64 case types::KiCadObjectType::KOT_SCH_TEXTBOX:
return SCH_TEXTBOX_T;
65 case types::KiCadObjectType::KOT_SCH_TEXT:
return SCH_TEXT_T;
66 case types::KiCadObjectType::KOT_SCH_TABLE:
return SCH_TABLE_T;
68 case types::KiCadObjectType::KOT_SCH_LABEL:
return SCH_LABEL_T;
72 case types::KiCadObjectType::KOT_SCH_FIELD:
return SCH_FIELD_T;
73 case types::KiCadObjectType::KOT_SCH_SYMBOL:
return SCH_SYMBOL_T;
75 case types::KiCadObjectType::KOT_SCH_SHEET:
return SCH_SHEET_T;
76 case types::KiCadObjectType::KOT_SCH_PIN:
return SCH_PIN_T;
77 case types::KiCadObjectType::KOT_LIB_SYMBOL:
return LIB_SYMBOL_T;
78 case types::KiCadObjectType::KOT_WSG_LINE:
return WSG_LINE_T;
79 case types::KiCadObjectType::KOT_WSG_RECT:
return WSG_RECT_T;
80 case types::KiCadObjectType::KOT_WSG_POLY:
return WSG_POLY_T;
81 case types::KiCadObjectType::KOT_WSG_TEXT:
return WSG_TEXT_T;
82 case types::KiCadObjectType::KOT_WSG_BITMAP:
return WSG_BITMAP_T;
83 case types::KiCadObjectType::KOT_WSG_PAGE:
return WSG_PAGE_T;
85 case types::KiCadObjectType::KOT_UNKNOWN:
return TYPE_NOT_INIT;
88 "Unhandled case in FromProtoEnum<types::KiCadObjectType>" );
99 case PCB_PAD_T:
return types::KiCadObjectType::KOT_PCB_PAD;
100 case PCB_SHAPE_T:
return types::KiCadObjectType::KOT_PCB_SHAPE;
102 case PCB_FIELD_T:
return types::KiCadObjectType::KOT_PCB_FIELD;
103 case PCB_GENERATOR_T:
return types::KiCadObjectType::KOT_PCB_GENERATOR;
104 case PCB_TEXT_T:
return types::KiCadObjectType::KOT_PCB_TEXT;
105 case PCB_TEXTBOX_T:
return types::KiCadObjectType::KOT_PCB_TEXTBOX;
106 case PCB_TABLE_T:
return types::KiCadObjectType::KOT_PCB_TABLE;
107 case PCB_TABLECELL_T:
return types::KiCadObjectType::KOT_PCB_TABLECELL;
108 case PCB_TRACE_T:
return types::KiCadObjectType::KOT_PCB_TRACE;
109 case PCB_VIA_T:
return types::KiCadObjectType::KOT_PCB_VIA;
110 case PCB_ARC_T:
return types::KiCadObjectType::KOT_PCB_ARC;
111 case PCB_MARKER_T:
return types::KiCadObjectType::KOT_PCB_MARKER;
112 case PCB_DIMENSION_T:
return types::KiCadObjectType::KOT_PCB_DIMENSION;
113 case PCB_ZONE_T:
return types::KiCadObjectType::KOT_PCB_ZONE;
114 case PCB_GROUP_T:
return types::KiCadObjectType::KOT_PCB_GROUP;
115 case SCH_MARKER_T:
return types::KiCadObjectType::KOT_SCH_MARKER;
116 case SCH_JUNCTION_T:
return types::KiCadObjectType::KOT_SCH_JUNCTION;
120 case SCH_LINE_T:
return types::KiCadObjectType::KOT_SCH_LINE;
121 case SCH_SHAPE_T:
return types::KiCadObjectType::KOT_SCH_SHAPE;
122 case SCH_BITMAP_T:
return types::KiCadObjectType::KOT_SCH_BITMAP;
123 case SCH_TEXTBOX_T:
return types::KiCadObjectType::KOT_SCH_TEXTBOX;
124 case SCH_TEXT_T:
return types::KiCadObjectType::KOT_SCH_TEXT;
125 case SCH_TABLE_T:
return types::KiCadObjectType::KOT_SCH_TABLE;
126 case SCH_TABLECELL_T:
return types::KiCadObjectType::KOT_SCH_TABLECELL;
127 case SCH_LABEL_T:
return types::KiCadObjectType::KOT_SCH_LABEL;
131 case SCH_FIELD_T:
return types::KiCadObjectType::KOT_SCH_FIELD;
132 case SCH_SYMBOL_T:
return types::KiCadObjectType::KOT_SCH_SYMBOL;
133 case SCH_SHEET_PIN_T:
return types::KiCadObjectType::KOT_SCH_SHEET_PIN;
134 case SCH_SHEET_T:
return types::KiCadObjectType::KOT_SCH_SHEET;
135 case SCH_PIN_T:
return types::KiCadObjectType::KOT_SCH_PIN;
136 case LIB_SYMBOL_T:
return types::KiCadObjectType::KOT_LIB_SYMBOL;
137 case WSG_LINE_T:
return types::KiCadObjectType::KOT_WSG_LINE;
138 case WSG_RECT_T:
return types::KiCadObjectType::KOT_WSG_RECT;
139 case WSG_POLY_T:
return types::KiCadObjectType::KOT_WSG_POLY;
140 case WSG_TEXT_T:
return types::KiCadObjectType::KOT_WSG_TEXT;
141 case WSG_BITMAP_T:
return types::KiCadObjectType::KOT_WSG_BITMAP;
142 case WSG_PAGE_T:
return types::KiCadObjectType::KOT_WSG_PAGE;
144 wxCHECK_MSG(
false, types::KiCadObjectType::KOT_UNKNOWN,
145 "Unhandled case in ToProtoEnum<KICAD_T>");
157 case board::types::BoardLayer::BL_F_Cu:
return F_Cu;
158 case board::types::BoardLayer::BL_In1_Cu:
return In1_Cu;
159 case board::types::BoardLayer::BL_In2_Cu:
return In2_Cu;
160 case board::types::BoardLayer::BL_In3_Cu:
return In3_Cu;
161 case board::types::BoardLayer::BL_In4_Cu:
return In4_Cu;
162 case board::types::BoardLayer::BL_In5_Cu:
return In5_Cu;
163 case board::types::BoardLayer::BL_In6_Cu:
return In6_Cu;
164 case board::types::BoardLayer::BL_In7_Cu:
return In7_Cu;
165 case board::types::BoardLayer::BL_In8_Cu:
return In8_Cu;
166 case board::types::BoardLayer::BL_In9_Cu:
return In9_Cu;
167 case board::types::BoardLayer::BL_In10_Cu:
return In10_Cu;
168 case board::types::BoardLayer::BL_In11_Cu:
return In11_Cu;
169 case board::types::BoardLayer::BL_In12_Cu:
return In12_Cu;
170 case board::types::BoardLayer::BL_In13_Cu:
return In13_Cu;
171 case board::types::BoardLayer::BL_In14_Cu:
return In14_Cu;
172 case board::types::BoardLayer::BL_In15_Cu:
return In15_Cu;
173 case board::types::BoardLayer::BL_In16_Cu:
return In16_Cu;
174 case board::types::BoardLayer::BL_In17_Cu:
return In17_Cu;
175 case board::types::BoardLayer::BL_In18_Cu:
return In18_Cu;
176 case board::types::BoardLayer::BL_In19_Cu:
return In19_Cu;
177 case board::types::BoardLayer::BL_In20_Cu:
return In20_Cu;
178 case board::types::BoardLayer::BL_In21_Cu:
return In21_Cu;
179 case board::types::BoardLayer::BL_In22_Cu:
return In22_Cu;
180 case board::types::BoardLayer::BL_In23_Cu:
return In23_Cu;
181 case board::types::BoardLayer::BL_In24_Cu:
return In24_Cu;
182 case board::types::BoardLayer::BL_In25_Cu:
return In25_Cu;
183 case board::types::BoardLayer::BL_In26_Cu:
return In26_Cu;
184 case board::types::BoardLayer::BL_In27_Cu:
return In27_Cu;
185 case board::types::BoardLayer::BL_In28_Cu:
return In28_Cu;
186 case board::types::BoardLayer::BL_In29_Cu:
return In29_Cu;
187 case board::types::BoardLayer::BL_In30_Cu:
return In30_Cu;
188 case board::types::BoardLayer::BL_B_Cu:
return B_Cu;
189 case board::types::BoardLayer::BL_B_Adhes:
return B_Adhes;
190 case board::types::BoardLayer::BL_F_Adhes:
return F_Adhes;
191 case board::types::BoardLayer::BL_B_Paste:
return B_Paste;
192 case board::types::BoardLayer::BL_F_Paste:
return F_Paste;
193 case board::types::BoardLayer::BL_B_SilkS:
return B_SilkS;
194 case board::types::BoardLayer::BL_F_SilkS:
return F_SilkS;
195 case board::types::BoardLayer::BL_B_Mask:
return B_Mask;
196 case board::types::BoardLayer::BL_F_Mask:
return F_Mask;
197 case board::types::BoardLayer::BL_Dwgs_User:
return Dwgs_User;
198 case board::types::BoardLayer::BL_Cmts_User:
return Cmts_User;
199 case board::types::BoardLayer::BL_Eco1_User:
return Eco1_User;
200 case board::types::BoardLayer::BL_Eco2_User:
return Eco2_User;
201 case board::types::BoardLayer::BL_Edge_Cuts:
return Edge_Cuts;
202 case board::types::BoardLayer::BL_Margin:
return Margin;
203 case board::types::BoardLayer::BL_B_CrtYd:
return B_CrtYd;
204 case board::types::BoardLayer::BL_F_CrtYd:
return F_CrtYd;
205 case board::types::BoardLayer::BL_B_Fab:
return B_Fab;
206 case board::types::BoardLayer::BL_F_Fab:
return F_Fab;
207 case board::types::BoardLayer::BL_User_1:
return User_1;
208 case board::types::BoardLayer::BL_User_2:
return User_2;
209 case board::types::BoardLayer::BL_User_3:
return User_3;
210 case board::types::BoardLayer::BL_User_4:
return User_4;
211 case board::types::BoardLayer::BL_User_5:
return User_5;
212 case board::types::BoardLayer::BL_User_6:
return User_6;
213 case board::types::BoardLayer::BL_User_7:
return User_7;
214 case board::types::BoardLayer::BL_User_8:
return User_8;
215 case board::types::BoardLayer::BL_User_9:
return User_9;
220 "Unhandled case in FromProtoEnum<board::types::BoardLayer>" );
232 case F_Cu:
return board::types::BoardLayer::BL_F_Cu;
233 case In1_Cu:
return board::types::BoardLayer::BL_In1_Cu;
234 case In2_Cu:
return board::types::BoardLayer::BL_In2_Cu;
235 case In3_Cu:
return board::types::BoardLayer::BL_In3_Cu;
236 case In4_Cu:
return board::types::BoardLayer::BL_In4_Cu;
237 case In5_Cu:
return board::types::BoardLayer::BL_In5_Cu;
238 case In6_Cu:
return board::types::BoardLayer::BL_In6_Cu;
239 case In7_Cu:
return board::types::BoardLayer::BL_In7_Cu;
240 case In8_Cu:
return board::types::BoardLayer::BL_In8_Cu;
241 case In9_Cu:
return board::types::BoardLayer::BL_In9_Cu;
242 case In10_Cu:
return board::types::BoardLayer::BL_In10_Cu;
243 case In11_Cu:
return board::types::BoardLayer::BL_In11_Cu;
244 case In12_Cu:
return board::types::BoardLayer::BL_In12_Cu;
245 case In13_Cu:
return board::types::BoardLayer::BL_In13_Cu;
246 case In14_Cu:
return board::types::BoardLayer::BL_In14_Cu;
247 case In15_Cu:
return board::types::BoardLayer::BL_In15_Cu;
248 case In16_Cu:
return board::types::BoardLayer::BL_In16_Cu;
249 case In17_Cu:
return board::types::BoardLayer::BL_In17_Cu;
250 case In18_Cu:
return board::types::BoardLayer::BL_In18_Cu;
251 case In19_Cu:
return board::types::BoardLayer::BL_In19_Cu;
252 case In20_Cu:
return board::types::BoardLayer::BL_In20_Cu;
253 case In21_Cu:
return board::types::BoardLayer::BL_In21_Cu;
254 case In22_Cu:
return board::types::BoardLayer::BL_In22_Cu;
255 case In23_Cu:
return board::types::BoardLayer::BL_In23_Cu;
256 case In24_Cu:
return board::types::BoardLayer::BL_In24_Cu;
257 case In25_Cu:
return board::types::BoardLayer::BL_In25_Cu;
258 case In26_Cu:
return board::types::BoardLayer::BL_In26_Cu;
259 case In27_Cu:
return board::types::BoardLayer::BL_In27_Cu;
260 case In28_Cu:
return board::types::BoardLayer::BL_In28_Cu;
261 case In29_Cu:
return board::types::BoardLayer::BL_In29_Cu;
262 case In30_Cu:
return board::types::BoardLayer::BL_In30_Cu;
263 case B_Cu:
return board::types::BoardLayer::BL_B_Cu;
264 case B_Adhes:
return board::types::BoardLayer::BL_B_Adhes;
265 case F_Adhes:
return board::types::BoardLayer::BL_F_Adhes;
266 case B_Paste:
return board::types::BoardLayer::BL_B_Paste;
267 case F_Paste:
return board::types::BoardLayer::BL_F_Paste;
268 case B_SilkS:
return board::types::BoardLayer::BL_B_SilkS;
269 case F_SilkS:
return board::types::BoardLayer::BL_F_SilkS;
270 case B_Mask:
return board::types::BoardLayer::BL_B_Mask;
271 case F_Mask:
return board::types::BoardLayer::BL_F_Mask;
272 case Dwgs_User:
return board::types::BoardLayer::BL_Dwgs_User;
273 case Cmts_User:
return board::types::BoardLayer::BL_Cmts_User;
274 case Eco1_User:
return board::types::BoardLayer::BL_Eco1_User;
275 case Eco2_User:
return board::types::BoardLayer::BL_Eco2_User;
276 case Edge_Cuts:
return board::types::BoardLayer::BL_Edge_Cuts;
277 case Margin:
return board::types::BoardLayer::BL_Margin;
278 case B_CrtYd:
return board::types::BoardLayer::BL_B_CrtYd;
279 case F_CrtYd:
return board::types::BoardLayer::BL_F_CrtYd;
280 case B_Fab:
return board::types::BoardLayer::BL_B_Fab;
281 case F_Fab:
return board::types::BoardLayer::BL_F_Fab;
282 case User_1:
return board::types::BoardLayer::BL_User_1;
283 case User_2:
return board::types::BoardLayer::BL_User_2;
284 case User_3:
return board::types::BoardLayer::BL_User_3;
285 case User_4:
return board::types::BoardLayer::BL_User_4;
286 case User_5:
return board::types::BoardLayer::BL_User_5;
287 case User_6:
return board::types::BoardLayer::BL_User_6;
288 case User_7:
return board::types::BoardLayer::BL_User_7;
289 case User_8:
return board::types::BoardLayer::BL_User_8;
290 case User_9:
return board::types::BoardLayer::BL_User_9;
292 wxCHECK_MSG(
false, board::types::BoardLayer::BL_UNKNOWN,
293 "Unhandled case in ToProtoEnum<PCB_LAYER_ID>");
306 "Unhandled case in FromProtoEnum<schematic::types::SchematicLayer>" );
318 wxCHECK_MSG(
false, schematic::types::SchematicLayer::SL_UNKNOWN,
319 "Unhandled case in ToProtoEnum<SCH_LAYER_ID>");
337 "Unhandled case in FromProtoEnum<types::HorizontalAlignment>" );
352 wxCHECK_MSG(
false, types::HorizontalAlignment::HA_UNKNOWN,
353 "Unhandled case in ToProtoEnum<GR_TEXT_H_ALIGN_T>");
371 "Unhandled case in FromProtoEnum<types::VerticalAlignment>" );
386 wxCHECK_MSG(
false, types::VerticalAlignment::VA_UNKNOWN,
387 "Unhandled case in ToProtoEnum<GR_TEXT_V_ALIGN_T>");
403 case types::StrokeLineStyle::SLS_UNKNOWN:
406 "Unhandled case in FromProtoEnum<types::StrokeLineStyle>" );
423 wxCHECK_MSG(
false, types::StrokeLineStyle::SLS_UNKNOWN,
424 "Unhandled case in ToProtoEnum<LINE_STYLE>");
types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
SCH_LAYER_ID
Eeschema drawing layers.
PCB_LAYER_ID
A quick note on layer IDs:
LINE_STYLE
Dashed line types.
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)