KiCad PCB EDA Suite
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 KiCad Developers, see change_log.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 <class_board.h>
29 #include <widgets/unit_binder.h>
30 #include <widgets/paged_dialog.h>
31 
34 
35 class PCB_EDIT_FRAME;
37 
38 
40 {
41 private:
46 
47  // We must validate against the current m_BrdSettings as they may have been
48  // changed but not yet committed. Fetch them from the constraints panel.
50 
52  bool m_netclassesDirty; // Indicates the netclass drop-down
53  // menus need rebuilding
54  wxSize m_membershipSize; // The size needed to show the membership
55  // properties
56 private:
57  void OnAddNetclassClick( wxCommandEvent& event ) override;
58  void OnRemoveNetclassClick( wxCommandEvent& event ) override;
59  void OnSizeNetclassGrid( wxSizeEvent& event ) override;
60  void OnSizeMembershipGrid( wxSizeEvent& event ) override;
61  void OnUpdateUI( wxUpdateUIEvent &event ) override;
62  void OnNetclassGridCellChanging( wxGridEvent& event );
63  void OnShowAll( wxCommandEvent& event ) override { doApplyFilters( true ); }
64  void OnApplyFilters( wxCommandEvent& event ) override { doApplyFilters( false ); }
65  void OnAssignAll( wxCommandEvent& event ) override { doAssignments( true ); }
66  void OnAssignSelected( wxCommandEvent& event ) override { doAssignments( false ); }
67 
68  bool validateNetclassName( int aRow, wxString aName, bool focusFirst = true );
69  bool validateData();
70 
72  int getNetclassValue( int aRow, int aCol );
73 
74  void addNet( wxString netName, const wxString& netclass );
75  void doApplyFilters( bool aShowAll );
76  void doAssignments( bool aAssignAll );
77 
78  void AdjustNetclassGridColumns( int aWidth );
79  void AdjustMembershipGridColumns( int aWidth );
80 
81 public:
83  PANEL_SETUP_FEATURE_CONSTRAINTS* aConstraintsPanel );
84  ~PANEL_SETUP_NETCLASSES( ) override;
85 
86  bool TransferDataToWindow() override;
87  bool TransferDataFromWindow() override;
88 
89  void ImportSettingsFrom( BOARD* aBoard );
90 };
91 
92 #endif //PANEL_SETUP_NETCLASSES_H
void OnSizeNetclassGrid(wxSizeEvent &event) override
void OnAssignAll(wxCommandEvent &event) override
void OnApplyFilters(wxCommandEvent &event) override
void OnAssignSelected(wxCommandEvent &event) override
PANEL_SETUP_NETCLASSES(PAGED_DIALOG *aParent, PCB_EDIT_FRAME *aFrame, PANEL_SETUP_FEATURE_CONSTRAINTS *aConstraintsPanel)
int getNetclassValue(int aRow, int aCol)
void doAssignments(bool aAssignAll)
void OnShowAll(wxCommandEvent &event) override
void ImportSettingsFrom(BOARD *aBoard)
void addNet(wxString netName, const wxString &netclass)
void OnNetclassGridCellChanging(wxGridEvent &event)
BOARD_DESIGN_SETTINGS * m_BrdSettings
Class PANEL_SETUP_NETCLASSES_BASE.
PANEL_SETUP_FEATURE_CONSTRAINTS * m_ConstraintsPanel
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
void OnUpdateUI(wxUpdateUIEvent &event) override
bool validateNetclassName(int aRow, wxString aName, bool focusFirst=true)
void OnSizeMembershipGrid(wxSizeEvent &event) override
void OnRemoveNetclassClick(wxCommandEvent &event) override
void AdjustNetclassGridColumns(int aWidth)
void AdjustMembershipGridColumns(int aWidth)
void OnAddNetclassClick(wxCommandEvent &event) override
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
void doApplyFilters(bool aShowAll)