KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_layers.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) 2009 Isaac Marino Bavaresco, [email protected]
5 * Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22
23#include <confirm.h>
24#include <core/arraydim.h>
25#include <core/kicad_algo.h>
26#include <pcb_edit_frame.h>
27#include <tool/tool_manager.h>
28#include <tools/pcb_actions.h>
29#include <board.h>
30#include <collectors.h>
31#include <footprint.h>
32#include <layer_ids.h>
33#include <pad.h>
34#include <pcb_track.h>
35#include <panel_setup_layers.h>
38
39#include <wx/choicdlg.h>
40#include <wx/msgdlg.h>
41#include <eda_list_dialog.h>
42
43#include <list>
44#include <set>
45
46
50static void mandatoryLayerCbSetup( wxCheckBox& aCheckBox )
51{
52 aCheckBox.Show();
53 aCheckBox.Disable();
54 aCheckBox.SetValue( true );
55 aCheckBox.SetToolTip( _( "This layer is required and cannot be disabled" ) );
56}
57
58
59PANEL_SETUP_LAYERS::PANEL_SETUP_LAYERS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) :
60 PANEL_SETUP_LAYERS_BASE( aParentWindow ),
61 m_frame( aFrame ),
62 m_physicalStackup( nullptr ),
63 m_initialized( false ),
64 m_CrtYdFrontCheckBox( nullptr ),
65 m_CrtYdFrontName( nullptr ),
66 m_CrtYdFrontStaticText( nullptr ),
67 m_FabFrontCheckBox( nullptr ),
68 m_FabFrontName( nullptr ),
69 m_FabFrontStaticText( nullptr ),
70 m_AdhesFrontCheckBox( nullptr ),
71 m_AdhesFrontName( nullptr ),
72 m_AdhesFrontStaticText( nullptr ),
73 m_SoldPFrontCheckBox( nullptr ),
74 m_SoldPFrontName( nullptr ),
75 m_SoldPFrontStaticText( nullptr ),
76 m_SilkSFrontCheckBox( nullptr ),
77 m_SilkSFrontName( nullptr ),
78 m_SilkSFrontStaticText( nullptr ),
79 m_MaskFrontCheckBox( nullptr ),
80 m_MaskFrontName( nullptr ),
81 m_MaskFrontStaticText( nullptr ),
82 m_MaskBackCheckBox( nullptr ),
83 m_MaskBackName( nullptr ),
84 m_MaskBackStaticText( nullptr ),
85 m_SilkSBackCheckBox( nullptr ),
86 m_SilkSBackName( nullptr ),
87 m_SilkSBackStaticText( nullptr ),
88 m_SoldPBackCheckBox( nullptr ),
89 m_SoldPBackName( nullptr ),
90 m_SoldPBackStaticText( nullptr ),
91 m_AdhesBackCheckBox( nullptr ),
92 m_AdhesBackName( nullptr ),
93 m_AdhesBackStaticText( nullptr ),
94 m_FabBackCheckBox( nullptr ),
95 m_FabBackName( nullptr ),
96 m_FabBackStaticText( nullptr ),
97 m_CrtYdBackCheckBox( nullptr ),
98 m_CrtYdBackName( nullptr ),
99 m_CrtYdBackStaticText( nullptr ),
100 m_PCBEdgesCheckBox( nullptr ),
101 m_PCBEdgesName( nullptr ),
102 m_PCBEdgesStaticText( nullptr ),
103 m_MarginCheckBox( nullptr ),
104 m_MarginName( nullptr ),
105 m_MarginStaticText( nullptr ),
106 m_Eco1CheckBox( nullptr ),
107 m_Eco1Name( nullptr ),
108 m_Eco1StaticText( nullptr ),
109 m_Eco2CheckBox( nullptr ),
110 m_Eco2Name( nullptr ),
111 m_Eco2StaticText( nullptr ),
112 m_CommentsCheckBox( nullptr ),
113 m_CommentsName( nullptr ),
114 m_CommentsStaticText( nullptr ),
115 m_DrawingsCheckBox( nullptr ),
116 m_DrawingsName( nullptr ),
117 m_DrawingsStaticText( nullptr )
118{
119 m_pcb = aFrame->GetBoard();
120}
121
122
124{
125 m_CrtYdFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
126 wxDefaultPosition, wxDefaultSize, 0 );
128 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT
129 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
130 5 );
131
132 m_CrtYdFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_CrtYd ),
133 wxDefaultPosition, wxDefaultSize, 0 );
134 m_CrtYdFrontName->SetMinSize( wxSize( 160, -1 ) );
135
136 m_LayersSizer->Add( m_CrtYdFrontName, 0, wxRIGHT | wxEXPAND, 5 );
137
139 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, testing" ),
140 wxDefaultPosition, wxDefaultSize, 0 );
141 m_CrtYdFrontStaticText->Wrap( -1 );
142 m_CrtYdFrontStaticText->SetMinSize( wxSize( 150, -1 ) );
143
144 m_LayersSizer->Add( m_CrtYdFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
145
146 m_FabFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
147 wxDefaultPosition, wxDefaultSize, 0 );
148 m_FabFrontCheckBox->SetToolTip(
149 _( "If you want a fabrication layer for the front side of the board" ) );
150
152 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
153
154 m_FabFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Fab ),
155 wxDefaultPosition, wxDefaultSize, 0 );
156 m_LayersSizer->Add( m_FabFrontName, 0, wxEXPAND | wxRIGHT, 5 );
157
159 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, manufacturing" ),
160 wxDefaultPosition, wxDefaultSize, 0 );
161 m_FabFrontStaticText->Wrap( -1 );
162 m_LayersSizer->Add( m_FabFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
163
164 m_AdhesFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
165 wxDefaultPosition, wxDefaultSize, 0 );
166 m_AdhesFrontCheckBox->SetToolTip(
167 _( "If you want an adhesive template for the front side of the board" ) );
168
170 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
171
172 m_AdhesFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Adhes ),
173 wxDefaultPosition, wxDefaultSize, 0 );
174 m_LayersSizer->Add( m_AdhesFrontName, 0, wxEXPAND | wxRIGHT, 5 );
175
177 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
178 wxDefaultPosition, wxDefaultSize, 0 );
179 m_AdhesFrontStaticText->Wrap( -1 );
180 m_LayersSizer->Add( m_AdhesFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
181
182 m_SoldPFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
183 wxDefaultPosition, wxDefaultSize, 0 );
184 m_SoldPFrontCheckBox->SetToolTip(
185 _( "If you want a solder paste layer for front side of the board" ) );
186
188 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
189
190 m_SoldPFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Paste ),
191 wxDefaultPosition, wxDefaultSize, 0 );
192 m_LayersSizer->Add( m_SoldPFrontName, 0, wxEXPAND | wxRIGHT, 5 );
193
195 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
196 wxDefaultPosition, wxDefaultSize, 0 );
197 m_SoldPFrontStaticText->Wrap( -1 );
198 m_LayersSizer->Add( m_SoldPFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
199
200 m_SilkSFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
201 wxDefaultPosition, wxDefaultSize, 0 );
202 m_SilkSFrontCheckBox->SetToolTip(
203 _( "If you want a silk screen layer for the front side of the board" ) );
204
206 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
207
208 m_SilkSFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_SilkS ),
209 wxDefaultPosition, wxDefaultSize, 0 );
210 m_LayersSizer->Add( m_SilkSFrontName, 0, wxEXPAND | wxRIGHT, 5 );
211
213 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
214 wxDefaultPosition, wxDefaultSize, 0 );
215 m_SilkSFrontStaticText->Wrap( -1 );
216 m_LayersSizer->Add( m_SilkSFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
217
218 m_MaskFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
219 wxDefaultPosition, wxDefaultSize, 0 );
220 m_MaskFrontCheckBox->SetToolTip(
221 _( "If you want a solder mask layer for the front of the board" ) );
222
224 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
225
226 m_MaskFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Mask ),
227 wxDefaultPosition, wxDefaultSize, 0 );
228 m_LayersSizer->Add( m_MaskFrontName, 0, wxEXPAND | wxRIGHT, 5 );
229
231 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
232 wxDefaultPosition, wxDefaultSize, 0 );
233 m_MaskFrontStaticText->Wrap( -1 );
234 m_LayersSizer->Add( m_MaskFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
235
237}
238
239
241{
242 m_MaskBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
243 wxDefaultPosition, wxDefaultSize, 0 );
244 m_MaskBackCheckBox->SetToolTip(
245 _( "If you want a solder mask layer for the back side of the board" ) );
246
248 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
249
250 m_MaskBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Mask ),
251 wxDefaultPosition, wxDefaultSize, 0 );
252 m_LayersSizer->Add( m_MaskBackName, 0, wxEXPAND | wxRIGHT, 5 );
253
255 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
256 wxDefaultPosition, wxDefaultSize, 0 );
257 m_MaskBackStaticText->Wrap( -1 );
258 m_LayersSizer->Add( m_MaskBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
259
260 m_SilkSBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
261 wxDefaultPosition, wxDefaultSize, 0 );
262 m_SilkSBackCheckBox->SetToolTip(
263 _( "If you want a silk screen layer for the back side of the board" ) );
264
266 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
267
268 m_SilkSBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_SilkS ),
269 wxDefaultPosition, wxDefaultSize, 0 );
270 m_LayersSizer->Add( m_SilkSBackName, 0, wxEXPAND | wxRIGHT, 5 );
271
273 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
274 wxDefaultPosition, wxDefaultSize, 0 );
275 m_SilkSBackStaticText->Wrap( -1 );
276 m_LayersSizer->Add( m_SilkSBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
277
278 m_SoldPBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
279 wxDefaultPosition, wxDefaultSize, 0 );
280 m_SoldPBackCheckBox->SetToolTip(
281 _( "If you want a solder paste layer for the back side of the board" ) );
282
284 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
285
286 m_SoldPBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Paste ),
287 wxDefaultPosition, wxDefaultSize, 0 );
288 m_LayersSizer->Add( m_SoldPBackName, 0, wxEXPAND | wxRIGHT, 5 );
289
291 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
292 wxDefaultPosition, wxDefaultSize, 0 );
293 m_SoldPBackStaticText->Wrap( -1 );
294 m_LayersSizer->Add( m_SoldPBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
295
296 m_AdhesBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
297 wxDefaultPosition, wxDefaultSize, 0 );
298 m_AdhesBackCheckBox->SetToolTip(
299 _( "If you want an adhesive layer for the back side of the board" ) );
300
302 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
303
304 m_AdhesBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Adhes ),
305 wxDefaultPosition, wxDefaultSize, 0 );
306 m_LayersSizer->Add( m_AdhesBackName, 0, wxEXPAND | wxRIGHT, 5 );
307
309 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
310 wxDefaultPosition, wxDefaultSize, 0 );
311 m_AdhesBackStaticText->Wrap( -1 );
312 m_LayersSizer->Add( m_AdhesBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
313
314 m_FabBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
315 wxDefaultPosition, wxDefaultSize, 0 );
316 m_FabBackCheckBox->SetToolTip(
317 _( "If you want a fabrication layer for the back side of the board" ) );
318
320 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
321
322 m_FabBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Fab ),
323 wxDefaultPosition, wxDefaultSize, 0 );
324 m_LayersSizer->Add( m_FabBackName, 0, wxEXPAND | wxRIGHT, 5 );
325
327 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, manufacturing" ),
328 wxDefaultPosition, wxDefaultSize, 0 );
329 m_FabBackStaticText->Wrap( -1 );
330 m_LayersSizer->Add( m_FabBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
331
332
333 m_CrtYdBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
334 wxDefaultPosition, wxDefaultSize, 0 );
336 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT
337 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
338 5 );
339
340 m_CrtYdBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_CrtYd ),
341 wxDefaultPosition, wxDefaultSize, 0 );
342 m_LayersSizer->Add( m_CrtYdBackName, 0, wxEXPAND | wxRIGHT, 5 );
343
345 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, testing" ),
346 wxDefaultPosition, wxDefaultSize, 0 );
347 m_CrtYdBackStaticText->Wrap( -1 );
348 m_LayersSizer->Add( m_CrtYdBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 );
349
350
351 m_PCBEdgesCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
352 wxDefaultPosition, wxDefaultSize, 0 );
354 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT
355 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
356 5 );
357
358 m_PCBEdgesName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Edge_Cuts ),
359 wxDefaultPosition, wxDefaultSize, 0 );
360 m_LayersSizer->Add( m_PCBEdgesName, 0, wxEXPAND | wxRIGHT, 5 );
361
363 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Board contour" ),
364 wxDefaultPosition, wxDefaultSize, 0 );
365 m_PCBEdgesStaticText->Wrap( -1 );
366 m_LayersSizer->Add( m_PCBEdgesStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
367
368 m_MarginCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
369 wxDefaultPosition, wxDefaultSize, 0 );
371 wxLEFT | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL
372 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
373 5 );
374
375 m_MarginName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Margin ),
376 wxDefaultPosition, wxDefaultSize, 0 );
377 m_LayersSizer->Add( m_MarginName, 0, wxEXPAND | wxRIGHT, 5 );
378
380 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Board contour setback" ),
381 wxDefaultPosition, wxDefaultSize, 0 );
382 m_MarginStaticText->Wrap( -1 );
383 m_LayersSizer->Add( m_MarginStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
384
385 m_Eco1CheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
386 wxDefaultPosition, wxDefaultSize, 0 );
388 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
389
390 m_Eco1Name = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Eco1_User ),
391 wxDefaultPosition, wxDefaultSize, 0 );
392 m_LayersSizer->Add( m_Eco1Name, 0, wxEXPAND | wxRIGHT, 5 );
393
394 m_Eco1StaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
395 wxDefaultPosition, wxDefaultSize, 0 );
396 m_Eco1StaticText->Wrap( -1 );
397 m_LayersSizer->Add( m_Eco1StaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
398
399 m_Eco2CheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
400 wxDefaultPosition, wxDefaultSize, 0 );
402 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
403
404 m_Eco2Name = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Eco2_User ),
405 wxDefaultPosition, wxDefaultSize, 0 );
406 m_LayersSizer->Add( m_Eco2Name, 0, wxEXPAND | wxRIGHT, 5 );
407
408 m_Eco2StaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
409 wxDefaultPosition, wxDefaultSize, 0 );
410 m_Eco2StaticText->Wrap( -1 );
411 m_LayersSizer->Add( m_Eco2StaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
412
413 m_CommentsCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
414 wxDefaultPosition, wxDefaultSize, 0 );
415 m_CommentsCheckBox->SetToolTip( _( "If you want a separate layer for comments or notes" ) );
416
418 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
419
420 m_CommentsName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Cmts_User ),
421 wxDefaultPosition, wxDefaultSize, 0 );
422 m_LayersSizer->Add( m_CommentsName, 0, wxEXPAND | wxRIGHT, 5 );
423
424 m_CommentsStaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
425 wxDefaultPosition, wxDefaultSize, 0 );
426 m_CommentsStaticText->Wrap( -1 );
427 m_LayersSizer->Add( m_CommentsStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
428
429 m_DrawingsCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
430 wxDefaultPosition, wxDefaultSize, 0 );
431 m_DrawingsCheckBox->SetToolTip( _( "If you want a layer for documentation drawings" ) );
432
434 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
435
436 m_DrawingsName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Dwgs_User ),
437 wxDefaultPosition, wxDefaultSize, 0 );
438 m_LayersSizer->Add( m_DrawingsName, 0, wxEXPAND | wxRIGHT, 5 );
439
440 m_DrawingsStaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
441 wxDefaultPosition, wxDefaultSize, 0 );
442 m_DrawingsStaticText->Wrap( -1 );
444 wxALIGN_CENTER_VERTICAL | wxBOTTOM | wxLEFT | wxRIGHT, 5 );
445
449}
450
451
453{
454 Freeze();
455 m_layersControls.clear();
456 m_LayersSizer->Clear( true );
464
465
466 LSET layers = m_enabledLayers;
467
468 for( auto it = layers.copper_layers_begin(); it != layers.copper_layers_end(); ++it )
469 {
470 wxCheckBox* cb = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
471 cb->SetToolTip( _( "Use the Physical Stackup page to change the number of copper layers." ) );
472 cb->Disable();
473
474 m_LayersSizer->Add( cb, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
475
476 wxTextCtrl* txt = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( *it ), wxDefaultPosition, wxDefaultSize, 0 );
477 txt->SetToolTip( _("Layer Name") );
478
479 m_LayersSizer->Add( txt, 0, wxEXPAND|wxRIGHT, 5 );
480
481 wxArrayString choices;
482 choices.Add( _( "signal" ) );
483 choices.Add( _( "power plane" ) );
484 choices.Add( _( "mixed" ) );
485 choices.Add( _( "jumper" ) );
486 wxChoice* choice = new wxChoice( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices, 0 );
487 choice->SetSelection( 0 );
488 choice->SetToolTip( _("Copper layer type for Freerouter and other external routers.\n"
489 "Power plane layers are removed from Freerouter's layer menus.") );
490
491 m_LayersSizer->Add( choice, 0, wxRIGHT|wxEXPAND, 5 );
492 m_layersControls[*it] = PANEL_SETUP_LAYERS_CTLs( txt, cb, choice );
493 }
494
508
509 layers &= LSET::UserDefinedLayersMask();
510
511 for( auto it = layers.non_copper_layers_begin(); it != layers.non_copper_layers_end(); ++it )
512 {
513 append_user_layer( *it );
514 }
515
516 Thaw();
517 m_LayersListPanel->FitInside(); // Updates virtual size to fit subwindows, also auto-layouts.
518}
519
520
522{
523 wxCheckBox* cb = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString, wxDefaultPosition,
524 wxDefaultSize, 0 );
525 m_LayersSizer->Add( cb, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
526
527 wxTextCtrl* txt = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( aLayer ),
528 wxDefaultPosition, wxDefaultSize, 0 );
529 txt->SetToolTip( _( "Layer Name" ) );
530 m_LayersSizer->Add( txt, 0, wxEXPAND | wxRIGHT, 5 );
531
532 wxArrayString choices;
533 choices.Add( _( "Auxiliary" ) );
534 choices.Add( _( "Off-board, front" ) );
535 choices.Add( _( "Off-board, back" ) );
536
537 wxChoice* choice = new wxChoice( m_LayersListPanel, wxID_ANY, wxDefaultPosition,
538 wxDefaultSize, choices, 0 );
539 choice->SetSelection( 0 );
540 choice->SetToolTip(
541 _( "Auxiliary layers do not flip with board side, while back and front layers do." ) );
542
543 m_LayersSizer->Add( choice, 0, wxEXPAND | wxRIGHT, 5 );
544 m_layersControls[aLayer] = PANEL_SETUP_LAYERS_CTLs( txt, cb, choice );
545}
546
547
549{
550 return m_layersControls[aLayer].name;
551}
552
553
555{
556 return m_layersControls[aLayer].checkbox;
557}
558
559
561{
562 return dynamic_cast<wxChoice*>( m_layersControls[aLayer].choice );
563}
564
565
567{
568 m_enabledLayers = m_pcb->GetEnabledLayers();
569
570 // Rescue may be enabled, but should not be shown in this dialog
571 m_enabledLayers.reset( Rescue );
572
574
575 setCopperLayerCheckBoxes( m_pcb->GetCopperLayerCount() );
576
579
582
583 m_initialized = true;
584
585 return true;
586}
587
588
589void PANEL_SETUP_LAYERS::SyncCopperLayers( int aNumCopperLayers )
590{
591 BOARD* savedBoard = m_pcb;
592 BOARD temp;
593
594 m_pcb = &temp;
596
597 for( size_t ii = 0; ii < m_enabledLayers.size(); ii++ )
598 {
599 if( IsCopperLayer( int( ii ) ) )
600 m_enabledLayers.reset( ii );
601 }
602
603 m_enabledLayers |= LSET::AllCuMask( aNumCopperLayers );
604
606 setCopperLayerCheckBoxes( aNumCopperLayers );
607
610
613
614 m_pcb = savedBoard;
615}
616
617
619{
621
622 for( PCB_LAYER_ID layer : layers )
623 setLayerCheckBox( layer, m_pcb->IsLayerEnabled( layer ) );
624}
625
626
628{
629 // Set all the board's layer names into the dialog by calling BOARD::LayerName(),
630 // which will call BOARD::GetStandardLayerName() for non-coppers.
631
632 for( PCB_LAYER_ID layer : m_enabledLayers )
633 {
634 wxControl* ctl = getName( layer );
635
636 if( ctl )
637 {
638 wxString lname = m_pcb->GetLayerName( layer );
639
640 if( auto textCtl = dynamic_cast<wxTextCtrl*>( ctl ) )
641 textCtl->ChangeValue( lname ); // wxTextCtrl
642 else
643 ctl->SetLabel( lname ); // wxStaticText
644 }
645 }
646}
647
648
650{
651 for( auto& [layer,ctl] : m_layersControls )
652 setLayerCheckBox( layer, enabledLayers.test( layer ) );
653}
654
655
657{
658 LSET layers = m_enabledLayers & LSET::AllCuMask( m_pcb->GetCopperLayerCount() );
659
660 for( PCB_LAYER_ID cu_layer : m_enabledLayers.CuStack() )
661 {
662 wxChoice* ctl = getChoice( cu_layer );
663
664 switch ( m_pcb->GetLayerType( cu_layer ) )
665 {
666 case LT_SIGNAL: ctl->SetSelection( 0 ); break;
667 case LT_POWER: ctl->SetSelection( 1 ); break;
668 case LT_MIXED: ctl->SetSelection( 2 ); break;
669 case LT_JUMPER: ctl->SetSelection( 3 ); break;
670 default: ctl->SetSelection( 0 );
671 }
672
673 }
674
676
677 for( PCB_LAYER_ID layer : layers )
678 {
679 wxChoice* ctl = getChoice( layer );
680
681 switch( m_pcb->GetLayerType( layer ) )
682 {
683 case LT_AUX: ctl->SetSelection( 0 ); break;
684 case LT_FRONT: ctl->SetSelection( 1 ); break;
685 case LT_BACK: ctl->SetSelection( 2 ); break;
686 default: ctl->SetSelection( 0 ); break;
687 }
688 }
689}
690
691
693{
694 LSET layerMaskResult;
695
696 for( auto& [layer, _] : m_layersControls )
697 {
698 wxCheckBox* ctl = getCheckBox( layer );
699
700 if( ctl && ctl->IsChecked() )
701 layerMaskResult.set( layer );
702 }
703
704 return layerMaskResult;
705}
706
707
709{
711
712 if( !ctl.checkbox )
713 return;
714
715 ctl.checkbox->SetValue( isChecked );
716}
717
718
720{
721 if( copperCount > 0 )
722 {
723 wxCheckBox* fcu = getCheckBox( F_Cu );
724 mandatoryLayerCbSetup( *fcu );
725 }
726
727 if( copperCount > 0 )
728 {
729 wxCheckBox* bcu = getCheckBox( B_Cu );
730 mandatoryLayerCbSetup( *bcu );
731 }
732
733 LSET layers = m_enabledLayers & LSET::AllCuMask( copperCount );
734 layers.reset( F_Cu );
735 layers.reset( B_Cu );
736
737 for( PCB_LAYER_ID layer : layers )
738 {
739 wxCheckBox* cb = getCheckBox( layer );
741 }
742
743}
744
745
747{
748 bool modified = false;
749 LSET enabledLayers = GetUILayerMask();
750
751 LSET previousEnabled = m_pcb->GetEnabledLayers();
752
753 if( enabledLayers != previousEnabled )
754 {
755 m_pcb->SetEnabledLayers( enabledLayers );
756
757 LSET changedLayers = enabledLayers ^ previousEnabled;
758
759 /*
760 * Ensure enabled layers are also visible. This is mainly to avoid mistakes if some
761 * enabled layers are not visible when exiting this dialog.
762 */
763 m_pcb->SetVisibleLayers( m_pcb->GetVisibleLayers() | changedLayers );
764
765 /*
766 * Ensure items with through holes have all inner copper layers. (For historical reasons
767 * this is NOT trimmed to the currently-enabled inner layers.)
768 */
769 for( FOOTPRINT* fp : m_pcb->Footprints() )
770 {
771 for( PAD* pad : fp->Pads() )
772 {
773 if( pad->HasHole() && pad->IsOnCopperLayer() )
774 pad->SetLayerSet( pad->GetLayerSet() | LSET::InternalCuMask() );
775 }
776 }
777
778 // Tracks do not change their layer
779 // Vias layers are defined by the starting layer and the ending layer, so
780 // they are not modified by adding a layer.
781 // So do nothing for tracks/vias
782
783 modified = true;
784 }
785
786 for( PCB_LAYER_ID layer : enabledLayers )
787 {
788 wxString newLayerName = getName( layer )->GetValue();
789
790 if( m_pcb->GetLayerName( layer ) != newLayerName )
791 {
792 m_pcb->SetLayerName( layer, newLayerName );
793 modified = true;
794 }
795
796 if( IsCopperLayer( layer ) )
797 {
798 LAYER_T t;
799
800 switch( getChoice( layer )->GetCurrentSelection() )
801 {
802 case 0: t = LT_SIGNAL; break;
803 case 1: t = LT_POWER; break;
804 case 2: t = LT_MIXED; break;
805 case 3: t = LT_JUMPER; break;
806 default: t = LT_UNDEFINED; break;
807 }
808
809 if( m_pcb->GetLayerType( layer ) != t )
810 {
811 m_pcb->SetLayerType( layer, t );
812 modified = true;
813 }
814 }
815 else if( layer >= User_1 && !IsCopperLayer( layer ) )
816 {
817 LAYER_T t;
818
819 switch( getChoice( layer )->GetCurrentSelection() )
820 {
821 case 0: t = LT_AUX; break;
822 case 1: t = LT_FRONT; break;
823 case 2: t = LT_BACK; break;
824 default: t = LT_UNDEFINED; break;
825 }
826
827 if( m_pcb->GetLayerType( layer ) != t )
828 {
829 m_pcb->SetLayerType( layer, t );
830 modified = true;
831 }
832 }
833 }
834
835 LSET layers = enabledLayers & LSET::UserDefinedLayersMask();
836
837 for( PCB_LAYER_ID layer : layers )
838 {
839 wxString newLayerName = getName( layer )->GetValue();
840
841 if( m_pcb->GetLayerName( layer ) != newLayerName )
842 {
843 m_pcb->SetLayerName( layer, newLayerName );
844 modified = true;
845 }
846 }
847
848 return modified;
849}
850
851
853{
854 if( !testLayerNames() )
855 return false;
856
857 // Make sure we have the latest copper layer count
859 SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() );
860
861 wxString msg;
862 bool modified = false;
863 wxWindow* parent = wxGetTopLevelParent( this );
864
865 // Check for removed layers with items which will get deleted from the board.
866 LSEQ removedLayers = getRemovedLayersWithItems();
867
868 // Check for non-copper layers in use in footprints, and therefore not removable.
869 LSEQ notremovableLayers = getNonRemovableLayers();
870
871 if( !notremovableLayers.empty() )
872 {
873 for( PCB_LAYER_ID layer : notremovableLayers )
874 msg << m_pcb->GetLayerName( layer ) << wxT( "\n" );
875
876 if( !IsOK( parent, wxString::Format( _( "Footprints have some items on removed layers:\n"
877 "%s\n"
878 "These items will be no longer accessible\n"
879 "Do you wish to continue?" ),
880 msg ) ) )
881 {
882 return false;
883 }
884 }
885
886 if( !removedLayers.empty() )
887 {
888 std::vector<BOARD_ITEM*> items;
889 std::vector<wxString> itemDescriptions;
890
891 for( PCB_LAYER_ID layer : removedLayers )
892 {
893 PCB_LAYER_COLLECTOR collector;
894 collector.SetLayerId( layer );
896
897 for( int i = 0; i < collector.GetCount(); i++ )
898 {
899 BOARD_ITEM* item = collector[i];
900
901 if( item->Type() == PCB_FOOTPRINT_T || item->GetParentFootprint() )
902 continue;
903
904 items.push_back( item );
905 itemDescriptions.push_back( item->GetItemDescription( m_frame, true ) );
906 }
907
908 for( FOOTPRINT* footprint : m_pcb->Footprints() )
909 {
910 for( PAD* pad : footprint->Pads() )
911 {
912 if( pad->HasExplicitDefinitionForLayer( layer ) )
913 {
914 items.push_back( pad );
915 itemDescriptions.push_back( wxString::Format( _( "Pad %s of %s on %s" ),
916 pad->GetNumber(),
917 footprint->GetReference(),
918 m_pcb->GetLayerName( layer ) ) );
919 }
920 }
921 }
922 }
923
924 if( !items.empty() )
925 {
926 DIALOG_ITEMS_LIST dlg( parent, _( "Warning" ),
927 _( "Items have been found on removed layers. This operation will "
928 "delete all items from removed layers and cannot be undone." ),
929 _( "Show Details" ) );
930
931 dlg.AddItems( itemDescriptions );
932
934 [&]( int index )
935 {
936 if( index >= 0 && index < (int) items.size() )
937 {
938 m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
939 m_frame->GetToolManager()->RunAction( ACTIONS::selectItem, static_cast<EDA_ITEM*>( items[index] ) );
940 m_frame->GetCanvas()->Refresh();
941 }
942 } );
943
944 if( dlg.ShowModal() != wxID_OK )
945 return false;
946 }
947 }
948
949 // Delete all objects on layers that have been removed. Leaving them in copper layers
950 // can (will?) result in DRC errors and it pollutes the board file with cruft.
951 if( !removedLayers.empty() )
952 {
953 m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
954
955 for( PCB_LAYER_ID layer_id : removedLayers )
956 modified |= m_pcb->RemoveAllItemsOnLayer( layer_id );
957
958 // Undo state may have copies of pointers deleted above
959 m_frame->ClearUndoRedoList();
960 }
961
962 modified |= transferDataFromWindow();
963
964 if( modified )
965 m_frame->OnModify();
966
967 return true;
968}
969
970
972{
973 std::vector<wxString> names;
974 wxTextCtrl* ctl;
975
976 for( PCB_LAYER_ID layer : LSET::AllLayersMask() )
977 {
978 // we _can_ rely on m_enabledLayers being current here:
979
980 if( !m_enabledLayers[layer] )
981 continue;
982
983 ctl = (wxTextCtrl*) getName( layer );
984 wxString name = ctl->GetValue();
985
986 // Check name for legality:
987 // 1) Cannot be blank.
988 // 2) Cannot have blanks.
989 // 3) Cannot have " chars
990 // 4) Cannot be 'signal'
991 // 5) Must be unique.
992 // 6) Cannot have illegal chars in filenames ( some filenames are built from layer names )
993 // like : % $ \ " / :
994 wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
995 badchars.Append( '%' );
996
997 if( !name )
998 {
999 PAGED_DIALOG::GetDialog( this )->SetError( _( "Layer must have a name." ), this, ctl );
1000 return false;
1001 }
1002
1003 if( name.find_first_of( badchars ) != wxString::npos )
1004 {
1005 wxString msg = wxString::Format(_( "%s are forbidden in layer names." ), badchars );
1006 PAGED_DIALOG::GetDialog( this )->SetError( msg, this, ctl );
1007 return false;
1008 }
1009
1010 if( name == wxT( "signal" ) )
1011 {
1012 PAGED_DIALOG::GetDialog( this )->SetError( _( "Layer name \"signal\" is reserved." ), this, ctl );
1013 return false;
1014 }
1015
1016 for( const wxString& existingName : names )
1017 {
1018 if( name == existingName )
1019 {
1020 wxString msg = wxString::Format(_( "Layer name '%s' already in use." ), name );
1021 PAGED_DIALOG::GetDialog( this )->SetError( msg, this, ctl );
1022 return false;
1023 }
1024 }
1025
1026 names.push_back( name );
1027 }
1028
1029 return true;
1030}
1031
1032
1034{
1035 LSEQ removedLayers;
1036 LSET newLayers = GetUILayerMask();
1037 LSET curLayers = m_pcb->GetEnabledLayers();
1038
1039 if( newLayers == curLayers ) // Return an empty list if no change
1040 return removedLayers;
1041
1042 for( PCB_LAYER_ID layer_id : curLayers )
1043 {
1044 if( !newLayers[layer_id] )
1045 {
1046 bool hasItems = m_pcb->HasItemsOnLayer( layer_id );
1047
1048 if( !hasItems )
1049 {
1050 // Check for pads with custom properties on this layer
1051 for( FOOTPRINT* footprint : m_pcb->Footprints() )
1052 {
1053 for( PAD* pad : footprint->Pads() )
1054 {
1055 if( pad->HasExplicitDefinitionForLayer( layer_id ) )
1056 {
1057 hasItems = true;
1058 break;
1059 }
1060 }
1061 if( hasItems )
1062 break;
1063 }
1064 }
1065
1066 if( hasItems )
1067 removedLayers.push_back( layer_id );
1068 }
1069 }
1070
1071 return removedLayers;
1072}
1073
1074
1076{
1077 // Build the list of non-copper layers in use in footprints.
1078 LSEQ inUseLayers;
1079 LSET newLayers = GetUILayerMask();
1080 LSET curLayers = m_pcb->GetEnabledLayers();
1081
1082 if( newLayers == curLayers ) // Return an empty list if no change
1083 return inUseLayers;
1084
1085 PCB_LAYER_COLLECTOR collector;
1086
1087 for( PCB_LAYER_ID layer_id : curLayers )
1088 {
1089 if( IsCopperLayer( layer_id ) ) // Copper layers are not taken into account here
1090 continue;
1091
1092 if( !newLayers.Contains( layer_id ) )
1093 {
1094 collector.SetLayerId( layer_id );
1096
1097 if( collector.GetCount() != 0 )
1098 inUseLayers.push_back( layer_id );
1099 }
1100 }
1101
1102 return inUseLayers;
1103}
1104
1105
1107{
1108 BOARD* savedBoard = m_pcb;
1109
1110 m_pcb = aBoard;
1112
1113 m_pcb = savedBoard;
1114}
1115
1116
1117bool PANEL_SETUP_LAYERS::CheckCopperLayerCount( BOARD* aWorkingBoard, BOARD* aImportedBoard )
1118{
1119 /*
1120 * This function warns users if they are going to delete inner copper layers because
1121 * they're importing settings from a board with less copper layers than the board
1122 * already loaded. We want to return "true" as default on the assumption no layer will
1123 * actually be deleted.
1124 */
1125 bool okToDeleteCopperLayers = true;
1126
1127 // Get the number of copper layers in the loaded board and the "import settings" board
1128 int currNumLayers = aWorkingBoard->GetCopperLayerCount();
1129 int newNumLayers = aImportedBoard->GetCopperLayerCount();
1130
1131 if( newNumLayers < currNumLayers )
1132 {
1133 wxString msg = wxString::Format( _( "Imported settings have fewer copper layers than "
1134 "the current board (%i instead of %i).\n\n"
1135 "Continue and delete the extra inner copper layers "
1136 "from the current board?" ),
1137 newNumLayers,
1138 currNumLayers );
1139
1140 wxWindow* topLevelParent = wxGetTopLevelParent( this );
1141
1142 wxMessageDialog dlg( topLevelParent, msg, _( "Inner Layers to Be Deleted" ),
1143 wxICON_WARNING | wxSTAY_ON_TOP | wxYES | wxNO | wxNO_DEFAULT );
1144
1145 if( wxID_ANY == dlg.ShowModal() )
1146 okToDeleteCopperLayers = false;
1147 }
1148
1149 return okToDeleteCopperLayers;
1150}
1151
1152
1153void PANEL_SETUP_LAYERS::addUserDefinedLayer( wxCommandEvent& aEvent )
1154{
1155 wxArrayString headers;
1156 headers.Add( _( "Layers" ) );
1157
1158 // Build the available user-defined layers list:
1159 std::vector<wxArrayString> list;
1160
1161 for( PCB_LAYER_ID layer : LSET::UserDefinedLayersMask().Seq() )
1162 {
1163 wxCheckBox* checkBox = getCheckBox( layer );
1164
1165 if( checkBox && checkBox->IsShown() )
1166 continue;
1167
1168 wxArrayString available_user_layer;
1169 available_user_layer.Add( LayerName( layer ) );
1170
1171 list.emplace_back( available_user_layer );
1172 }
1173
1174 if( list.empty() )
1175 {
1177 _( "All user-defined layers have already been added." ) );
1178 return;
1179 }
1180
1181 EDA_LIST_DIALOG dlg( PAGED_DIALOG::GetDialog( this ), _( "Add User-defined Layer" ),
1182 headers, list );
1183 dlg.SetListLabel( _( "Select layer to add:" ) );
1184 dlg.HideFilter();
1185
1186 if( dlg.ShowModal() == wxID_ANY || dlg.GetTextSelection().IsEmpty() )
1187 return;
1188
1190
1191 for( PCB_LAYER_ID layer2 : LSET::UserDefinedLayersMask().Seq() )
1192 {
1193 if( LayerName( layer2 ) == dlg.GetTextSelection() )
1194 {
1195 layer = layer2;
1196 break;
1197 }
1198 }
1199
1200 wxCHECK( layer >= User_1, /* void */ );
1201
1202 m_enabledLayers.set( layer );
1203 append_user_layer( layer );
1204
1206
1207 // All user-defined layers should have a checkbox
1208 wxASSERT( ctl.checkbox );
1209 ctl.checkbox->SetValue( true );
1210
1211 wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ctl.name );
1212
1213 wxCHECK( textCtrl, /* void */ );
1214 textCtrl->ChangeValue( LSET::Name( layer ) );
1215
1216 wxChoice* userLayerType = dynamic_cast<wxChoice*>( ctl.choice );
1217
1218 wxCHECK( userLayerType, /* void */ );
1219 userLayerType->SetSelection( 0 );
1220
1221 ctl.name->Show( true );
1222 ctl.checkbox->Show( true );
1223 ctl.choice->Show( true );
1224
1225 wxSizeEvent evt_size( m_LayersListPanel->GetSize() );
1226 m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size );
1227}
1228
1229
int index
const char * name
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition board.h:235
@ LT_POWER
Definition board.h:238
@ LT_FRONT
Definition board.h:242
@ LT_MIXED
Definition board.h:239
@ LT_BACK
Definition board.h:243
@ LT_UNDEFINED
Definition board.h:236
@ LT_JUMPER
Definition board.h:240
@ LT_AUX
Definition board.h:241
@ LT_SIGNAL
Definition board.h:237
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
Definition actions.h:223
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:220
BASE_SET & reset(size_t pos)
Definition base_set.h:143
BASE_SET & set(size_t pos)
Definition base_set.h:116
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
int GetCopperLayerCount() const
Definition board.cpp:985
int GetCount() const
Return the number of objects in the list.
Definition collector.h:79
void SetSelectionCallback(std::function< void(int)> aCallback)
void AddItems(const std::vector< wxString > &aItems)
int ShowModal() override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
Definition eda_item.cpp:169
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
A dialog which shows:
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
void SetListLabel(const wxString &aLabel)
static const std::vector< KICAD_T > BoardLevelItems
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
Definition collectors.h:65
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
Definition collectors.h:103
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition lseq.h:47
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
copper_layers_iterator copper_layers_end() const
Definition lset.cpp:919
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
Definition lset.cpp:604
copper_layers_iterator copper_layers_begin() const
Definition lset.cpp:913
non_copper_layers_iterator non_copper_layers_begin() const
Definition lset.cpp:925
non_copper_layers_iterator non_copper_layers_end() const
Definition lset.cpp:931
static const LSET & AllLayersMask()
Definition lset.cpp:637
static LSET UserDefinedLayersMask(int aUserDefinedLayerCount=MAX_USER_DEFINED_LAYERS)
Return a mask with the requested number of user defined layers.
Definition lset.cpp:700
static const LSET & InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition lset.cpp:573
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition lset.cpp:184
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Definition lset.h:63
Definition pad.h:61
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
wxScrolledWindow * m_LayersListPanel
PANEL_SETUP_LAYERS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxStaticText * m_CrtYdBackStaticText
wxStaticText * m_CrtYdFrontStaticText
wxCheckBox * m_SoldPBackCheckBox
wxStaticText * m_PCBEdgesStaticText
wxStaticText * m_FabBackStaticText
wxStaticText * m_MarginStaticText
void append_user_layer(PCB_LAYER_ID aLayer)
wxCheckBox * m_AdhesBackCheckBox
wxTextCtrl * getName(PCB_LAYER_ID aLayer)
wxStaticText * m_Eco2StaticText
void showSelectedLayerCheckBoxes(const LSET &enableLayerMask)
bool CheckCopperLayerCount(BOARD *aWorkingBoard, BOARD *aImportedBoard)
Check and warn if inner copper layers will be deleted.
wxStaticText * m_AdhesFrontStaticText
wxCheckBox * m_CrtYdFrontCheckBox
wxCheckBox * m_FabFrontCheckBox
bool TransferDataToWindow() override
wxTextCtrl * m_AdhesFrontName
wxCheckBox * getCheckBox(PCB_LAYER_ID aLayer)
wxCheckBox * m_MaskFrontCheckBox
void setLayerCheckBox(PCB_LAYER_ID layer, bool isChecked)
virtual void addUserDefinedLayer(wxCommandEvent &aEvent) override
wxCheckBox * m_SilkSBackCheckBox
void SyncCopperLayers(int aNumCopperLayers)
Called when switching to this tab to make sure that any changes to the copper layer count made on the...
wxStaticText * m_AdhesBackStaticText
wxTextCtrl * m_CrtYdFrontName
std::map< PCB_LAYER_ID, PANEL_SETUP_LAYERS_CTLs > m_layersControls
wxStaticText * m_Eco1StaticText
PANEL_SETUP_BOARD_STACKUP * m_physicalStackup
wxCheckBox * m_MaskBackCheckBox
wxCheckBox * m_SoldPFrontCheckBox
wxStaticText * m_CommentsStaticText
PCB_EDIT_FRAME * m_frame
wxCheckBox * m_PCBEdgesCheckBox
wxStaticText * m_FabFrontStaticText
wxStaticText * m_MaskFrontStaticText
LSEQ getNonRemovableLayers()
Return a list of layers in use in footprints, and therefore not removable.
wxStaticText * m_SilkSFrontStaticText
wxCheckBox * m_MarginCheckBox
wxStaticText * m_SoldPBackStaticText
wxCheckBox * m_SilkSFrontCheckBox
wxStaticText * m_MaskBackStaticText
void setCopperLayerCheckBoxes(int copperCount)
wxCheckBox * m_CrtYdBackCheckBox
wxCheckBox * m_CommentsCheckBox
wxCheckBox * m_FabBackCheckBox
wxTextCtrl * m_SoldPFrontName
wxStaticText * m_SilkSBackStaticText
wxTextCtrl * m_SilkSFrontName
wxCheckBox * m_AdhesFrontCheckBox
wxChoice * getChoice(PCB_LAYER_ID aLayer)
wxStaticText * m_SoldPFrontStaticText
LSEQ getRemovedLayersWithItems()
Return a list of layers removed from the board that contain items.
wxCheckBox * m_DrawingsCheckBox
wxStaticText * m_DrawingsStaticText
bool TransferDataFromWindow() override
PANEL_SETUP_LAYERS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
void ImportSettingsFrom(BOARD *aBoard)
BOARD * GetBoard() const
The main frame for Pcbnew.
Collect all BOARD_ITEM objects on a given layer.
Definition collectors.h:545
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Test a BOARD_ITEM using this class's Inspector method, which does the collection.
void SetLayerId(PCB_LAYER_ID aLayerId)
Definition collectors.h:551
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition confirm.cpp:274
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
This file is part of the common library.
#define _(s)
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition layer_id.cpp:31
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
Definition layer_ids.h:675
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ F_CrtYd
Definition layer_ids.h:112
@ B_Adhes
Definition layer_ids.h:99
@ Edge_Cuts
Definition layer_ids.h:108
@ Dwgs_User
Definition layer_ids.h:103
@ F_Paste
Definition layer_ids.h:100
@ Cmts_User
Definition layer_ids.h:104
@ F_Adhes
Definition layer_ids.h:98
@ B_Mask
Definition layer_ids.h:94
@ B_Cu
Definition layer_ids.h:61
@ Eco1_User
Definition layer_ids.h:105
@ F_Mask
Definition layer_ids.h:93
@ B_Paste
Definition layer_ids.h:101
@ F_Fab
Definition layer_ids.h:115
@ Margin
Definition layer_ids.h:109
@ F_SilkS
Definition layer_ids.h:96
@ B_CrtYd
Definition layer_ids.h:111
@ UNDEFINED_LAYER
Definition layer_ids.h:57
@ Eco2_User
Definition layer_ids.h:106
@ Rescue
Definition layer_ids.h:117
@ User_1
Definition layer_ids.h:120
@ B_SilkS
Definition layer_ids.h:97
@ F_Cu
Definition layer_ids.h:60
@ B_Fab
Definition layer_ids.h:114
static void mandatoryLayerCbSetup(wxCheckBox &aCheckBox)
Configure a layer checkbox to be mandatory and disabled.
The 3 UI control pointers for a single board layer.
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:79