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, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26
27#include <confirm.h>
28#include <core/arraydim.h>
29#include <core/kicad_algo.h>
30#include <pcb_edit_frame.h>
31#include <tool/tool_manager.h>
32#include <tools/pcb_actions.h>
33#include <board.h>
34#include <collectors.h>
35#include <footprint.h>
36#include <layer_ids.h>
37#include <pad.h>
38#include <pcb_track.h>
39#include <panel_setup_layers.h>
41
42#include <wx/choicdlg.h>
43#include <wx/msgdlg.h>
44#include <eda_list_dialog.h>
45
46#include <list>
47#include <set>
48
49
53static void mandatoryLayerCbSetup( wxCheckBox& aCheckBox )
54{
55 aCheckBox.Show();
56 aCheckBox.Disable();
57 aCheckBox.SetValue( true );
58 aCheckBox.SetToolTip( _( "This layer is required and cannot be disabled" ) );
59}
60
61
62PANEL_SETUP_LAYERS::PANEL_SETUP_LAYERS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) :
63 PANEL_SETUP_LAYERS_BASE( aParentWindow ),
64 m_frame( aFrame ),
65 m_physicalStackup( nullptr ),
66 m_initialized( false ),
67 m_CrtYdFrontCheckBox( nullptr ),
68 m_CrtYdFrontName( nullptr ),
69 m_CrtYdFrontStaticText( nullptr ),
70 m_FabFrontCheckBox( nullptr ),
71 m_FabFrontName( nullptr ),
72 m_FabFrontStaticText( nullptr ),
73 m_AdhesFrontCheckBox( nullptr ),
74 m_AdhesFrontName( nullptr ),
75 m_AdhesFrontStaticText( nullptr ),
76 m_SoldPFrontCheckBox( nullptr ),
77 m_SoldPFrontName( nullptr ),
78 m_SoldPFrontStaticText( nullptr ),
79 m_SilkSFrontCheckBox( nullptr ),
80 m_SilkSFrontName( nullptr ),
81 m_SilkSFrontStaticText( nullptr ),
82 m_MaskFrontCheckBox( nullptr ),
83 m_MaskFrontName( nullptr ),
84 m_MaskFrontStaticText( nullptr ),
85 m_MaskBackCheckBox( nullptr ),
86 m_MaskBackName( nullptr ),
87 m_MaskBackStaticText( nullptr ),
88 m_SilkSBackCheckBox( nullptr ),
89 m_SilkSBackName( nullptr ),
90 m_SilkSBackStaticText( nullptr ),
91 m_SoldPBackCheckBox( nullptr ),
92 m_SoldPBackName( nullptr ),
93 m_SoldPBackStaticText( nullptr ),
94 m_AdhesBackCheckBox( nullptr ),
95 m_AdhesBackName( nullptr ),
96 m_AdhesBackStaticText( nullptr ),
97 m_FabBackCheckBox( nullptr ),
98 m_FabBackName( nullptr ),
99 m_FabBackStaticText( nullptr ),
100 m_CrtYdBackCheckBox( nullptr ),
101 m_CrtYdBackName( nullptr ),
102 m_CrtYdBackStaticText( nullptr ),
103 m_PCBEdgesCheckBox( nullptr ),
104 m_PCBEdgesName( nullptr ),
105 m_PCBEdgesStaticText( nullptr ),
106 m_MarginCheckBox( nullptr ),
107 m_MarginName( nullptr ),
108 m_MarginStaticText( nullptr ),
109 m_Eco1CheckBox( nullptr ),
110 m_Eco1Name( nullptr ),
111 m_Eco1StaticText( nullptr ),
112 m_Eco2CheckBox( nullptr ),
113 m_Eco2Name( nullptr ),
114 m_Eco2StaticText( nullptr ),
115 m_CommentsCheckBox( nullptr ),
116 m_CommentsName( nullptr ),
117 m_CommentsStaticText( nullptr ),
118 m_DrawingsCheckBox( nullptr ),
119 m_DrawingsName( nullptr ),
120 m_DrawingsStaticText( nullptr )
121{
122 m_pcb = aFrame->GetBoard();
123}
124
125
127{
128 m_CrtYdFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
129 wxDefaultPosition, wxDefaultSize, 0 );
131 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT
132 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
133 5 );
134
135 m_CrtYdFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_CrtYd ),
136 wxDefaultPosition, wxDefaultSize, 0 );
137 m_CrtYdFrontName->SetMinSize( wxSize( 160, -1 ) );
138
139 m_LayersSizer->Add( m_CrtYdFrontName, 0, wxRIGHT | wxEXPAND, 5 );
140
142 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, testing" ),
143 wxDefaultPosition, wxDefaultSize, 0 );
144 m_CrtYdFrontStaticText->Wrap( -1 );
145 m_CrtYdFrontStaticText->SetMinSize( wxSize( 150, -1 ) );
146
147 m_LayersSizer->Add( m_CrtYdFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
148
149 m_FabFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
150 wxDefaultPosition, wxDefaultSize, 0 );
151 m_FabFrontCheckBox->SetToolTip(
152 _( "If you want a fabrication layer for the front side of the board" ) );
153
155 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
156
157 m_FabFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Fab ),
158 wxDefaultPosition, wxDefaultSize, 0 );
159 m_LayersSizer->Add( m_FabFrontName, 0, wxEXPAND | wxRIGHT, 5 );
160
162 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, manufacturing" ),
163 wxDefaultPosition, wxDefaultSize, 0 );
164 m_FabFrontStaticText->Wrap( -1 );
165 m_LayersSizer->Add( m_FabFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
166
167 m_AdhesFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
168 wxDefaultPosition, wxDefaultSize, 0 );
169 m_AdhesFrontCheckBox->SetToolTip(
170 _( "If you want an adhesive template for the front side of the board" ) );
171
173 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
174
175 m_AdhesFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Adhes ),
176 wxDefaultPosition, wxDefaultSize, 0 );
177 m_LayersSizer->Add( m_AdhesFrontName, 0, wxEXPAND | wxRIGHT, 5 );
178
180 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
181 wxDefaultPosition, wxDefaultSize, 0 );
182 m_AdhesFrontStaticText->Wrap( -1 );
183 m_LayersSizer->Add( m_AdhesFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
184
185 m_SoldPFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
186 wxDefaultPosition, wxDefaultSize, 0 );
187 m_SoldPFrontCheckBox->SetToolTip(
188 _( "If you want a solder paste layer for front side of the board" ) );
189
191 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
192
193 m_SoldPFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Paste ),
194 wxDefaultPosition, wxDefaultSize, 0 );
195 m_LayersSizer->Add( m_SoldPFrontName, 0, wxEXPAND | wxRIGHT, 5 );
196
198 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
199 wxDefaultPosition, wxDefaultSize, 0 );
200 m_SoldPFrontStaticText->Wrap( -1 );
201 m_LayersSizer->Add( m_SoldPFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
202
203 m_SilkSFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
204 wxDefaultPosition, wxDefaultSize, 0 );
205 m_SilkSFrontCheckBox->SetToolTip(
206 _( "If you want a silk screen layer for the front side of the board" ) );
207
209 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
210
211 m_SilkSFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_SilkS ),
212 wxDefaultPosition, wxDefaultSize, 0 );
213 m_LayersSizer->Add( m_SilkSFrontName, 0, wxEXPAND | wxRIGHT, 5 );
214
216 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
217 wxDefaultPosition, wxDefaultSize, 0 );
218 m_SilkSFrontStaticText->Wrap( -1 );
219 m_LayersSizer->Add( m_SilkSFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
220
221 m_MaskFrontCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
222 wxDefaultPosition, wxDefaultSize, 0 );
223 m_MaskFrontCheckBox->SetToolTip(
224 _( "If you want a solder mask layer for the front of the board" ) );
225
227 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
228
229 m_MaskFrontName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( F_Mask ),
230 wxDefaultPosition, wxDefaultSize, 0 );
231 m_LayersSizer->Add( m_MaskFrontName, 0, wxEXPAND | wxRIGHT, 5 );
232
234 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
235 wxDefaultPosition, wxDefaultSize, 0 );
236 m_MaskFrontStaticText->Wrap( -1 );
237 m_LayersSizer->Add( m_MaskFrontStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
238
240}
241
242
244{
245 m_MaskBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
246 wxDefaultPosition, wxDefaultSize, 0 );
247 m_MaskBackCheckBox->SetToolTip(
248 _( "If you want a solder mask layer for the back side of the board" ) );
249
251 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
252
253 m_MaskBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Mask ),
254 wxDefaultPosition, wxDefaultSize, 0 );
255 m_LayersSizer->Add( m_MaskBackName, 0, wxEXPAND | wxRIGHT, 5 );
256
258 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
259 wxDefaultPosition, wxDefaultSize, 0 );
260 m_MaskBackStaticText->Wrap( -1 );
261 m_LayersSizer->Add( m_MaskBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
262
263 m_SilkSBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
264 wxDefaultPosition, wxDefaultSize, 0 );
265 m_SilkSBackCheckBox->SetToolTip(
266 _( "If you want a silk screen layer for the back side of the board" ) );
267
269 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
270
271 m_SilkSBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_SilkS ),
272 wxDefaultPosition, wxDefaultSize, 0 );
273 m_LayersSizer->Add( m_SilkSBackName, 0, wxEXPAND | wxRIGHT, 5 );
274
276 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
277 wxDefaultPosition, wxDefaultSize, 0 );
278 m_SilkSBackStaticText->Wrap( -1 );
279 m_LayersSizer->Add( m_SilkSBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
280
281 m_SoldPBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
282 wxDefaultPosition, wxDefaultSize, 0 );
283 m_SoldPBackCheckBox->SetToolTip(
284 _( "If you want a solder paste layer for the back side of the board" ) );
285
287 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
288
289 m_SoldPBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Paste ),
290 wxDefaultPosition, wxDefaultSize, 0 );
291 m_LayersSizer->Add( m_SoldPBackName, 0, wxEXPAND | wxRIGHT, 5 );
292
294 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
295 wxDefaultPosition, wxDefaultSize, 0 );
296 m_SoldPBackStaticText->Wrap( -1 );
297 m_LayersSizer->Add( m_SoldPBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
298
299 m_AdhesBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
300 wxDefaultPosition, wxDefaultSize, 0 );
301 m_AdhesBackCheckBox->SetToolTip(
302 _( "If you want an adhesive layer for the back side of the board" ) );
303
305 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
306
307 m_AdhesBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Adhes ),
308 wxDefaultPosition, wxDefaultSize, 0 );
309 m_LayersSizer->Add( m_AdhesBackName, 0, wxEXPAND | wxRIGHT, 5 );
310
312 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "On-board, non-copper" ),
313 wxDefaultPosition, wxDefaultSize, 0 );
314 m_AdhesBackStaticText->Wrap( -1 );
315 m_LayersSizer->Add( m_AdhesBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
316
317 m_FabBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
318 wxDefaultPosition, wxDefaultSize, 0 );
319 m_FabBackCheckBox->SetToolTip(
320 _( "If you want a fabrication layer for the back side of the board" ) );
321
323 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
324
325 m_FabBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_Fab ),
326 wxDefaultPosition, wxDefaultSize, 0 );
327 m_LayersSizer->Add( m_FabBackName, 0, wxEXPAND | wxRIGHT, 5 );
328
330 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, manufacturing" ),
331 wxDefaultPosition, wxDefaultSize, 0 );
332 m_FabBackStaticText->Wrap( -1 );
333 m_LayersSizer->Add( m_FabBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
334
335
336 m_CrtYdBackCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
337 wxDefaultPosition, wxDefaultSize, 0 );
339 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT
340 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
341 5 );
342
343 m_CrtYdBackName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( B_CrtYd ),
344 wxDefaultPosition, wxDefaultSize, 0 );
345 m_LayersSizer->Add( m_CrtYdBackName, 0, wxEXPAND | wxRIGHT, 5 );
346
348 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Off-board, testing" ),
349 wxDefaultPosition, wxDefaultSize, 0 );
350 m_CrtYdBackStaticText->Wrap( -1 );
351 m_LayersSizer->Add( m_CrtYdBackStaticText, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 );
352
353
354 m_PCBEdgesCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
355 wxDefaultPosition, wxDefaultSize, 0 );
357 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT
358 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
359 5 );
360
361 m_PCBEdgesName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Edge_Cuts ),
362 wxDefaultPosition, wxDefaultSize, 0 );
363 m_LayersSizer->Add( m_PCBEdgesName, 0, wxEXPAND | wxRIGHT, 5 );
364
366 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Board contour" ),
367 wxDefaultPosition, wxDefaultSize, 0 );
368 m_PCBEdgesStaticText->Wrap( -1 );
369 m_LayersSizer->Add( m_PCBEdgesStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
370
371 m_MarginCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
372 wxDefaultPosition, wxDefaultSize, 0 );
374 wxLEFT | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL
375 | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
376 5 );
377
378 m_MarginName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Margin ),
379 wxDefaultPosition, wxDefaultSize, 0 );
380 m_LayersSizer->Add( m_MarginName, 0, wxEXPAND | wxRIGHT, 5 );
381
383 new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Board contour setback" ),
384 wxDefaultPosition, wxDefaultSize, 0 );
385 m_MarginStaticText->Wrap( -1 );
386 m_LayersSizer->Add( m_MarginStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
387
388 m_Eco1CheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
389 wxDefaultPosition, wxDefaultSize, 0 );
391 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
392
393 m_Eco1Name = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Eco1_User ),
394 wxDefaultPosition, wxDefaultSize, 0 );
395 m_LayersSizer->Add( m_Eco1Name, 0, wxEXPAND | wxRIGHT, 5 );
396
397 m_Eco1StaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
398 wxDefaultPosition, wxDefaultSize, 0 );
399 m_Eco1StaticText->Wrap( -1 );
400 m_LayersSizer->Add( m_Eco1StaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
401
402 m_Eco2CheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
403 wxDefaultPosition, wxDefaultSize, 0 );
405 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
406
407 m_Eco2Name = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Eco2_User ),
408 wxDefaultPosition, wxDefaultSize, 0 );
409 m_LayersSizer->Add( m_Eco2Name, 0, wxEXPAND | wxRIGHT, 5 );
410
411 m_Eco2StaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
412 wxDefaultPosition, wxDefaultSize, 0 );
413 m_Eco2StaticText->Wrap( -1 );
414 m_LayersSizer->Add( m_Eco2StaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
415
416 m_CommentsCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
417 wxDefaultPosition, wxDefaultSize, 0 );
418 m_CommentsCheckBox->SetToolTip( _( "If you want a separate layer for comments or notes" ) );
419
421 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
422
423 m_CommentsName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Cmts_User ),
424 wxDefaultPosition, wxDefaultSize, 0 );
425 m_LayersSizer->Add( m_CommentsName, 0, wxEXPAND | wxRIGHT, 5 );
426
427 m_CommentsStaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
428 wxDefaultPosition, wxDefaultSize, 0 );
429 m_CommentsStaticText->Wrap( -1 );
430 m_LayersSizer->Add( m_CommentsStaticText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
431
432 m_DrawingsCheckBox = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString,
433 wxDefaultPosition, wxDefaultSize, 0 );
434 m_DrawingsCheckBox->SetToolTip( _( "If you want a layer for documentation drawings" ) );
435
437 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
438
439 m_DrawingsName = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( Dwgs_User ),
440 wxDefaultPosition, wxDefaultSize, 0 );
441 m_LayersSizer->Add( m_DrawingsName, 0, wxEXPAND | wxRIGHT, 5 );
442
443 m_DrawingsStaticText = new wxStaticText( m_LayersListPanel, wxID_ANY, _( "Auxiliary" ),
444 wxDefaultPosition, wxDefaultSize, 0 );
445 m_DrawingsStaticText->Wrap( -1 );
447 wxALIGN_CENTER_VERTICAL | wxBOTTOM | wxLEFT | wxRIGHT, 5 );
448
452}
453
454
456{
457 Freeze();
458 m_layersControls.clear();
459 m_LayersSizer->Clear( true );
467
468
469 LSET layers = m_enabledLayers;
470
471 for( auto it = layers.copper_layers_begin(); it != layers.copper_layers_end(); ++it )
472 {
473 wxCheckBox* cb = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
474 cb->SetToolTip( _( "Use the Physical Stackup page to change the number of copper layers." ) );
475 cb->Disable();
476
477 m_LayersSizer->Add( cb, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
478
479 wxTextCtrl* txt = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( *it ), wxDefaultPosition, wxDefaultSize, 0 );
480 txt->SetToolTip( _("Layer Name") );
481
482 m_LayersSizer->Add( txt, 0, wxEXPAND|wxRIGHT, 5 );
483
484 wxArrayString choices;
485 choices.Add( _( "signal" ) );
486 choices.Add( _( "power plane" ) );
487 choices.Add( _( "mixed" ) );
488 choices.Add( _( "jumper" ) );
489 wxChoice* choice = new wxChoice( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices, 0 );
490 choice->SetSelection( 0 );
491 choice->SetToolTip( _("Copper layer type for Freerouter and other external routers.\n"
492 "Power plane layers are removed from Freerouter's layer menus.") );
493
494 m_LayersSizer->Add( choice, 0, wxRIGHT|wxEXPAND, 5 );
495 m_layersControls[*it] = PANEL_SETUP_LAYERS_CTLs( txt, cb, choice );
496 }
497
511
512 layers &= LSET::UserDefinedLayersMask();
513
514 for( auto it = layers.non_copper_layers_begin(); it != layers.non_copper_layers_end(); ++it )
515 {
516 append_user_layer( *it );
517 }
518
519 Thaw();
520 m_LayersListPanel->FitInside(); // Updates virtual size to fit subwindows, also auto-layouts.
521}
522
523
525{
526 wxCheckBox* cb = new wxCheckBox( m_LayersListPanel, wxID_ANY, wxEmptyString, wxDefaultPosition,
527 wxDefaultSize, 0 );
528 m_LayersSizer->Add( cb, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
529
530 wxTextCtrl* txt = new wxTextCtrl( m_LayersListPanel, wxID_ANY, LayerName( aLayer ),
531 wxDefaultPosition, wxDefaultSize, 0 );
532 txt->SetToolTip( _( "Layer Name" ) );
533 m_LayersSizer->Add( txt, 0, wxEXPAND | wxRIGHT, 5 );
534
535 wxArrayString choices;
536 choices.Add( _( "Auxiliary" ) );
537 choices.Add( _( "Off-board, front" ) );
538 choices.Add( _( "Off-board, back" ) );
539
540 wxChoice* choice = new wxChoice( m_LayersListPanel, wxID_ANY, wxDefaultPosition,
541 wxDefaultSize, choices, 0 );
542 choice->SetSelection( 0 );
543 choice->SetToolTip(
544 _( "Auxiliary layers do not flip with board side, while back and front layers do." ) );
545
546 m_LayersSizer->Add( choice, 0, wxEXPAND | wxRIGHT, 5 );
547 m_layersControls[aLayer] = PANEL_SETUP_LAYERS_CTLs( txt, cb, choice );
548}
549
550
552{
553 return m_layersControls[aLayer].name;
554}
555
556
558{
559 return m_layersControls[aLayer].checkbox;
560}
561
562
564{
565 return dynamic_cast<wxChoice*>( m_layersControls[aLayer].choice );
566}
567
568
570{
571 m_enabledLayers = m_pcb->GetEnabledLayers();
572
573 // Rescue may be enabled, but should not be shown in this dialog
574 m_enabledLayers.reset( Rescue );
575
577
578 setCopperLayerCheckBoxes( m_pcb->GetCopperLayerCount() );
579
582
585
586 m_initialized = true;
587
588 return true;
589}
590
591
592void PANEL_SETUP_LAYERS::SyncCopperLayers( int aNumCopperLayers )
593{
594 BOARD* savedBoard = m_pcb;
595 BOARD temp;
596
597 m_pcb = &temp;
599
600 for( size_t ii = 0; ii < m_enabledLayers.size(); ii++ )
601 {
602 if( IsCopperLayer( int( ii ) ) )
603 m_enabledLayers.reset( ii );
604 }
605
606 m_enabledLayers |= LSET::AllCuMask( aNumCopperLayers );
607
609 setCopperLayerCheckBoxes( aNumCopperLayers );
610
613
616
617 m_pcb = savedBoard;
618}
619
620
622{
624
625 for( PCB_LAYER_ID layer : layers )
626 setLayerCheckBox( layer, m_pcb->IsLayerEnabled( layer ) );
627}
628
629
631{
632 // Set all the board's layer names into the dialog by calling BOARD::LayerName(),
633 // which will call BOARD::GetStandardLayerName() for non-coppers.
634
635 for( PCB_LAYER_ID layer : m_enabledLayers )
636 {
637 wxControl* ctl = getName( layer );
638
639 if( ctl )
640 {
641 wxString lname = m_pcb->GetLayerName( layer );
642
643 if( auto textCtl = dynamic_cast<wxTextCtrl*>( ctl ) )
644 textCtl->ChangeValue( lname ); // wxTextCtrl
645 else
646 ctl->SetLabel( lname ); // wxStaticText
647 }
648 }
649}
650
651
653{
654 for( auto& [layer,ctl] : m_layersControls )
655 setLayerCheckBox( layer, enabledLayers.test( layer ) );
656}
657
658
660{
661 LSET layers = m_enabledLayers & LSET::AllCuMask( m_pcb->GetCopperLayerCount() );
662
663 for( PCB_LAYER_ID cu_layer : m_enabledLayers.CuStack() )
664 {
665 wxChoice* ctl = getChoice( cu_layer );
666
667 switch ( m_pcb->GetLayerType( cu_layer ) )
668 {
669 case LT_SIGNAL: ctl->SetSelection( 0 ); break;
670 case LT_POWER: ctl->SetSelection( 1 ); break;
671 case LT_MIXED: ctl->SetSelection( 2 ); break;
672 case LT_JUMPER: ctl->SetSelection( 3 ); break;
673 default: ctl->SetSelection( 0 );
674 }
675
676 }
677
679
680 for( PCB_LAYER_ID layer : layers )
681 {
682 wxChoice* ctl = getChoice( layer );
683
684 switch( m_pcb->GetLayerType( layer ) )
685 {
686 case LT_AUX: ctl->SetSelection( 0 ); break;
687 case LT_FRONT: ctl->SetSelection( 1 ); break;
688 case LT_BACK: ctl->SetSelection( 2 ); break;
689 default: ctl->SetSelection( 0 ); break;
690 }
691 }
692}
693
694
696{
697 LSET layerMaskResult;
698
699 for( auto& [layer, _] : m_layersControls )
700 {
701 wxCheckBox* ctl = getCheckBox( layer );
702
703 if( ctl && ctl->IsChecked() )
704 layerMaskResult.set( layer );
705 }
706
707 return layerMaskResult;
708}
709
710
712{
714
715 if( !ctl.checkbox )
716 return;
717
718 ctl.checkbox->SetValue( isChecked );
719}
720
721
723{
724 if( copperCount > 0 )
725 {
726 wxCheckBox* fcu = getCheckBox( F_Cu );
727 mandatoryLayerCbSetup( *fcu );
728 }
729
730 if( copperCount > 0 )
731 {
732 wxCheckBox* bcu = getCheckBox( B_Cu );
733 mandatoryLayerCbSetup( *bcu );
734 }
735
736 LSET layers = m_enabledLayers & LSET::AllCuMask( copperCount );
737 layers.reset( F_Cu );
738 layers.reset( B_Cu );
739
740 for( PCB_LAYER_ID layer : layers )
741 {
742 wxCheckBox* cb = getCheckBox( layer );
744 }
745
746}
747
748
750{
751 bool modified = false;
752 LSET enabledLayers = GetUILayerMask();
753
754 LSET previousEnabled = m_pcb->GetEnabledLayers();
755
756 if( enabledLayers != previousEnabled )
757 {
758 m_pcb->SetEnabledLayers( enabledLayers );
759
760 LSET changedLayers = enabledLayers ^ previousEnabled;
761
762 /*
763 * Ensure enabled layers are also visible. This is mainly to avoid mistakes if some
764 * enabled layers are not visible when exiting this dialog.
765 */
766 m_pcb->SetVisibleLayers( m_pcb->GetVisibleLayers() | changedLayers );
767
768 /*
769 * Ensure items with through holes have all inner copper layers. (For historical reasons
770 * this is NOT trimmed to the currently-enabled inner layers.)
771 */
772 for( FOOTPRINT* fp : m_pcb->Footprints() )
773 {
774 for( PAD* pad : fp->Pads() )
775 {
776 if( pad->HasHole() && pad->IsOnCopperLayer() )
777 pad->SetLayerSet( pad->GetLayerSet() | LSET::InternalCuMask() );
778 }
779 }
780
781 // Tracks do not change their layer
782 // Vias layers are defined by the starting layer and the ending layer, so
783 // they are not modified by adding a layer.
784 // So do nothing for tracks/vias
785
786 modified = true;
787 }
788
789 for( PCB_LAYER_ID layer : enabledLayers )
790 {
791 wxString newLayerName = getName( layer )->GetValue();
792
793 if( m_pcb->GetLayerName( layer ) != newLayerName )
794 {
795 m_pcb->SetLayerName( layer, newLayerName );
796 modified = true;
797 }
798
799 if( IsCopperLayer( layer ) )
800 {
801 LAYER_T t;
802
803 switch( getChoice( layer )->GetCurrentSelection() )
804 {
805 case 0: t = LT_SIGNAL; break;
806 case 1: t = LT_POWER; break;
807 case 2: t = LT_MIXED; break;
808 case 3: t = LT_JUMPER; break;
809 default: t = LT_UNDEFINED; break;
810 }
811
812 if( m_pcb->GetLayerType( layer ) != t )
813 {
814 m_pcb->SetLayerType( layer, t );
815 modified = true;
816 }
817 }
818 else if( layer >= User_1 && !IsCopperLayer( layer ) )
819 {
820 LAYER_T t;
821
822 switch( getChoice( layer )->GetCurrentSelection() )
823 {
824 case 0: t = LT_AUX; break;
825 case 1: t = LT_FRONT; break;
826 case 2: t = LT_BACK; break;
827 default: t = LT_UNDEFINED; break;
828 }
829
830 if( m_pcb->GetLayerType( layer ) != t )
831 {
832 m_pcb->SetLayerType( layer, t );
833 modified = true;
834 }
835 }
836 }
837
838 LSET layers = enabledLayers & LSET::UserDefinedLayersMask();
839
840 for( PCB_LAYER_ID layer : layers )
841 {
842 wxString newLayerName = getName( layer )->GetValue();
843
844 if( m_pcb->GetLayerName( layer ) != newLayerName )
845 {
846 m_pcb->SetLayerName( layer, newLayerName );
847 modified = true;
848 }
849 }
850
851 return modified;
852}
853
854
856{
857 if( !testLayerNames() )
858 return false;
859
860 // Make sure we have the latest copper layer count
862 SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() );
863
864 wxString msg;
865 bool modified = false;
866 wxWindow* parent = wxGetTopLevelParent( this );
867
868 // Check for removed layers with items which will get deleted from the board.
869 LSEQ removedLayers = getRemovedLayersWithItems();
870
871 // Check for non-copper layers in use in footprints, and therefore not removable.
872 LSEQ notremovableLayers = getNonRemovableLayers();
873
874 if( !notremovableLayers.empty() )
875 {
876 for( PCB_LAYER_ID layer : notremovableLayers )
877 msg << m_pcb->GetLayerName( layer ) << wxT( "\n" );
878
879 if( !IsOK( parent, wxString::Format( _( "Footprints have some items on removed layers:\n"
880 "%s\n"
881 "These items will be no longer accessible\n"
882 "Do you wish to continue?" ),
883 msg ) ) )
884 {
885 return false;
886 }
887 }
888
889 if( !removedLayers.empty() )
890 {
891 if( !IsOK( parent, _( "Items have been found on removed layers. This operation will "
892 "delete all items from removed layers and cannot be undone.\n"
893 "Do you wish to continue?" ) ) )
894 {
895 return false;
896 }
897 }
898
899 // Delete all objects on layers that have been removed. Leaving them in copper layers
900 // can (will?) result in DRC errors and it pollutes the board file with cruft.
901 if( !removedLayers.empty() )
902 {
903 m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
904
905 for( PCB_LAYER_ID layer_id : removedLayers )
906 modified |= m_pcb->RemoveAllItemsOnLayer( layer_id );
907
908 // Undo state may have copies of pointers deleted above
909 m_frame->ClearUndoRedoList();
910 }
911
912 modified |= transferDataFromWindow();
913
914 if( modified )
915 m_frame->OnModify();
916
917 return true;
918}
919
920
922{
923 std::vector<wxString> names;
924 wxTextCtrl* ctl;
925
926 for( PCB_LAYER_ID layer : LSET::AllLayersMask() )
927 {
928 // we _can_ rely on m_enabledLayers being current here:
929
930 if( !m_enabledLayers[layer] )
931 continue;
932
933 ctl = (wxTextCtrl*) getName( layer );
934 wxString name = ctl->GetValue();
935
936 // Check name for legality:
937 // 1) Cannot be blank.
938 // 2) Cannot have blanks.
939 // 3) Cannot have " chars
940 // 4) Cannot be 'signal'
941 // 5) Must be unique.
942 // 6) Cannot have illegal chars in filenames ( some filenames are built from layer names )
943 // like : % $ \ " / :
944 wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
945 badchars.Append( '%' );
946
947 if( !name )
948 {
949 PAGED_DIALOG::GetDialog( this )->SetError( _( "Layer must have a name." ), this, ctl );
950 return false;
951 }
952
953 if( name.find_first_of( badchars ) != wxString::npos )
954 {
955 wxString msg = wxString::Format(_( "%s are forbidden in layer names." ), badchars );
956 PAGED_DIALOG::GetDialog( this )->SetError( msg, this, ctl );
957 return false;
958 }
959
960 if( name == wxT( "signal" ) )
961 {
962 PAGED_DIALOG::GetDialog( this )->SetError( _( "Layer name \"signal\" is reserved." ), this, ctl );
963 return false;
964 }
965
966 for( const wxString& existingName : names )
967 {
968 if( name == existingName )
969 {
970 wxString msg = wxString::Format(_( "Layer name '%s' already in use." ), name );
971 PAGED_DIALOG::GetDialog( this )->SetError( msg, this, ctl );
972 return false;
973 }
974 }
975
976 names.push_back( name );
977 }
978
979 return true;
980}
981
982
984{
985 LSEQ removedLayers;
986 LSET newLayers = GetUILayerMask();
987 LSET curLayers = m_pcb->GetEnabledLayers();
988
989 if( newLayers == curLayers ) // Return an empty list if no change
990 return removedLayers;
991
992 for( PCB_LAYER_ID layer_id : curLayers )
993 {
994 if( !newLayers[layer_id] && m_pcb->HasItemsOnLayer( layer_id ) )
995 removedLayers.push_back( layer_id );
996 }
997
998 return removedLayers;
999}
1000
1001
1003{
1004 // Build the list of non-copper layers in use in footprints.
1005 LSEQ inUseLayers;
1006 LSET newLayers = GetUILayerMask();
1007 LSET curLayers = m_pcb->GetEnabledLayers();
1008
1009 if( newLayers == curLayers ) // Return an empty list if no change
1010 return inUseLayers;
1011
1012 PCB_LAYER_COLLECTOR collector;
1013
1014 for( PCB_LAYER_ID layer_id : curLayers )
1015 {
1016 if( IsCopperLayer( layer_id ) ) // Copper layers are not taken into account here
1017 continue;
1018
1019 if( !newLayers.Contains( layer_id ) )
1020 {
1021 collector.SetLayerId( layer_id );
1023
1024 if( collector.GetCount() != 0 )
1025 inUseLayers.push_back( layer_id );
1026 }
1027 }
1028
1029 return inUseLayers;
1030}
1031
1032
1034{
1035 BOARD* savedBoard = m_pcb;
1036
1037 m_pcb = aBoard;
1039
1040 m_pcb = savedBoard;
1041}
1042
1043
1044bool PANEL_SETUP_LAYERS::CheckCopperLayerCount( BOARD* aWorkingBoard, BOARD* aImportedBoard )
1045{
1046 /*
1047 * This function warns users if they are going to delete inner copper layers because
1048 * they're importing settings from a board with less copper layers than the board
1049 * already loaded. We want to return "true" as default on the assumption no layer will
1050 * actually be deleted.
1051 */
1052 bool okToDeleteCopperLayers = true;
1053
1054 // Get the number of copper layers in the loaded board and the "import settings" board
1055 int currNumLayers = aWorkingBoard->GetCopperLayerCount();
1056 int newNumLayers = aImportedBoard->GetCopperLayerCount();
1057
1058 if( newNumLayers < currNumLayers )
1059 {
1060 wxString msg = wxString::Format( _( "Imported settings have fewer copper layers than "
1061 "the current board (%i instead of %i).\n\n"
1062 "Continue and delete the extra inner copper layers "
1063 "from the current board?" ),
1064 newNumLayers,
1065 currNumLayers );
1066
1067 wxWindow* topLevelParent = wxGetTopLevelParent( this );
1068
1069 wxMessageDialog dlg( topLevelParent, msg, _( "Inner Layers to Be Deleted" ),
1070 wxICON_WARNING | wxSTAY_ON_TOP | wxYES | wxNO | wxNO_DEFAULT );
1071
1072 if( wxID_ANY == dlg.ShowModal() )
1073 okToDeleteCopperLayers = false;
1074 }
1075
1076 return okToDeleteCopperLayers;
1077}
1078
1079
1080void PANEL_SETUP_LAYERS::addUserDefinedLayer( wxCommandEvent& aEvent )
1081{
1082 wxArrayString headers;
1083 headers.Add( _( "Layers" ) );
1084
1085 // Build the available user-defined layers list:
1086 std::vector<wxArrayString> list;
1087
1088 for( PCB_LAYER_ID layer : LSET::UserDefinedLayersMask().Seq() )
1089 {
1090 wxCheckBox* checkBox = getCheckBox( layer );
1091
1092 if( checkBox && checkBox->IsShown() )
1093 continue;
1094
1095 wxArrayString available_user_layer;
1096 available_user_layer.Add( LayerName( layer ) );
1097
1098 list.emplace_back( available_user_layer );
1099 }
1100
1101 if( list.empty() )
1102 {
1104 _( "All user-defined layers have already been added." ) );
1105 return;
1106 }
1107
1108 EDA_LIST_DIALOG dlg( PAGED_DIALOG::GetDialog( this ), _( "Add User-defined Layer" ),
1109 headers, list );
1110 dlg.SetListLabel( _( "Select layer to add:" ) );
1111 dlg.HideFilter();
1112
1113 if( dlg.ShowModal() == wxID_ANY || dlg.GetTextSelection().IsEmpty() )
1114 return;
1115
1117
1118 for( PCB_LAYER_ID layer2 : LSET::UserDefinedLayersMask().Seq() )
1119 {
1120 if( LayerName( layer2 ) == dlg.GetTextSelection() )
1121 {
1122 layer = layer2;
1123 break;
1124 }
1125 }
1126
1127 wxCHECK( layer >= User_1, /* void */ );
1128
1129 m_enabledLayers.set( layer );
1130 append_user_layer( layer );
1131
1133
1134 // All user-defined layers should have a checkbox
1135 wxASSERT( ctl.checkbox );
1136 ctl.checkbox->SetValue( true );
1137
1138 wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ctl.name );
1139
1140 wxCHECK( textCtrl, /* void */ );
1141 textCtrl->ChangeValue( LSET::Name( layer ) );
1142
1143 wxChoice* userLayerType = dynamic_cast<wxChoice*>( ctl.choice );
1144
1145 wxCHECK( userLayerType, /* void */ );
1146 userLayerType->SetSelection( 0 );
1147
1148 ctl.name->Show( true );
1149 ctl.checkbox->Show( true );
1150 ctl.choice->Show( true );
1151
1152 wxSizeEvent evt_size( m_LayersListPanel->GetSize() );
1153 m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size );
1154}
1155
1156
const char * name
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition board.h:185
@ LT_POWER
Definition board.h:188
@ LT_FRONT
Definition board.h:192
@ LT_MIXED
Definition board.h:189
@ LT_BACK
Definition board.h:193
@ LT_UNDEFINED
Definition board.h:186
@ LT_JUMPER
Definition board.h:190
@ LT_AUX
Definition board.h:191
@ LT_SIGNAL
Definition board.h:187
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:223
BASE_SET & reset(size_t pos)
Definition base_set.h:143
BASE_SET & set(size_t pos)
Definition base_set.h:116
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
int GetCopperLayerCount() const
Definition board.cpp:876
int GetCount() const
Return the number of objects in the list.
Definition collector.h:83
int ShowModal() override
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 > FootprintItems
A scan list for primary footprint items.
Definition collectors.h:107
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:907
copper_layers_iterator copper_layers_begin() const
Definition lset.cpp:901
non_copper_layers_iterator non_copper_layers_begin() const
Definition lset.cpp:913
non_copper_layers_iterator non_copper_layers_end() const
Definition lset.cpp:919
static const LSET & AllLayersMask()
Definition lset.cpp:624
static LSET UserDefinedLayersMask(int aUserDefinedLayerCount=MAX_USER_DEFINED_LAYERS)
Return a mask with the requested number of user defined layers.
Definition lset.cpp:687
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
Definition lset.cpp:591
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:560
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition lset.cpp:188
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Definition lset.h:63
Definition pad.h:54
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:549
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:555
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition confirm.cpp:251
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:194
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:676
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ F_CrtYd
Definition layer_ids.h:116
@ B_Adhes
Definition layer_ids.h:103
@ Edge_Cuts
Definition layer_ids.h:112
@ Dwgs_User
Definition layer_ids.h:107
@ F_Paste
Definition layer_ids.h:104
@ Cmts_User
Definition layer_ids.h:108
@ F_Adhes
Definition layer_ids.h:102
@ B_Mask
Definition layer_ids.h:98
@ B_Cu
Definition layer_ids.h:65
@ Eco1_User
Definition layer_ids.h:109
@ F_Mask
Definition layer_ids.h:97
@ B_Paste
Definition layer_ids.h:105
@ F_Fab
Definition layer_ids.h:119
@ Margin
Definition layer_ids.h:113
@ F_SilkS
Definition layer_ids.h:100
@ B_CrtYd
Definition layer_ids.h:115
@ UNDEFINED_LAYER
Definition layer_ids.h:61
@ Eco2_User
Definition layer_ids.h:110
@ Rescue
Definition layer_ids.h:121
@ User_1
Definition layer_ids.h:124
@ B_SilkS
Definition layer_ids.h:101
@ F_Cu
Definition layer_ids.h:64
@ B_Fab
Definition layer_ids.h:118
static void mandatoryLayerCbSetup(wxCheckBox &aCheckBox)
Configure a layer checkbox to be mandatory and disabled.
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
The 3 UI control pointers for a single board layer.