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 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
63 void onUnitsChanged( wxCommandEvent& aEvent );
64
65 bool validateNetclassName( int aRow, const wxString& aName, bool focusFirst = true );
66
68
69 void AdjustNetclassGridColumns( int aWidth );
70 void AdjustAssignmentGridColumns( int aWidth );
71
72 void loadNetclasses();
73 void checkReload();
74
75private:
78 std::shared_ptr<NET_SETTINGS> m_netSettings;
79 std::set<wxString> m_netNames;
80
81 std::unique_ptr<UNITS_PROVIDER> m_schUnitsProvider;
82 std::unique_ptr<UNITS_PROVIDER> m_pcbUnitsProvider;
83
84 std::map<wxString, std::shared_ptr<NETCLASS>> m_lastLoaded;
86
87 std::map<int, int> m_originalColWidths; // Map col-number : orig-col-width
88 bool m_netclassesDirty; // The netclass drop-down menus need rebuilding
89 int m_hoveredCol; // Column being hovered over, for tooltips
90 wxString m_lastPattern;
91
93};
94
95#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:34
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)
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)
std::set< wxString > m_netNames
void OnAddNetclassClick(wxCommandEvent &event) override
std::unique_ptr< UNITS_PROVIDER > m_schUnitsProvider
void OnSizeNetclassGrid(wxSizeEvent &event) override
void AdjustNetclassGridColumns(int aWidth)
std::shared_ptr< NET_SETTINGS > m_netSettings