KiCad PCB EDA Suite
panel_setup_layers.cpp File Reference
#include <confirm.h>
#include <core/arraydim.h>
#include <core/kicad_algo.h>
#include <pcbnew.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <collectors.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <panel_setup_layers.h>
#include <board_stackup_manager/panel_board_stackup.h>
#include <wx/choicdlg.h>
#include <wx/treebook.h>
#include <eda_list_dialog.h>

Go to the source code of this file.

Macros

#define HIDE_INACTIVE_LAYERS
 
#define RETURN_COPPER(x)   return PANEL_SETUP_LAYERS_CTLs( x##Name, x##CheckBox, x##Choice )
 
#define RETURN_AUX(x)   return PANEL_SETUP_LAYERS_CTLs( x##Name, x##CheckBox, x##StaticText )
 
#define RETURN_MANDATORY(x)   return PANEL_SETUP_LAYERS_CTLs( x##Name, nullptr, x##StaticText )
 

Functions

static LSEQ dlg_layers ()
 
static bool hasOneOf (const wxString &str, const wxString &chars)
 

Macro Definition Documentation

◆ HIDE_INACTIVE_LAYERS

#define HIDE_INACTIVE_LAYERS

Definition at line 49 of file panel_setup_layers.cpp.

◆ RETURN_AUX

#define RETURN_AUX (   x)    return PANEL_SETUP_LAYERS_CTLs( x##Name, x##CheckBox, x##StaticText )

◆ RETURN_COPPER

#define RETURN_COPPER (   x)    return PANEL_SETUP_LAYERS_CTLs( x##Name, x##CheckBox, x##Choice )

◆ RETURN_MANDATORY

#define RETURN_MANDATORY (   x)    return PANEL_SETUP_LAYERS_CTLs( x##Name, nullptr, x##StaticText )

Function Documentation

◆ dlg_layers()

static LSEQ dlg_layers ( )
static

Definition at line 52 of file panel_setup_layers.cpp.

53{
54 // Layers that are put out into the dialog UI, coordinate with wxformbuilder and
55 // getCTLs( int aLayerNumber )
56 static const PCB_LAYER_ID layers[] = {
57 F_CrtYd,
58 F_Fab,
59 F_Adhes,
60 F_Paste,
61 F_SilkS,
62 F_Mask,
63 F_Cu,
64
65 In1_Cu,
66 In2_Cu,
67 In3_Cu,
68 In4_Cu,
69 In5_Cu,
70 In6_Cu,
71 In7_Cu,
72 In8_Cu,
73 In9_Cu,
74 In10_Cu,
75 In11_Cu,
76 In12_Cu,
77 In13_Cu,
78 In14_Cu,
79 In15_Cu,
80
81 In16_Cu,
82 In17_Cu,
83 In18_Cu,
84 In19_Cu,
85 In20_Cu,
86 In21_Cu,
87 In22_Cu,
88 In23_Cu,
89 In24_Cu,
90 In25_Cu,
91 In26_Cu,
92 In27_Cu,
93 In28_Cu,
94 In29_Cu,
95 In30_Cu,
96
97 B_Cu,
98 B_Mask,
99 B_SilkS,
100 B_Paste,
101 B_Adhes,
102 B_Fab,
103 B_CrtYd,
104
105 Edge_Cuts,
106 Margin,
107 Eco2_User,
108 Eco1_User,
109 Cmts_User,
110 Dwgs_User,
111
112 User_1,
113 User_2,
114 User_3,
115 User_4,
116 User_5,
117 User_6,
118 User_7,
119 User_8,
120 User_9,
121 };
122
123 return LSEQ( layers, layers + arrayDim( layers ) );
124}
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:493
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ In22_Cu
Definition: layer_ids.h:86
@ In11_Cu
Definition: layer_ids.h:75
@ In29_Cu
Definition: layer_ids.h:93
@ In30_Cu
Definition: layer_ids.h:94
@ User_8
Definition: layer_ids.h:130
@ F_CrtYd
Definition: layer_ids.h:117
@ In17_Cu
Definition: layer_ids.h:81
@ B_Adhes
Definition: layer_ids.h:97
@ Edge_Cuts
Definition: layer_ids.h:113
@ Dwgs_User
Definition: layer_ids.h:109
@ F_Paste
Definition: layer_ids.h:101
@ In9_Cu
Definition: layer_ids.h:73
@ Cmts_User
Definition: layer_ids.h:110
@ User_6
Definition: layer_ids.h:128
@ User_7
Definition: layer_ids.h:129
@ In19_Cu
Definition: layer_ids.h:83
@ In7_Cu
Definition: layer_ids.h:71
@ In28_Cu
Definition: layer_ids.h:92
@ In26_Cu
Definition: layer_ids.h:90
@ F_Adhes
Definition: layer_ids.h:98
@ B_Mask
Definition: layer_ids.h:106
@ B_Cu
Definition: layer_ids.h:95
@ User_5
Definition: layer_ids.h:127
@ Eco1_User
Definition: layer_ids.h:111
@ F_Mask
Definition: layer_ids.h:107
@ In21_Cu
Definition: layer_ids.h:85
@ In23_Cu
Definition: layer_ids.h:87
@ B_Paste
Definition: layer_ids.h:100
@ In15_Cu
Definition: layer_ids.h:79
@ In2_Cu
Definition: layer_ids.h:66
@ User_9
Definition: layer_ids.h:131
@ F_Fab
Definition: layer_ids.h:120
@ In10_Cu
Definition: layer_ids.h:74
@ Margin
Definition: layer_ids.h:114
@ F_SilkS
Definition: layer_ids.h:104
@ In4_Cu
Definition: layer_ids.h:68
@ B_CrtYd
Definition: layer_ids.h:116
@ Eco2_User
Definition: layer_ids.h:112
@ In16_Cu
Definition: layer_ids.h:80
@ In24_Cu
Definition: layer_ids.h:88
@ In1_Cu
Definition: layer_ids.h:65
@ User_3
Definition: layer_ids.h:125
@ User_1
Definition: layer_ids.h:123
@ B_SilkS
Definition: layer_ids.h:103
@ In13_Cu
Definition: layer_ids.h:77
@ User_4
Definition: layer_ids.h:126
@ In8_Cu
Definition: layer_ids.h:72
@ In14_Cu
Definition: layer_ids.h:78
@ User_2
Definition: layer_ids.h:124
@ In12_Cu
Definition: layer_ids.h:76
@ In27_Cu
Definition: layer_ids.h:91
@ In6_Cu
Definition: layer_ids.h:70
@ In5_Cu
Definition: layer_ids.h:69
@ In3_Cu
Definition: layer_ids.h:67
@ In20_Cu
Definition: layer_ids.h:84
@ F_Cu
Definition: layer_ids.h:64
@ In18_Cu
Definition: layer_ids.h:82
@ In25_Cu
Definition: layer_ids.h:89
@ B_Fab
Definition: layer_ids.h:119

References arrayDim(), B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, Margin, User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.

Referenced by PANEL_SETUP_LAYERS::GetUILayerMask(), PANEL_SETUP_LAYERS::showBoardLayerNames(), and PANEL_SETUP_LAYERS::showSelectedLayerCheckBoxes().

◆ hasOneOf()

static bool hasOneOf ( const wxString &  str,
const wxString &  chars 
)
static

Definition at line 631 of file panel_setup_layers.cpp.

632{
633 for( unsigned i=0; i<chars.Len(); ++i )
634 {
635 if( str.Find( chars[i] ) != wxNOT_FOUND )
636 return true;
637 }
638
639 return false;
640}

Referenced by PANEL_SETUP_LAYERS::testLayerNames().