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"),
93 list).BeforeFirst(
' ' );
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( wxT(
"%g" ), aViaResistance );
278 msg.Printf( wxT(
"%g" ), aVoltageDrop );
281 msg.Printf( wxT(
"%g" ), aPowerLoss );
284 msg.Printf( wxT(
"%g" ), aEstimatedAmpacity );
287 msg.Printf( wxT(
"%g" ), aThermalResistance );
290 msg.Printf( wxT(
"%g" ), aCapacitance );
293 msg.Printf( wxT(
"%g" ), aTimeDegradation );
296 msg.Printf( wxT(
"%g" ), aInductance );
299 msg.Printf( wxT(
"%g" ), aReactance );
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
wxStaticText * m_ViaResistance
wxStaticText * m_ViaCapacitance
wxArrayString StandardRelativeDielectricConstantList()
wxTextCtrl * m_textCtrlRiseTime
wxStaticText * m_RiseTimeOutput
wxTextCtrl * m_textCtrlTemperatureDiff
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)
wxTextCtrl * m_textCtrlPlatingPermittivity
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
wxString clearance_diameter
#define DEFAULT_UNIT_SEL_OHM
wxTextCtrl * m_textCtrlViaPadDia
double DoubleFromString(const wxString &TextValue)
wxTextCtrl * m_textCtrlHoleDia
UNIT_SELECTOR_LEN * m_choiceViaLength
wxTextCtrl * m_textCtrlPlatingResistivity
UNIT_SELECTOR_LEN * m_choiceViaPadDia
wxStaticText * m_staticTextWarning
wxString plating_resistivity
wxTextCtrl * m_textCtrlViaLength
void OnViaEpsilonR_Button(wxCommandEvent &event) override
Shows a list of current relative dielectric constant(Er) and select a value.
double GetUnitScale() override
Function GetUnitScale.
wxStaticText * m_viaResUnits
wxStaticText * m_viaThermalResUnits
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.
wxStaticText * m_viaTempUnits
wxTextCtrl * m_textCtrlImpedance
UNIT_SELECTOR_LEN * m_choiceHoleDia
wxStaticText * m_viaReactanceUnits
UNIT_SELECTOR_LEN * m_choicePlatingThickness
int characteristic_impedance_units
wxArrayString StandardResistivityList()
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
wxStaticText * m_ViaAmpacity
wxStaticText * m_Inductance
void OnViaResetButtonClick(wxCommandEvent &event) override
Called when the user clicks the reset button; sets the parameters to their default values.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Class PANEL_VIA_SIZE_BASE.
#define DEFAULT_UNIT_SEL_MM
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.
wxString characteristic_impedance
wxStaticText * m_Reactance
double GetUnitScale() override
Function GetUnitScale.
void onUpdateViaCalcErrorText(wxUpdateUIEvent &event) override
Update the Error message in via calculation panel.
UNIT_SELECTOR_RESISTOR * m_choiceImpedance
wxTextCtrl * m_textCtrlClearanceDia
int clearance_diameter_units
wxTextCtrl * m_textCtrlPlatingThickness
wxStaticText * m_ViaPowerLoss
void OnViaCalculate(wxCommandEvent &event) override
Called when the user changes any value in the via calculator.
wxStaticText * m_viaResistivityUnits
wxStaticText * m_ViaVoltageDrop
wxTextCtrl * m_textCtrlAppliedCurrent
wxStaticText * m_ViaThermalResistance
wxStaticBitmap * m_viaBitmap
UNIT_SELECTOR_LEN * m_choiceClearanceDia