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 (C) 2019-2023 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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24
25#ifndef PANEL_SETUP_NETCLASSES_H
26#define PANEL_SETUP_NETCLASSES_H
27
28#include <widgets/unit_binder.h>
31
32class NET_SETTINGS;
33class NETCLASS;
34
35
37{
38public:
39 PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRAW_FRAME* aFrame,
40 std::shared_ptr<NET_SETTINGS> aSettings,
41 const std::set<wxString>& aNetNames, bool isEEschema );
42 ~PANEL_SETUP_NETCLASSES( ) override;
43
44 bool TransferDataToWindow() override;
45 bool TransferDataFromWindow() override;
46
47 bool Validate() override;
48
49 void ImportSettingsFrom( const std::shared_ptr<NET_SETTINGS>& aNetSettings );
50
51private:
52 void OnAddNetclassClick( wxCommandEvent& event ) override;
53 void OnRemoveNetclassClick( wxCommandEvent& event ) override;
54 void OnMoveNetclassUpClick( wxCommandEvent& event ) override;
55 void OnMoveNetclassDownClick( wxCommandEvent& event ) override;
56 void OnImportColorsClick( wxCommandEvent& event ) override;
57 void OnSizeNetclassGrid( wxSizeEvent& event ) override;
58 void OnSizeAssignmentGrid( wxSizeEvent& event ) override;
59 void OnAddAssignmentClick( wxCommandEvent& event ) override;
60 void OnRemoveAssignmentClick( wxCommandEvent& event ) override;
61 void OnUpdateUI( wxUpdateUIEvent &event ) override;
62 void OnNetclassGridCellChanging( wxGridEvent& event );
63 void OnNetclassGridMouseEvent( wxMouseEvent& event );
64
65 void onUnitsChanged( wxCommandEvent& aEvent );
66
67 bool validateNetclassName( int aRow, const wxString& aName, bool focusFirst = true );
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};
99
100#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:44
NET_SETTINGS stores various net-related settings in a project context.
Definition: net_settings.h:39
Class PANEL_SETUP_NETCLASSES_BASE.
void OnImportColorsClick(wxCommandEvent &event) override
std::map< int, int > m_originalColWidths
void OnUpdateUI(wxUpdateUIEvent &event) override
void OnSizeAssignmentGrid(wxSizeEvent &event) override
void OnRemoveNetclassClick(wxCommandEvent &event) override
void OnRemoveAssignmentClick(wxCommandEvent &event) override
std::map< wxString, std::shared_ptr< NETCLASS > > m_lastLoaded
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
std::bitset< 64 > m_shownColumns
void OnSizeNetclassGrid(wxSizeEvent &event) override
void AdjustNetclassGridColumns(int aWidth)
std::shared_ptr< NET_SETTINGS > m_netSettings
void OnMoveNetclassDownClick(wxCommandEvent &event) override