KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_tuning_profiles.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, 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#ifndef PANEL_SETUP_TUNING_PROFILES_H
25#define PANEL_SETUP_TUNING_PROFILES_H
26
27#include <memory>
28
29#include <board.h>
30#include <dialog_shim.h>
33
35
37{
38public:
40
41 PANEL_SETUP_TUNING_PROFILES( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame, BOARD* aBoard,
42 std::shared_ptr<TUNING_PROFILES> aTimeDomainParameters );
44
50 void SyncCopperLayers( int aNumCopperLayers );
51
53 bool TransferDataToWindow() override;
54
56 bool TransferDataFromWindow() override;
57
59 std::vector<wxString> GetDelayProfileNames() const;
60
62 void ImportSettingsFrom( const std::shared_ptr<TUNING_PROFILES>& aOtherParameters );
63
65 void OnAddTuningProfileClick( wxCommandEvent& event ) override;
66
68 void OnRemoveTuningProfileClick( wxCommandEvent& event ) override;
69
71 bool Validate() override;
72
74 void UpdateProfileName( PANEL_SETUP_TUNING_PROFILE_INFO* panel, wxString newName ) const;
75
76private:
78 std::shared_ptr<TUNING_PROFILES> m_tuningProfileParameters;
79
82
85
88
89 std::unique_ptr<UNITS_PROVIDER> m_unitsProvider;
90
91 // Layer / index lookups
92 std::map<PCB_LAYER_ID, int> m_copperLayerIdsToIndex;
93 std::map<int, PCB_LAYER_ID> m_copperIndexToLayerId;
94 std::vector<wxString> m_layerNames;
95
96 // We cache these in case the names change on the layers panel
97 std::map<wxString, PCB_LAYER_ID> m_layerNamesToIDs;
98 std::map<wxString, PCB_LAYER_ID> m_prevLayerNamesToIDs;
99};
100
101
102#endif //PANEL_SETUP_TUNING_PROFILES_H
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition dialog_shim.h:68
PANEL_SETUP_TUNING_PROFILES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(719, 506), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
std::map< wxString, PCB_LAYER_ID > m_layerNamesToIDs
void OnRemoveTuningProfileClick(wxCommandEvent &event) override
Removes a tuning profile entry from the tuning profile grid.
void OnAddTuningProfileClick(wxCommandEvent &event) override
Adds a new tuning profile entry to the tuning profile grid.
void ImportSettingsFrom(const std::shared_ptr< TUNING_PROFILES > &aOtherParameters)
Load configuration from the given settings object.
std::map< wxString, PCB_LAYER_ID > m_prevLayerNamesToIDs
PCB_EDIT_FRAME * m_frame
The active edit frame.
std::map< int, PCB_LAYER_ID > m_copperIndexToLayerId
std::map< PCB_LAYER_ID, int > m_copperLayerIdsToIndex
bool Validate() override
Validates all data.
void SyncCopperLayers(int aNumCopperLayers)
Called when switching to this tab to make sure that any changes to the copper layer count made on the...
std::unique_ptr< UNITS_PROVIDER > m_unitsProvider
bool TransferDataToWindow() override
Load parameter data from the settings object.
PANEL_SETUP_TUNING_PROFILES(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame, BOARD *aBoard, std::shared_ptr< TUNING_PROFILES > aTimeDomainParameters)
std::shared_ptr< TUNING_PROFILES > m_tuningProfileParameters
The parameters object to load / save data from / to.
std::vector< wxString > GetDelayProfileNames() const
Returns all configured tuning profile names. Used by the netclass setup panel.
void UpdateProfileName(PANEL_SETUP_TUNING_PROFILE_INFO *panel, wxString newName) const
Update the notebook display of the name for a given panel.
bool TransferDataFromWindow() override
Save parameter data to the settings object.
DIALOG_SHIM * m_dlg
The parent dialog.
The main frame for Pcbnew.