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) 2018 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 private:
55  void OnAddNetclassClick( wxCommandEvent& event ) override;
56  void OnRemoveNetclassClick( wxCommandEvent& event ) override;
57  void OnSizeNetclassGrid( wxSizeEvent& event ) override;
58  void OnSizeMembershipGrid( wxSizeEvent& event ) override;
59  void OnUpdateUI( wxUpdateUIEvent &event ) override;
60  void OnNetclassGridCellChanging( wxGridEvent& event );
61  void OnShowAll( wxCommandEvent& event ) override { doApplyFilters( true ); }
62  void OnApplyFilters( wxCommandEvent& event ) override { doApplyFilters( false ); }
63  void OnAssignAll( wxCommandEvent& event ) override { doAssignments( true ); }
64  void OnAssignSelected( wxCommandEvent& event ) override { doAssignments( false ); }
65 
66  bool validateNetclassName( int aRow, wxString aName, bool focusFirst = true );
67  bool validateData();
68 
70  int getNetclassValue( int aRow, int aCol );
71 
72  void addNet( wxString netName, const wxString& netclass );
73  void doApplyFilters( bool aShowAll );
74  void doAssignments( bool aAssignAll );
75 
76  void AdjustNetclassGridColumns( int aWidth );
77  void AdjustMembershipGridColumns( int aWidth );
78 
79 public:
81  PANEL_SETUP_FEATURE_CONSTRAINTS* aConstraintsPanel );
82  ~PANEL_SETUP_NETCLASSES( ) override;
83 
84  bool TransferDataToWindow() override;
85  bool TransferDataFromWindow() override;
86 
87  void ImportSettingsFrom( BOARD* aBoard );
88 };
89 
90 #endif //PANEL_SETUP_NETCLASSES_H
void OnSizeNetclassGrid(wxSizeEvent &event) override
void OnAssignAll(wxCommandEvent &event) override
void OnApplyFilters(wxCommandEvent &event) override
Class BOARD to handle a board.
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:170
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)