KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
24
26
28{
29public:
30 PANEL_REGULATOR( wxWindow* parent, wxWindowID id = wxID_ANY,
31 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
32 long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
34
35
36public:
37 void OnRegulatorCalcButtonClick( wxCommandEvent& event ) override;
38 void OnRegulatorResetButtonClick( wxCommandEvent& event ) override;
39 void OnRegulTypeSelection( wxCommandEvent& event ) override;
40 void OnRegulatorSelection( wxCommandEvent& event ) override;
41 void OnDataFileSelection( wxCommandEvent& event ) override;
42 void OnAddRegulator( wxCommandEvent& event ) override;
43 void OnEditRegulator( wxCommandEvent& event ) override;
44 void OnRemoveRegulator( wxCommandEvent& event ) override;
45 void OnCopyCB( wxCommandEvent& event ) override;
46
47 // Methods from CALCULATOR_PANEL that must be overridden
48 void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
49 void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
50 void ThemeChanged() override;
51
58
63
64 void RegulatorsSolve();
65
69 const wxString GetDataFilename();
70
77 void SetDataFilename( const wxString& aFilename );
78
79 // R/W data files:
80 bool ReadDataFile();
81 bool WriteDataFile();
82
83 static double round_to( double value, double precision = 0.001 );
84
85public:
86 REGULATOR_LIST m_RegulatorList; // the list of known regulators
88 bool m_RegulatorListChanged; // Set when m_RegulatorList is modified
89 // and the corresponding file must be rewritten
90
91};
92
93#endif
const char * name
Definition: DXF_plotter.cpp:57
Class PANEL_REGULATOR_BASE.
void OnEditRegulator(wxCommandEvent &event) override
void OnRegulatorSelection(wxCommandEvent &event) override
static double round_to(double value, double precision=0.001)
void OnRegulatorResetButtonClick(wxCommandEvent &event) override
REGULATOR_LIST m_RegulatorList
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
const wxString GetDataFilename()
void OnRegulatorCalcButtonClick(wxCommandEvent &event) override
void OnDataFileSelection(wxCommandEvent &event) override
void SetDataFilename(const wxString &aFilename)
Initialize the full filename of the selected pcb_calculator data file force the standard extension of...
void SelectLastSelectedRegulator()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()
void OnRegulTypeSelection(wxCommandEvent &event) override
void OnCopyCB(wxCommandEvent &event) override
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
void OnRemoveRegulator(wxCommandEvent &event) override
wxString m_lastSelectedRegulatorName
void OnAddRegulator(wxCommandEvent &event) override
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
void RegulatorPageUpdate()
Update the regulator page dialog display.
Contains structures for storage of regulator data.