KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_layers.h
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#ifndef PANEL_SETUP_LAYERS_H
22#define PANEL_SETUP_LAYERS_H
23
24#include <widgets/unit_binder.h>
27
28class PCB_EDIT_FRAME;
29class BOARD;
32
33
38{
39 PANEL_SETUP_LAYERS_CTLs() : name( nullptr ), checkbox( nullptr ), choice( nullptr ) {}
40 PANEL_SETUP_LAYERS_CTLs( wxTextCtrl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc )
41 {
42 name = aName;
43 checkbox = aCheckBox;
44 choice = aChoiceOrDesc;
45 }
46
47 wxTextCtrl* name;
48 wxCheckBox* checkbox;
49 wxControl* choice;
50};
51
52
54{
55public:
56 PANEL_SETUP_LAYERS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame );
57
58 void ImportSettingsFrom( BOARD* aBoard );
59
71 bool CheckCopperLayerCount( BOARD* aWorkingBoard, BOARD* aImportedBoard );
72
75
81 void SyncCopperLayers( int aNumCopperLayers );
82
87
88 bool IsInitialized() const { return m_initialized; }
89
90private:
91 void setLayerCheckBox( PCB_LAYER_ID layer, bool isChecked );
92 void setCopperLayerCheckBoxes( int copperCount );
94
96 void showSelectedLayerCheckBoxes( const LSET& enableLayerMask );
97 void showLayerTypes();
99
100 bool TransferDataToWindow() override;
101 bool TransferDataFromWindow() override;
102 virtual void addUserDefinedLayer( wxCommandEvent& aEvent ) override;
103
104 bool testLayerNames();
105
111
116
117 wxTextCtrl* getName( PCB_LAYER_ID aLayer );
118 wxCheckBox* getCheckBox( PCB_LAYER_ID aLayer );
119 wxChoice* getChoice( PCB_LAYER_ID aLayer );
120
124
125 void append_user_layer( PCB_LAYER_ID aLayer );
126
127private:
133
134 std::map<PCB_LAYER_ID, PANEL_SETUP_LAYERS_CTLs> m_layersControls;
135
136
138 wxTextCtrl* m_CrtYdFrontName;
140
142 wxTextCtrl* m_FabFrontName;
143 wxStaticText* m_FabFrontStaticText;
144
146 wxTextCtrl* m_AdhesFrontName;
148
150 wxTextCtrl* m_SoldPFrontName;
152
154 wxTextCtrl* m_SilkSFrontName;
156
158 wxTextCtrl* m_MaskFrontName;
160
162 wxTextCtrl* m_MaskBackName;
163 wxStaticText* m_MaskBackStaticText;
164
166 wxTextCtrl* m_SilkSBackName;
168
170 wxTextCtrl* m_SoldPBackName;
172
174 wxTextCtrl* m_AdhesBackName;
176
177 wxCheckBox* m_FabBackCheckBox;
178 wxTextCtrl* m_FabBackName;
179 wxStaticText* m_FabBackStaticText;
180
182 wxTextCtrl* m_CrtYdBackName;
184
186 wxTextCtrl* m_PCBEdgesName;
187 wxStaticText* m_PCBEdgesStaticText;
188
189 wxCheckBox* m_MarginCheckBox;
190 wxTextCtrl* m_MarginName;
191 wxStaticText* m_MarginStaticText;
192
193 wxCheckBox* m_Eco1CheckBox;
194 wxTextCtrl* m_Eco1Name;
195 wxStaticText* m_Eco1StaticText;
196
197 wxCheckBox* m_Eco2CheckBox;
198 wxTextCtrl* m_Eco2Name;
199 wxStaticText* m_Eco2StaticText;
200
202 wxTextCtrl* m_CommentsName;
203 wxStaticText* m_CommentsStaticText;
204
206 wxTextCtrl* m_DrawingsName;
207 wxStaticText* m_DrawingsStaticText;
208};
209
210
211
212#endif //PANEL_SETUP_LAYERS_H
213
214
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
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
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
void SetPhysicalStackupPanel(PANEL_SETUP_BOARD_STACKUP *aPanel)
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)
The main frame for Pcbnew.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
PANEL_SETUP_LAYERS_CTLs(wxTextCtrl *aName, wxCheckBox *aCheckBox, wxControl *aChoiceOrDesc)