KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_time_domain_parameters.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
25#ifndef PANEL_SETUP_TIME_DOMAIN_PARAMETERS_H
26#define PANEL_SETUP_TIME_DOMAIN_PARAMETERS_H
27
28#include <utility>
29
30#include <board.h>
33
34class NET_SETTINGS;
35
36
38{
39public:
41 wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame, BOARD* aBoard,
42 std::shared_ptr<TIME_DOMAIN_PARAMETERS> 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<TIME_DOMAIN_PARAMETERS>& aOtherParameters );
63
64private:
66 {
70 };
71
73 {
80 };
81
83 void setColumnWidths();
84
87 void updateViaProfileNamesEditor( const wxString& aOldName = wxEmptyString,
88 const wxString& aNewName = wxEmptyString ) const;
89
92
95
97 void OnAddDelayProfileClick( wxCommandEvent& event ) override;
98
100 void OnRemoveDelayProfileClick( wxCommandEvent& event ) override;
101
103 void OnAddViaOverrideClick( wxCommandEvent& event ) override;
104
106 void OnRemoveViaOverrideClick( wxCommandEvent& event ) override;
107
109 void OnDelayProfileGridCellChanging( wxGridEvent& event );
110
112 bool validateDelayProfileName( int aRow, const wxString& aName, bool focusFirst = true );
113
115 bool Validate() override;
116
118 bool validateViaRows();
119
121 void addProfileRow( const DELAY_PROFILE& aDelayProfile );
122
124 DELAY_PROFILE getProfileRow( int aRow );
125
127 void addViaRow( const wxString& aProfileName, const DELAY_PROFILE_VIA_OVERRIDE_ENTRY& aViaOverrideEntry ) const;
128
131
133 wxString getProfileNameForProfileGridRow( int aRow ) const;
134
136 std::shared_ptr<TIME_DOMAIN_PARAMETERS> m_timeDomainParameters;
137
140
143
144 std::unique_ptr<UNITS_PROVIDER> m_unitsProvider;
145
146 // Layer / column lookups
147 std::map<PCB_LAYER_ID, int> m_copperLayerIdsToColumns;
148 std::map<int, PCB_LAYER_ID> m_copperColumnsToLayerId;
149 std::vector<wxString> m_layerNames;
150
151 // We cache these in case the names change on the layers panel
152 std::map<wxString, PCB_LAYER_ID> m_layerNamesToIDs;
153 std::map<wxString, PCB_LAYER_ID> m_prevLayerNamesToIDs;
154};
155
156#endif // PANEL_SETUP_TIME_DOMAIN_PARAMETERS_H
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:317
NET_SETTINGS stores various net-related settings in a project context.
Definition: net_settings.h:39
Class PANEL_SETUP_TIME_DOMAIN_PARAMETERS_BASE.
wxString getProfileNameForProfileGridRow(int aRow) const
Gets the profile name for the given profile grid row.
std::map< wxString, PCB_LAYER_ID > m_prevLayerNamesToIDs
std::map< wxString, PCB_LAYER_ID > m_layerNamesToIDs
bool TransferDataFromWindow() override
Save parameter data to the settings object.
void updateViaGridColumns()
Update the dynamic (per-layer) columns in the via overrides grid.
void OnAddViaOverrideClick(wxCommandEvent &event) override
Adds a new via override profile entry to the via overrides grid.
PCB_EDIT_FRAME * m_frame
The active edit frame.
void OnRemoveViaOverrideClick(wxCommandEvent &event) override
Removes a via override profile entry from the via overrides grid.
void OnAddDelayProfileClick(wxCommandEvent &event) override
Adds a new tuning profile entry to the tuning profile grid.
void addProfileRow(const DELAY_PROFILE &aDelayProfile)
Adds a tuning profile row with the given persisted parameters.
void setColumnWidths()
Optimise grid columns to fit titles and content.
void addViaRow(const wxString &aProfileName, const DELAY_PROFILE_VIA_OVERRIDE_ENTRY &aViaOverrideEntry) const
Adds a via override row with the given persisted parameters.
void ImportSettingsFrom(const std::shared_ptr< TIME_DOMAIN_PARAMETERS > &aOtherParameters)
Load configuration from the given settings object.
bool validateDelayProfileName(int aRow, const wxString &aName, bool focusFirst=true)
Validates a tuning profile name (checks for not empty and not duplicated)
void updateProfileGridColumns()
Update the dynamic (per-layer) columns in the tuning profiles grid.
DELAY_PROFILE getProfileRow(int aRow)
Gets a tuning profile row as a set of persistable parameters.
std::shared_ptr< TIME_DOMAIN_PARAMETERS > m_timeDomainParameters
The parameters object to load / save data from / to.
void updateViaProfileNamesEditor(const wxString &aOldName=wxEmptyString, const wxString &aNewName=wxEmptyString) const
Updates the via override tuning profile name dropdown lists Updates entries if aOldName and aNewName ...
bool validateViaRows()
Validates all via override rows.
void OnDelayProfileGridCellChanging(wxGridEvent &event)
Validates a tuning profile row data.
DELAY_PROFILE_VIA_OVERRIDE_ENTRY getViaRow(int aRow)
Gets a via override row as a set of persistable parameters.
void OnRemoveDelayProfileClick(wxCommandEvent &event) override
Removes a tuning profile entry from the tuning profile grid.
bool TransferDataToWindow() override
Load parameter data from the settings object.
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
std::vector< wxString > GetDelayProfileNames() const
Returns all configured tuning profile names. Used by the netclass setup panel.
The main frame for Pcbnew.
Represents a single line in the time domain configuration via overrides configuration grid.
Represents a single line in the time domain configuration net class configuration grid.