KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_track_via_properties.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 (C) 2015 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Maciej Suminski <[email protected]>
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
27#include <widgets/unit_binder.h>
28#include <optional>
29#include <layer_ids.h>
30
31class PCB_SELECTION;
33class PAD;
34class PADSTACK;
35
37{
38public:
40
42
43 bool TransferDataFromWindow() override;
44
45private:
46 void onNetSelector( wxCommandEvent& aEvent );
47 void onViaNotFreeClicked( wxCommandEvent& aEvent ) override;
48 void onWidthSelect( wxCommandEvent& aEvent ) override;
49 void onWidthEdit( wxCommandEvent& aEvent ) override;
50 void onViaSelect( wxCommandEvent& aEvent ) override;
51 void onViaEdit( wxCommandEvent& aEvent ) override;
52 void onTrackEdit( wxCommandEvent& aEvent ) override;
53 void onPadstackModeChanged( wxCommandEvent& aEvent ) override;
54 void onEditLayerChanged( wxCommandEvent& aEvent ) override;
55
56 void onUnitsChanged( wxCommandEvent& aEvent );
57 void onTeardropsUpdateUi( wxUpdateUIEvent& event ) override;
58
59 bool confirmShortingNets( int aNet, const std::set<int>& shortingNets );
60 bool confirmPadChange( const std::set<PAD*>& connectedPads );
61
62 int getLayerDepth();
64
65private:
67 const PCB_SELECTION& m_items; // List of items to be modified.
68
73
76
82
83 bool m_tracks; // True if dialog displays any track properties.
84 bool m_vias; // True if dialog displays any via properties.
85
87 std::unique_ptr<PADSTACK> m_viaStack;
88
91 std::map<int, PCB_LAYER_ID> m_editLayerCtrlMap;
92
93
94 enum class IPC4761_SURFACE
95 {
96 FROM_RULES = 0,
97 NONE = 1,
98 FRONT = 2,
99 BACK = 3,
100 BOTH = 4,
101 CUSTOM = 5
102 };
103
104 enum class IPC4761_DRILL
105 {
106 FROM_RULES = 0,
107 NOT_SET = 1,
108 SET = 2
109 };
110
111 enum class IPC4761_PRESET
112 {
113 FROM_RULES = 0,
114 NONE = 1,
115 IA = 2,
116 IB = 3,
117 IA_INVERTED = 4,
118 IIA = 5,
119 IIB = 6,
120 IIA_INVERTED = 7,
121 IIIA = 8,
122 IIIB = 9,
123 IIIA_INVERTED = 10,
124 IVA = 11,
125 IVB = 12,
126 IVA_INVERTED = 13,
127 V = 14,
128 VIA = 15,
129 VIB = 16,
130 VIA_INVERTED = 17,
131 VII = 18,
132 CUSTOM = 19,
133 END = 20
134 };
135
137 {
143
144 bool operator==( const IPC4761_CONFIGURATION& other ) const;
145 };
146
147 const std::map<IPC4761_PRESET, IPC4761_CONFIGURATION> m_IPC4761Presets{
151 { IPC4761_PRESET::NONE, {} },
156 { .tent = IPC4761_SURFACE::FRONT, .cover = IPC4761_SURFACE::FRONT } },
159 { .tent = IPC4761_SURFACE::BACK, .cover = IPC4761_SURFACE::BACK } },
166 { .tent = IPC4761_SURFACE::BACK, .plug = IPC4761_SURFACE::BACK } },
167 { IPC4761_PRESET::V, { .fill = IPC4761_DRILL::SET } },
171 { .tent = IPC4761_SURFACE::BACK, .fill = IPC4761_DRILL::SET } },
174 { IPC4761_PRESET::END, {} }
175 };
176
177 const std::map<IPC4761_PRESET, wxString> m_IPC4761Names{
178 { IPC4761_PRESET::FROM_RULES, _( "From rules" ) },
179 { IPC4761_PRESET::NONE, _( "None" ) },
180 { IPC4761_PRESET::IA, _( "Type I a ( tented top )" ) },
181 { IPC4761_PRESET::IB, _( "Type I b ( tented both sides )" ) },
182 { IPC4761_PRESET::IA_INVERTED, _( "Type I a ( tented bottom )" ) },
183 { IPC4761_PRESET::IIA, _( "Type II a ( covered and tented top )" ) },
184 { IPC4761_PRESET::IIB, _( "Type II b ( covered and tented both sides )" ) },
185 { IPC4761_PRESET::IIA_INVERTED, _( "Type II a ( covered and tented bottom )" ) },
186 { IPC4761_PRESET::IIIA, _( "Type III a ( plugged top )" ) },
187 { IPC4761_PRESET::IIIB, _( "Type III b ( plugged both sides )" ) },
188 { IPC4761_PRESET::IIIA_INVERTED, _( "Type III a ( plugged bottom )" ) },
189 { IPC4761_PRESET::IVA, _( "Type IV a ( plugged and tented top )" ) },
190 { IPC4761_PRESET::IVB, _( "Type IV b ( plugged and tented both sides )" ) },
191 { IPC4761_PRESET::IVA_INVERTED, _( "Type IV a ( plugged and tented bottom )" ) },
192 { IPC4761_PRESET::V, _( "Type V ( filled )" ) },
193 { IPC4761_PRESET::VIA, _( "Type VI a ( filled and tented top )" ) },
194 { IPC4761_PRESET::VIB, _( "Type VI b ( filled and tented both sides )" ) },
195 { IPC4761_PRESET::VIA_INVERTED, _( "Type VI a ( filled and tented bottom )" ) },
196 { IPC4761_PRESET::VII, _( "Type VII ( filled and capped )" ) },
197 { IPC4761_PRESET::CUSTOM, _( "Custom" ) },
198 { IPC4761_PRESET::END, _( "End" ) }
199 };
200};
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
void onWidthEdit(wxCommandEvent &aEvent) override
void onUnitsChanged(wxCommandEvent &aEvent)
void onNetSelector(wxCommandEvent &aEvent)
void onWidthSelect(wxCommandEvent &aEvent) override
bool confirmShortingNets(int aNet, const std::set< int > &shortingNets)
const std::map< IPC4761_PRESET, IPC4761_CONFIGURATION > m_IPC4761Presets
const std::map< IPC4761_PRESET, wxString > m_IPC4761Names
void onTeardropsUpdateUi(wxUpdateUIEvent &event) override
void onPadstackModeChanged(wxCommandEvent &aEvent) override
void onViaEdit(wxCommandEvent &aEvent) override
std::map< int, PCB_LAYER_ID > m_editLayerCtrlMap
PCB_LAYER_ID m_editLayer
The currently-shown copper layer of the edited via(s)
void onViaSelect(wxCommandEvent &aEvent) override
void onEditLayerChanged(wxCommandEvent &aEvent) override
void onViaNotFreeClicked(wxCommandEvent &aEvent) override
std::unique_ptr< PADSTACK > m_viaStack
Temporary padstack of the edited via(s)
bool confirmPadChange(const std::set< PAD * > &connectedPads)
void onTrackEdit(wxCommandEvent &aEvent) override
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
Definition: padstack.h:124
Definition: pad.h:54
Common, abstract interface for edit frames.
#define _(s)
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
bool operator==(const IPC4761_CONFIGURATION &other) const