KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_netclasses.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_NETCLASSES_H
22#define PANEL_SETUP_NETCLASSES_H
23
24#include <widgets/unit_binder.h>
27
28class NET_SETTINGS;
29class NETCLASS;
30
31
33{
34public:
35 PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRAW_FRAME* aFrame,
36 std::shared_ptr<NET_SETTINGS> aSettings,
37 const std::set<wxString>& aNetNames, bool isEEschema );
38 ~PANEL_SETUP_NETCLASSES() override;
39
40 bool TransferDataToWindow() override;
41 bool TransferDataFromWindow() override;
42
43 bool Validate() override;
44
45 void ImportSettingsFrom( const std::shared_ptr<NET_SETTINGS>& aNetSettings );
46
47 void UpdateDelayProfileNames( const std::vector<wxString>& aNames ) const;
48
49private:
50 void OnAddNetclassClick( wxCommandEvent& event ) override;
51 void OnRemoveNetclassClick( wxCommandEvent& event ) override;
52 void OnMoveNetclassUpClick( wxCommandEvent& event ) override;
53 void OnMoveNetclassDownClick( wxCommandEvent& event ) override;
54 void OnImportColorsClick( wxCommandEvent& event ) override;
55 void OnSizeNetclassGrid( wxSizeEvent& event ) override;
56 void OnSizeAssignmentGrid( wxSizeEvent& event ) override;
57 void OnAddAssignmentClick( wxCommandEvent& event ) override;
58 void OnRemoveAssignmentClick( wxCommandEvent& event ) override;
59 void OnUpdateUI( wxUpdateUIEvent &event ) override;
60 void OnNetclassGridCellChanging( wxGridEvent& event );
61 void OnNetclassGridMouseEvent( wxMouseEvent& event );
62 void OnNetclassAssignmentSort( wxGridEvent& event );
63
64 void onUnitsChanged( wxCommandEvent& aEvent );
65
66 bool validateNetclassName( int aRow, const wxString& aName, bool focusFirst = true );
67 bool validateNetclassClearance( int aRow );
68
70
71 void AdjustNetclassGridColumns( int aWidth );
72 void AdjustAssignmentGridColumns( int aWidth );
73
74 void loadNetclasses();
75 void checkReload();
76
77 void setNetclassRowNullableEditors( int aRowId, bool aIsDefault );
78
79private:
82 std::shared_ptr<NET_SETTINGS> m_netSettings;
83 std::set<wxString> m_netNames;
84
85 std::unique_ptr<UNITS_PROVIDER> m_schUnitsProvider;
86 std::unique_ptr<UNITS_PROVIDER> m_pcbUnitsProvider;
87
88 std::map<wxString, std::shared_ptr<NETCLASS>> m_lastLoaded;
90
91 std::map<int, int> m_originalColWidths; // Map col-number : orig-col-width
92 bool m_netclassesDirty; // The netclass drop-down menus need rebuilding
93 int m_hoveredCol; // Column being hovered over, for tooltips
94 wxString m_lastPattern;
95
96 std::bitset<64> m_shownColumns;
98
101};
102
103#endif //PANEL_SETUP_NETCLASSES_H
The base class for create windows for drawing purpose.
A collection of nets and the parameters used to route or test these nets.
Definition netclass.h:38
NET_SETTINGS stores various net-related settings in a project context.
PANEL_SETUP_NETCLASSES_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)
void OnImportColorsClick(wxCommandEvent &event) override
std::map< int, int > m_originalColWidths
void OnUpdateUI(wxUpdateUIEvent &event) override
void OnSizeAssignmentGrid(wxSizeEvent &event) override
PANEL_SETUP_NETCLASSES(wxWindow *aParentWindow, EDA_DRAW_FRAME *aFrame, std::shared_ptr< NET_SETTINGS > aSettings, const std::set< wxString > &aNetNames, bool isEEschema)
void OnRemoveNetclassClick(wxCommandEvent &event) override
void OnRemoveAssignmentClick(wxCommandEvent &event) override
std::map< wxString, std::shared_ptr< NETCLASS > > m_lastLoaded
void UpdateDelayProfileNames(const std::vector< wxString > &aNames) const
void ImportSettingsFrom(const std::shared_ptr< NET_SETTINGS > &aNetSettings)
void onUnitsChanged(wxCommandEvent &aEvent)
void OnNetclassGridCellChanging(wxGridEvent &event)
void setNetclassRowNullableEditors(int aRowId, bool aIsDefault)
bool validateNetclassName(int aRow, const wxString &aName, bool focusFirst=true)
std::unique_ptr< UNITS_PROVIDER > m_pcbUnitsProvider
void OnNetclassGridMouseEvent(wxMouseEvent &event)
void OnAddAssignmentClick(wxCommandEvent &event) override
void AdjustAssignmentGridColumns(int aWidth)
void OnMoveNetclassUpClick(wxCommandEvent &event) override
std::set< wxString > m_netNames
void OnAddNetclassClick(wxCommandEvent &event) override
std::unique_ptr< UNITS_PROVIDER > m_schUnitsProvider
void OnSizeNetclassGrid(wxSizeEvent &event) override
void OnNetclassAssignmentSort(wxGridEvent &event)
void AdjustNetclassGridColumns(int aWidth)
std::shared_ptr< NET_SETTINGS > m_netSettings
void OnMoveNetclassDownClick(wxCommandEvent &event) override