KiCad PCB EDA Suite
panel_regulator.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) 1992-2021 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 3
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 along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef PANEL_REGULATOR_H
21 #define PANEL_REGULATOR_H
22 #include "panel_regulator_base.h"
23 #include "class_regulator_data.h"
24 
26 
28 {
29 public:
30  PANEL_REGULATOR( wxWindow* parent, wxWindowID id = wxID_ANY,
31  const wxPoint& pos = wxDefaultPosition,
32  const wxSize& size = wxDefaultSize,
33  long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
35 
36 
37 public:
38  void OnRegulatorCalcButtonClick( wxCommandEvent& event ) override;
39  void OnRegulatorResetButtonClick( wxCommandEvent& event ) override;
40  void OnRegulTypeSelection( wxCommandEvent& event ) override;
41  void OnRegulatorSelection( wxCommandEvent& event ) override;
42  void OnDataFileSelection( wxCommandEvent& event ) override;
43  void OnAddRegulator( wxCommandEvent& event ) override;
44  void OnEditRegulator( wxCommandEvent& event ) override;
45  void OnRemoveRegulator( wxCommandEvent& event ) override;
46 
47  // Methods from CALCULATOR_PANEL that must be overriden
48  void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
49  void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
50  void ThemeChanged() override;
51 
57  void RegulatorPageUpdate();
58 
63 
64  void RegulatorsSolve();
65 
72 
76  const wxString GetDataFilename();
77 
84  void SetDataFilename( const wxString& aFilename );
85 
86  // R/W data files:
87  bool ReadDataFile();
88  bool WriteDataFile();
89 
90 public:
91  REGULATOR_LIST m_RegulatorList; // the list of known regulators
93  bool m_RegulatorListChanged; // Set when m_RegulatorList is modified
94  // and the corresponding file must be rewritten
95 
96 };
97 
98 #endif
void OnRegulatorSelection(wxCommandEvent &event) override
void OnRegulatorCalcButtonClick(wxCommandEvent &event) override
void OnRemoveRegulator(wxCommandEvent &event) override
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
void OnEditRegulator(wxCommandEvent &event) override
void RegulatorPageUpdate()
Update the regulator page dialog display.
REGULATOR_LIST m_RegulatorList
Class PANEL_REGULATOR_BASE.
PANEL_REGULATOR(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void SetDataFilename(const wxString &aFilename)
Initialize the full filename of the selected pcb_calculator data file force the standard extension of...
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
Contains structures for storage of regulator data.
void SelectLastSelectedRegulator()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()
const wxString GetDataFilename()
void OnAddRegulator(wxCommandEvent &event) override
wxString m_lastSelectedRegulatorName
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
void OnDataFileSelection(wxCommandEvent &event) override
const char * name
Definition: DXF_plotter.cpp:56
void Regulators_WriteConfig(PCB_CALCULATOR_SETTINGS *aCfg)
Write regulators parameters in configuration.
void OnRegulatorResetButtonClick(wxCommandEvent &event) override
void OnRegulTypeSelection(wxCommandEvent &event) override