KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PANEL_TRACK_WIDTH Class Reference

#include <panel_track_width.h>

Inheritance diagram for PANEL_TRACK_WIDTH:
PANEL_TRACK_WIDTH_BASE CALCULATOR_PANEL

Public Member Functions

 PANEL_TRACK_WIDTH (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~PANEL_TRACK_WIDTH ()
 
void LoadSettings (PCB_CALCULATOR_SETTINGS *aCfg) override
 Load the settings into the panel.
 
void SaveSettings (PCB_CALCULATOR_SETTINGS *aCfg) override
 Save the settings from the panel.
 
void ThemeChanged () override
 Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appropriate for the new theme.
 
void OnTWParametersChanged (wxCommandEvent &event) override
 Update the calculations the user changes the general parameters.
 
void OnTWCalculateFromCurrent (wxCommandEvent &event) override
 Update the calculations when the user changes the desired maximum current.
 
void OnTWCalculateFromExtWidth (wxCommandEvent &event) override
 Update the calculations when the user changes the desired external trace width.
 
void OnTWCalculateFromIntWidth (wxCommandEvent &event) override
 Update the calculations when the user changes the desired internal trace width.
 
void OnTWResetButtonClick (wxCommandEvent &event) override
 Update the calculations when the user clicks the reset button.
 
double TWCalculateWidth (double aCurrent, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
 Calculate track width required based on given current and temperature rise.
 
double TWCalculateCurrent (double aWidth, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
 Calculate maximum current based on given width and temperature rise.
 
void TWDisplayValues (double aCurrent, double aExtWidth, double aIntWidth, double aExtThickness, double aIntThickness)
 Display the results of a calculation (including resulting values such as the resistance and power loss).
 
void TWUpdateModeDisplay ()
 Update the fields to show whether the maximum current, external trace width, or internal trace width is currently the controlling parameter.
 

Protected Attributes

wxStaticText * m_staticTextCurrent
 
wxTextCtrl * m_TrackCurrentValue
 
wxStaticText * m_staticText62
 
wxStaticText * m_staticText63
 
wxTextCtrl * m_TrackDeltaTValue
 
wxStaticText * m_trackTempUnits
 
wxStaticText * m_staticText66
 
wxTextCtrl * m_TrackLengthValue
 
UNIT_SELECTOR_LENm_TW_CuLength_choiceUnit
 
wxStaticText * m_staticText103
 
wxTextCtrl * m_TWResistivity
 
wxStaticText * m_resistivityUnits
 
HTML_WINDOWm_htmlWinFormulas
 
wxStaticText * m_staticTextExtWidth
 
wxTextCtrl * m_ExtTrackWidthValue
 
UNIT_SELECTOR_LENm_TW_ExtTrackWidth_choiceUnit
 
wxStaticText * m_staticText65
 
wxTextCtrl * m_ExtTrackThicknessValue
 
UNIT_SELECTOR_THICKNESSm_ExtTrackThicknessUnit
 
wxStaticLine * m_staticline3
 
wxStaticLine * m_staticline4
 
wxStaticLine * m_staticline5
 
wxStaticText * m_staticTextArea
 
wxStaticText * m_ExtTrackAreaValue
 
wxStaticText * m_extTrackAreaUnitLabel
 
wxStaticText * m_staticText651
 
wxStaticText * m_ExtTrackResistValue
 
wxStaticText * m_extTrackResUnits
 
wxStaticText * m_staticText661
 
wxStaticText * m_ExtTrackVDropValue
 
wxStaticText * m_staticText83
 
wxStaticText * m_staticText79
 
wxStaticText * m_ExtTrackLossValue
 
wxStaticText * m_staticText791
 
wxStaticText * m_staticTextIntWidth
 
wxTextCtrl * m_IntTrackWidthValue
 
UNIT_SELECTOR_LENm_TW_IntTrackWidth_choiceUnit
 
wxStaticText * m_staticText652
 
wxTextCtrl * m_IntTrackThicknessValue
 
UNIT_SELECTOR_THICKNESSm_IntTrackThicknessUnit
 
wxStaticLine * m_staticline8
 
wxStaticLine * m_staticline9
 
wxStaticLine * m_staticline10
 
wxStaticText * m_staticTextArea1
 
wxStaticText * m_IntTrackAreaValue
 
wxStaticText * m_intTrackAreaUnitLabel
 
wxStaticText * m_staticText6511
 
wxStaticText * m_IntTrackResistValue
 
wxStaticText * m_intTrackResUnits
 
wxStaticText * m_staticText6611
 
wxStaticText * m_IntTrackVDropValue
 
wxStaticText * m_staticText831
 
wxStaticText * m_staticText792
 
wxStaticText * m_IntTrackLossValue
 
wxStaticText * m_staticText7911
 
wxButton * m_buttonTrackWidthReset
 

Private Types

enum  { TW_MASTER_CURRENT , TW_MASTER_EXT_WIDTH , TW_MASTER_INT_WIDTH }
 

Private Attributes

enum PANEL_TRACK_WIDTH:: { ... }  m_TWMode
 
bool m_TWNested
 

Detailed Description

Definition at line 28 of file panel_track_width.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
TW_MASTER_CURRENT 
TW_MASTER_EXT_WIDTH 
TW_MASTER_INT_WIDTH 

Definition at line 92 of file panel_track_width.h.

Constructor & Destructor Documentation

◆ PANEL_TRACK_WIDTH()

PANEL_TRACK_WIDTH::PANEL_TRACK_WIDTH ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxEmptyString 
)

◆ ~PANEL_TRACK_WIDTH()

PANEL_TRACK_WIDTH::~PANEL_TRACK_WIDTH ( )

Definition at line 68 of file panel_track_width.cpp.

Member Function Documentation

◆ LoadSettings()

void PANEL_TRACK_WIDTH::LoadSettings ( PCB_CALCULATOR_SETTINGS aCfg)
overridevirtual

Load the settings into the panel.

Parameters
aCfgis the settings structure to load from

Implements CALCULATOR_PANEL.

Definition at line 447 of file panel_track_width.cpp.

References ConvertMarkdown2Html(), copper_resistivity, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::current, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::delta_tc, dummy, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_thickness, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_thickness_units, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_width, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_width_units, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_thickness, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_thickness_units, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_width, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_width_units, PANEL_TRACK_WIDTH_BASE::m_ExtTrackThicknessUnit, PANEL_TRACK_WIDTH_BASE::m_ExtTrackThicknessValue, PANEL_TRACK_WIDTH_BASE::m_ExtTrackWidthValue, PANEL_TRACK_WIDTH_BASE::m_htmlWinFormulas, PANEL_TRACK_WIDTH_BASE::m_IntTrackThicknessUnit, PANEL_TRACK_WIDTH_BASE::m_IntTrackThicknessValue, PANEL_TRACK_WIDTH_BASE::m_IntTrackWidthValue, PANEL_TRACK_WIDTH_BASE::m_TrackCurrentValue, PANEL_TRACK_WIDTH_BASE::m_TrackDeltaTValue, PANEL_TRACK_WIDTH_BASE::m_TrackLengthValue, PCB_CALCULATOR_SETTINGS::m_TrackWidth, PANEL_TRACK_WIDTH_BASE::m_TW_CuLength_choiceUnit, PANEL_TRACK_WIDTH_BASE::m_TW_ExtTrackWidth_choiceUnit, PANEL_TRACK_WIDTH_BASE::m_TW_IntTrackWidth_choiceUnit, m_TWNested, PANEL_TRACK_WIDTH_BASE::m_TWResistivity, OnTWParametersChanged(), PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::resistivity, HTML_WINDOW::SetPage(), PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::track_len, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::track_len_units, tracks_width_versus_current_formula, and TWUpdateModeDisplay().

◆ OnTWCalculateFromCurrent()

◆ OnTWCalculateFromExtWidth()

◆ OnTWCalculateFromIntWidth()

◆ OnTWParametersChanged()

void PANEL_TRACK_WIDTH::OnTWParametersChanged ( wxCommandEvent &  event)
overridevirtual

Update the calculations the user changes the general parameters.

Reimplemented from PANEL_TRACK_WIDTH_BASE.

Definition at line 97 of file panel_track_width.cpp.

References m_TWMode, OnTWCalculateFromCurrent(), OnTWCalculateFromExtWidth(), OnTWCalculateFromIntWidth(), TW_MASTER_CURRENT, TW_MASTER_EXT_WIDTH, and TW_MASTER_INT_WIDTH.

Referenced by LoadSettings().

◆ OnTWResetButtonClick()

◆ SaveSettings()

void PANEL_TRACK_WIDTH::SaveSettings ( PCB_CALCULATOR_SETTINGS aCfg)
overridevirtual

Save the settings from the panel.

Parameters
aCfgis the settings structure to save to

Implements CALCULATOR_PANEL.

Definition at line 79 of file panel_track_width.cpp.

References PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::current, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::delta_tc, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_thickness, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_thickness_units, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_width, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::ext_track_width_units, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_thickness, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_thickness_units, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_width, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::int_track_width_units, PANEL_TRACK_WIDTH_BASE::m_ExtTrackThicknessUnit, PANEL_TRACK_WIDTH_BASE::m_ExtTrackThicknessValue, PANEL_TRACK_WIDTH_BASE::m_ExtTrackWidthValue, PANEL_TRACK_WIDTH_BASE::m_IntTrackThicknessUnit, PANEL_TRACK_WIDTH_BASE::m_IntTrackThicknessValue, PANEL_TRACK_WIDTH_BASE::m_IntTrackWidthValue, PANEL_TRACK_WIDTH_BASE::m_TrackCurrentValue, PANEL_TRACK_WIDTH_BASE::m_TrackDeltaTValue, PANEL_TRACK_WIDTH_BASE::m_TrackLengthValue, PCB_CALCULATOR_SETTINGS::m_TrackWidth, PANEL_TRACK_WIDTH_BASE::m_TW_CuLength_choiceUnit, PANEL_TRACK_WIDTH_BASE::m_TW_ExtTrackWidth_choiceUnit, PANEL_TRACK_WIDTH_BASE::m_TW_IntTrackWidth_choiceUnit, PANEL_TRACK_WIDTH_BASE::m_TWResistivity, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::resistivity, PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::track_len, and PCB_CALCULATOR_SETTINGS::TRACK_WIDTH::track_len_units.

◆ ThemeChanged()

void PANEL_TRACK_WIDTH::ThemeChanged ( )
overridevirtual

Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appropriate for the new theme.

Implements CALCULATOR_PANEL.

Definition at line 73 of file panel_track_width.cpp.

References PANEL_TRACK_WIDTH_BASE::m_htmlWinFormulas, and HTML_WINDOW::ThemeChanged().

◆ TWCalculateCurrent()

double PANEL_TRACK_WIDTH::TWCalculateCurrent ( double  aWidth,
double  aThickness,
double  aDeltaT_C,
bool  aUseInternalLayer 
)

Calculate maximum current based on given width and temperature rise.

Definition at line 430 of file panel_track_width.cpp.

References scale, and UNIT_MIL.

Referenced by OnTWCalculateFromExtWidth(), and OnTWCalculateFromIntWidth().

◆ TWCalculateWidth()

double PANEL_TRACK_WIDTH::TWCalculateWidth ( double  aCurrent,
double  aThickness,
double  aDeltaT_C,
bool  aUseInternalLayer 
)

Calculate track width required based on given current and temperature rise.

Definition at line 407 of file panel_track_width.cpp.

References scale, and UNIT_MIL.

Referenced by OnTWCalculateFromCurrent(), OnTWCalculateFromExtWidth(), and OnTWCalculateFromIntWidth().

◆ TWDisplayValues()

◆ TWUpdateModeDisplay()

Member Data Documentation

◆ m_buttonTrackWidthReset

wxButton* PANEL_TRACK_WIDTH_BASE::m_buttonTrackWidthReset
protectedinherited

◆ m_extTrackAreaUnitLabel

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_extTrackAreaUnitLabel
protectedinherited

◆ m_ExtTrackAreaValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_ExtTrackAreaValue
protectedinherited

◆ m_ExtTrackLossValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_ExtTrackLossValue
protectedinherited

◆ m_ExtTrackResistValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_ExtTrackResistValue
protectedinherited

◆ m_extTrackResUnits

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_extTrackResUnits
protectedinherited

◆ m_ExtTrackThicknessUnit

◆ m_ExtTrackThicknessValue

◆ m_ExtTrackVDropValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_ExtTrackVDropValue
protectedinherited

◆ m_ExtTrackWidthValue

◆ m_htmlWinFormulas

HTML_WINDOW* PANEL_TRACK_WIDTH_BASE::m_htmlWinFormulas
protectedinherited

◆ m_intTrackAreaUnitLabel

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_intTrackAreaUnitLabel
protectedinherited

◆ m_IntTrackAreaValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_IntTrackAreaValue
protectedinherited

◆ m_IntTrackLossValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_IntTrackLossValue
protectedinherited

◆ m_IntTrackResistValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_IntTrackResistValue
protectedinherited

◆ m_intTrackResUnits

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_intTrackResUnits
protectedinherited

◆ m_IntTrackThicknessUnit

◆ m_IntTrackThicknessValue

◆ m_IntTrackVDropValue

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_IntTrackVDropValue
protectedinherited

◆ m_IntTrackWidthValue

◆ m_resistivityUnits

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_resistivityUnits
protectedinherited

◆ m_staticline10

wxStaticLine* PANEL_TRACK_WIDTH_BASE::m_staticline10
protectedinherited

◆ m_staticline3

wxStaticLine* PANEL_TRACK_WIDTH_BASE::m_staticline3
protectedinherited

◆ m_staticline4

wxStaticLine* PANEL_TRACK_WIDTH_BASE::m_staticline4
protectedinherited

◆ m_staticline5

wxStaticLine* PANEL_TRACK_WIDTH_BASE::m_staticline5
protectedinherited

◆ m_staticline8

wxStaticLine* PANEL_TRACK_WIDTH_BASE::m_staticline8
protectedinherited

◆ m_staticline9

wxStaticLine* PANEL_TRACK_WIDTH_BASE::m_staticline9
protectedinherited

◆ m_staticText103

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText103
protectedinherited

◆ m_staticText62

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText62
protectedinherited

◆ m_staticText63

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText63
protectedinherited

◆ m_staticText65

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText65
protectedinherited

◆ m_staticText651

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText651
protectedinherited

◆ m_staticText6511

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText6511
protectedinherited

◆ m_staticText652

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText652
protectedinherited

◆ m_staticText66

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText66
protectedinherited

◆ m_staticText661

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText661
protectedinherited

◆ m_staticText6611

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText6611
protectedinherited

◆ m_staticText79

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText79
protectedinherited

◆ m_staticText791

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText791
protectedinherited

◆ m_staticText7911

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText7911
protectedinherited

◆ m_staticText792

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText792
protectedinherited

◆ m_staticText83

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText83
protectedinherited

◆ m_staticText831

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticText831
protectedinherited

◆ m_staticTextArea

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticTextArea
protectedinherited

◆ m_staticTextArea1

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticTextArea1
protectedinherited

◆ m_staticTextCurrent

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticTextCurrent
protectedinherited

◆ m_staticTextExtWidth

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticTextExtWidth
protectedinherited

◆ m_staticTextIntWidth

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_staticTextIntWidth
protectedinherited

◆ m_TrackCurrentValue

◆ m_TrackDeltaTValue

◆ m_TrackLengthValue

wxTextCtrl* PANEL_TRACK_WIDTH_BASE::m_TrackLengthValue
protectedinherited

◆ m_trackTempUnits

wxStaticText* PANEL_TRACK_WIDTH_BASE::m_trackTempUnits
protectedinherited

◆ m_TW_CuLength_choiceUnit

◆ m_TW_ExtTrackWidth_choiceUnit

◆ m_TW_IntTrackWidth_choiceUnit

◆ 

◆ m_TWNested

bool PANEL_TRACK_WIDTH::m_TWNested
private

◆ m_TWResistivity

wxTextCtrl* PANEL_TRACK_WIDTH_BASE::m_TWResistivity
protectedinherited

The documentation for this class was generated from the following files: