KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_cable_size.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-2023 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_CABLE_SIZE_H
21#define PANEL_CABLE_SIZE_H
22
24#include <vector>
25
26// Helper to convert values (in m2) to mm2, more useful to display these values
27#define M2_to_MM2 1e6
28
30
32{
33public:
34 CABLE_SIZE_ENTRY( const wxString& aName, double aRadius_meter );
35
36 const wxString m_Name;
37 const double m_Radius; // stored in meters
38};
39
41{
42public:
43 PANEL_CABLE_SIZE( wxWindow* parent, wxWindowID id = wxID_ANY,
44 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
45 long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
47
48 // Methods from CALCULATOR_PANEL that must be overridden
49 void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
50 void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
51 void ThemeChanged() override{};
52
53 void OnCableSizeChange( wxCommandEvent& aEvent ) override;
54 void OnConductorResistivityChange( wxCommandEvent& aEvent ) override;
55 void OnConductorResistivity_Button( wxCommandEvent& aEvent ) override;
56 void OnConductorThermCoefChange( wxCommandEvent& aEvent ) override;
57 void OnConductorThermCoefChange_Button( wxCommandEvent& aEvent ) override;
58 void OnUpdateUnit( wxCommandEvent& aEvent ) override;
59 void OnDiameterChange( wxCommandEvent& aEvent ) override;
60 void OnAreaChange( wxCommandEvent& aEvent ) override;
61 void OnLinResistanceChange( wxCommandEvent& aEvent ) override;
62 void OnFrequencyChange( wxCommandEvent& aEvent ) override;
63 void OnAmpacityChange( wxCommandEvent& aEvent ) override;
64 void OnConductorTempChange( wxCommandEvent& aEvent ) override;
65 void OnCurrentChange( wxCommandEvent& aEvent ) override;
66 void OnLengthChange( wxCommandEvent& aEvent ) override;
67 void OnResistanceDcChange( wxCommandEvent& aEvent ) override;
68 void OnVDropChange( wxCommandEvent& aEvent ) override;
69 void OnPowerChange( wxCommandEvent& aEvent ) override;
70 void onUpdateCurrentDensity( wxScrollEvent& aEvent ) override;
71
72private:
73 void updateAll( double aRadius );
74 void updateApplication();
75 void printAll();
76 void buildCableList();
77
79 double m2_by_ampere()
80 {
81 return 1/m_amp_by_mm2/M2_to_MM2;
82 }
83
84private:
85 std::vector<CABLE_SIZE_ENTRY> m_entries;
86
99
101
102 // Stored in normalized units
108 double m_current;
109 double m_length;
110 double m_area;
117 double m_amp_by_mm2; // allowed current density in ampere by mm2
118};
119
120#endif
const char * name
Definition: DXF_plotter.cpp:57
const double m_Radius
const wxString m_Name
Class PANEL_CABLE_SIZE_BASE.
void updateAll(double aRadius)
void OnCurrentChange(wxCommandEvent &aEvent) override
double m_conductorMaterialThermalCoef
void OnFrequencyChange(wxCommandEvent &aEvent) override
void OnResistanceDcChange(wxCommandEvent &aEvent) override
bool m_updatingConductorMaterialResitivity
void OnCableSizeChange(wxCommandEvent &aEvent) override
void OnUpdateUnit(wxCommandEvent &aEvent) override
void OnConductorResistivity_Button(wxCommandEvent &aEvent) override
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
void OnVDropChange(wxCommandEvent &aEvent) override
void OnConductorThermCoefChange(wxCommandEvent &aEvent) override
double m_conductorMaterialResitivity
void OnAreaChange(wxCommandEvent &aEvent) override
void OnPowerChange(wxCommandEvent &aEvent) override
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
double m_conductorMaterialResitivityRef
void OnDiameterChange(wxCommandEvent &aEvent) override
void OnConductorResistivityChange(wxCommandEvent &aEvent) override
void OnConductorThermCoefChange_Button(wxCommandEvent &aEvent) override
void onUpdateCurrentDensity(wxScrollEvent &aEvent) override
void OnLinResistanceChange(wxCommandEvent &aEvent) override
void OnAmpacityChange(wxCommandEvent &aEvent) override
void OnConductorTempChange(wxCommandEvent &aEvent) override
std::vector< CABLE_SIZE_ENTRY > m_entries
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
void OnLengthChange(wxCommandEvent &aEvent) override
#define M2_to_MM2