46#include <wx/choicdlg.h>
59 const wxPoint& pos,
const wxSize& size,
60 long style,
const wxString&
name ) :
72 GetSizer()->SetSizeHints(
this );
92 wxString value = wxGetSingleChoice( wxEmptyString,
_(
"Relative Dielectric Constants" ), list )
95 if( !value.IsEmpty() )
105 wxString value = wxGetSingleChoice( wxEmptyString,
_(
"Electrical Resistivity in Ohm*m" ),
106 list ).BeforeFirst(
' ' );
108 if( !value.IsEmpty() )
129 #define DEFAULT_UNIT_SEL_MM 0
130 #define DEFAULT_UNIT_SEL_OHM 0
227 double area = M_PI * ( finishedHoleDia + platingThickness ) * platingThickness;
229 double viaResistance = platingResistivity * viaLength / area;
233 const double thermalResistivity = 2.49e-3;
234 double thermalResistance = thermalResistivity * viaLength / area;
236 double voltageDrop = appliedCurrent * viaResistance;
238 double powerLoss = appliedCurrent * voltageDrop;
244 const double k = 0.048;
245 const double b = 0.44;
246 const double c = 0.725;
247 double estimatedAmpacity = k * pow( temperatureDiff, b ) * pow( area, c );
250 double capacitance = 55.51 * relativePermitivity * viaLength * padDia;
251 capacitance /= clearanceDia - padDia;
254 double timeDegradation = 2.2 * capacitance * charImpedance / 2;
257 double inductance = 200 * viaLength;
258 inductance *= log( 4 * viaLength / finishedHoleDia ) + 1;
261 double reactance = M_PI * inductance / pulseRiseTime;
264 VSDisplayValues( viaResistance, voltageDrop, powerLoss, estimatedAmpacity,
265 thermalResistance, capacitance, timeDegradation, inductance, reactance );
269 double aEstimatedAmpacity,
double aThermalResistance,
270 double aCapacitance,
double aTimeDegradation,
double aInductance,
275 msg.Printf(
"%g", aViaResistance );
278 msg.Printf(
"%g", aVoltageDrop );
281 msg.Printf(
"%g", aPowerLoss );
284 msg.Printf(
"%g", aEstimatedAmpacity );
287 msg.Printf(
"%g", aThermalResistance );
290 msg.Printf(
"%g", aCapacitance );
293 msg.Printf(
"%g", aTimeDegradation );
296 msg.Printf(
"%g", aInductance );
299 msg.Printf(
"%g", aReactance );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Class PANEL_VIA_SIZE_BASE.
wxTextCtrl * m_textCtrlPlatingResistivity
wxTextCtrl * m_textCtrlClearanceDia
wxStaticText * m_RiseTimeOutput
wxTextCtrl * m_textCtrlPlatingThickness
wxStaticText * m_staticTextWarning
UNIT_SELECTOR_LEN * m_choiceClearanceDia
wxStaticText * m_ViaThermalResistance
wxTextCtrl * m_textCtrlViaLength
wxTextCtrl * m_textCtrlAppliedCurrent
wxTextCtrl * m_textCtrlViaPadDia
wxTextCtrl * m_textCtrlRiseTime
wxStaticText * m_ViaAmpacity
wxStaticText * m_viaResUnits
wxTextCtrl * m_textCtrlHoleDia
wxTextCtrl * m_textCtrlImpedance
wxStaticText * m_viaReactanceUnits
UNIT_SELECTOR_LEN * m_choiceViaPadDia
wxStaticText * m_ViaCapacitance
UNIT_SELECTOR_RESISTOR * m_choiceImpedance
wxStaticText * m_ViaResistance
wxTextCtrl * m_textCtrlTemperatureDiff
wxStaticText * m_Inductance
wxStaticText * m_ViaVoltageDrop
wxTextCtrl * m_textCtrlPlatingPermittivity
wxStaticBitmap * m_viaBitmap
wxStaticText * m_viaResistivityUnits
UNIT_SELECTOR_LEN * m_choiceViaLength
UNIT_SELECTOR_LEN * m_choiceHoleDia
wxStaticText * m_viaTempUnits
wxStaticText * m_Reactance
wxStaticText * m_ViaPowerLoss
UNIT_SELECTOR_LEN * m_choicePlatingThickness
wxStaticText * m_viaThermalResUnits
void OnViaResetButtonClick(wxCommandEvent &event) override
Called when the user clicks the reset button; sets the parameters to their default values.
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
void VSDisplayValues(double aViaResistance, double aVoltageDrop, double aPowerLoss, double aEstimatedAmpacity, double aThermalResistance, double aCapacitance, double aTimeDegradation, double aInductance, double aReactance)
Display the results of the calculation.
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
void OnViaRho_Button(wxCommandEvent &event) override
Shows a list of current Specific resistance list (rho) and select a value.
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
PANEL_VIA_SIZE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void OnViaEpsilonR_Button(wxCommandEvent &event) override
Shows a list of current relative dielectric constant(Er) and select a value.
void onUpdateViaCalcErrorText(wxUpdateUIEvent &event) override
Update the Error message in via calculation panel.
void OnViaCalculate(wxCommandEvent &event) override
Called when the user changes any value in the via calculator.
double GetUnitScale() override
Function GetUnitScale.
double GetUnitScale() override
Function GetUnitScale.
wxArrayString StandardResistivityList()
wxArrayString StandardRelativeDielectricConstantList()
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
double DoubleFromString(const wxString &TextValue)
#define DEFAULT_UNIT_SEL_OHM
#define DEFAULT_UNIT_SEL_MM
double DoubleFromString(const wxString &TextValue)
int characteristic_impedance_units
wxString characteristic_impedance
wxString plating_resistivity
wxString clearance_diameter
int clearance_diameter_units