Some more pcb calculator refresh hacks.

Also adjusts the spacing and decimal point in the E-series page.

Fixes https://gitlab.com/kicad/code/kicad/issues/5634
This commit is contained in:
Jeff Young 2021-02-12 00:47:08 +00:00
parent 9094ba8033
commit 55020ce2c7
20 changed files with 2797 additions and 2690 deletions

View File

@ -1,5 +1,5 @@
// Do not edit this file, it is autogenerated by CMake from the .md file // Do not edit this file, it is autogenerated by CMake from the .md file
_HKI( "## Pi attenuator\n" _HKI( "### Pi attenuator\n"
"__Zin__ desired input impedance in &#x2126;<br>\n" "__Zin__ desired input impedance in &#x2126;<br>\n"
"__Zout__ desired output impedance<br>\n" "__Zout__ desired output impedance<br>\n"
"__Zin = Zout__<br><br>\n" "__Zin = Zout__<br><br>\n"

View File

@ -1,4 +1,4 @@
## Pi attenuator ### Pi attenuator
__Zin__ desired input impedance in &#x2126;<br> __Zin__ desired input impedance in &#x2126;<br>
__Zout__ desired output impedance<br> __Zout__ desired output impedance<br>
__Zin = Zout__<br><br> __Zin = Zout__<br><br>

View File

@ -1,6 +1,6 @@
// Do not edit this file, it is autogenerated by CMake from the .md file // Do not edit this file, it is autogenerated by CMake from the .md file
_HKI( "## Splitted attenuator\n" _HKI( "### Split attenuator\n"
"### Attenuation is 6dB\n" "#### Attenuation is 6dB\n"
"___Z<sub>in</sub>___ desired input impedance in &#x2126;<br>\n" "___Z<sub>in</sub>___ desired input impedance in &#x2126;<br>\n"
"___Z<sub>out</sub>___ desired output impedance in &#x2126;<br>\n" "___Z<sub>out</sub>___ desired output impedance in &#x2126;<br>\n"
"___Z<sub>in</sub> = Z<sub>out</sub>___\n" "___Z<sub>in</sub> = Z<sub>out</sub>___\n"

View File

@ -1,5 +1,5 @@
## Splitted attenuator ### Split attenuator
### Attenuation is 6dB #### Attenuation is 6dB
___Z<sub>in</sub>___ desired input impedance in &#x2126;<br> ___Z<sub>in</sub>___ desired input impedance in &#x2126;<br>
___Z<sub>out</sub>___ desired output impedance in &#x2126;<br> ___Z<sub>out</sub>___ desired output impedance in &#x2126;<br>
___Z<sub>in</sub> = Z<sub>out</sub>___ ___Z<sub>in</sub> = Z<sub>out</sub>___

View File

@ -1,5 +1,5 @@
// Do not edit this file, it is autogenerated by CMake from the .md file // Do not edit this file, it is autogenerated by CMake from the .md file
_HKI( "## Tee attenuator\n" _HKI( "### Tee attenuator\n"
"__Zin__ desired input impedance in &#x2126;<br>\n" "__Zin__ desired input impedance in &#x2126;<br>\n"
"__Zout__ desired output impedance<br>\n" "__Zout__ desired output impedance<br>\n"
"__Zin = Zout__<br><br>\n" "__Zin = Zout__<br><br>\n"

View File

@ -1,4 +1,4 @@
## Tee attenuator ### Tee attenuator
__Zin__ desired input impedance in &#x2126;<br> __Zin__ desired input impedance in &#x2126;<br>
__Zout__ desired output impedance<br> __Zout__ desired output impedance<br>
__Zin = Zout__<br><br> __Zin = Zout__<br><br>

View File

@ -1,5 +1,5 @@
/* XPM */ /* XPM */
const static char *via_xpm[] = { const static char *via_dims_xpm[] = {
"175 176 874 2", "175 176 874 2",
" c None", " c None",
". c #FFFFFF", ". c #FFFFFF",

View File

@ -130,8 +130,5 @@ void PCB_CALCULATOR_FRAME::BoardClassesUpdateData( double aUnitScale )
txt = NOVAL; txt = NOVAL;
m_gridClassesValuesDisplay->SetCellValue(4, ii, txt ); m_gridClassesValuesDisplay->SetCellValue(4, ii, txt );
} }
m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
m_gridClassesValuesDisplay->AutoSize();
} }

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application. * This program source code file is part of KICAD, a free EDA CAD application.
* *
* Copyright (C) 2011 jean-pierre.charras * Copyright (C) 2011 jean-pierre.charras
* Copyright (C) 2011 Kicad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2011-2021 Kicad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -19,10 +19,22 @@
*/ */
#include <wx/app.h> #include <wx/app.h>
#include <wx/msgdlg.h> #include "bitmaps/color_code_value_and_name.xpm"
#include "bitmaps/color_code_value.xpm"
#include "bitmaps/color_code_multiplier.xpm"
#include "bitmaps/color_code_tolerance.xpm"
#include "pcb_calculator_frame.h" #include "pcb_calculator_frame.h"
void PCB_CALCULATOR_FRAME::initColorCodePanel()
{
m_ccValueNamesBitmap = new wxBitmap( color_code_value_and_name_xpm );
m_ccValuesBitmap = new wxBitmap( color_code_value_xpm );
m_ccMultipliersBitmap = new wxBitmap( color_code_multiplier_xpm );
m_ccTolerancesBitmap = new wxBitmap( color_code_tolerance_xpm );
}
void PCB_CALCULATOR_FRAME::OnToleranceSelection( wxCommandEvent& event ) void PCB_CALCULATOR_FRAME::OnToleranceSelection( wxCommandEvent& event )
{ {
ToleranceSelection( event.GetSelection() ); ToleranceSelection( event.GetSelection() );
@ -34,27 +46,22 @@ void PCB_CALCULATOR_FRAME::ToleranceSelection( int aSelection )
/* For tolerance = 5 or 10 %, there are 3 bands for the value /* For tolerance = 5 or 10 %, there are 3 bands for the value
* but for tolerance < 5 %, there are 4 bands * but for tolerance < 5 %, there are 4 bands
*/ */
bool show4thBand; bool show4thBand = aSelection != 0;
switch( aSelection )
{
case 0: // 5 or 10 %
show4thBand = false;
break;
case 1: // < 5 %
show4thBand = true;
break;
default: // Show 4th band if something went wrong
show4thBand = true;
break;
}
bool oldstate = m_Band4Label->IsShown();
if( oldstate != show4thBand )
{
m_Band4bitmap->Show(show4thBand); m_Band4bitmap->Show(show4thBand);
m_Band4Label->Show(show4thBand); m_Band4Label->Show(show4thBand);
// m_Band4Label visibility has changed: // m_Band4Label visibility has changed:
// The new size must be taken in account // The new size must be taken in account
m_panelColorCode->GetSizer()->Layout(); m_panelColorCode->GetSizer()->Layout();
// All this shouldn't be necessary but if you want the bitmaps to show up on OSX it is.
m_Band1bitmap->SetBitmap( *m_ccValueNamesBitmap );
m_Band2bitmap->SetBitmap( *m_ccValuesBitmap );
m_Band3bitmap->SetBitmap( *m_ccValuesBitmap );
m_Band4bitmap->SetBitmap( *m_ccValuesBitmap );
m_Band_mult_bitmap->SetBitmap( *m_ccMultipliersBitmap );
m_Band_tol_bitmap->SetBitmap( *m_ccTolerancesBitmap );
m_panelColorCode->Refresh(); m_panelColorCode->Refresh();
} }
}

View File

@ -11,7 +11,6 @@
#include "../bitmaps/regul.xpm" #include "../bitmaps/regul.xpm"
#include "../bitmaps/regul_3pins.xpm" #include "../bitmaps/regul_3pins.xpm"
#include "../bitmaps/via.xpm"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -170,7 +169,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
fgSizerRegParams->Add( 0, 0, 1, wxEXPAND, 5 ); fgSizerRegParams->Add( 0, 0, 1, wxEXPAND, 5 );
bSizerRegulRight->Add( fgSizerRegParams, 0, wxEXPAND|wxALL, 5 ); bSizerRegulRight->Add( fgSizerRegParams, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
wxBoxSizer* bSizerRegulButtonCalcReset; wxBoxSizer* bSizerRegulButtonCalcReset;
bSizerRegulButtonCalcReset = new wxBoxSizer( wxHORIZONTAL ); bSizerRegulButtonCalcReset = new wxBoxSizer( wxHORIZONTAL );
@ -199,7 +198,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
wxArrayString m_choiceRegulatorSelectorChoices; wxArrayString m_choiceRegulatorSelectorChoices;
m_choiceRegulatorSelector = new wxChoice( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegulatorSelectorChoices, 0 ); m_choiceRegulatorSelector = new wxChoice( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegulatorSelectorChoices, 0 );
m_choiceRegulatorSelector->SetSelection( 0 ); m_choiceRegulatorSelector->SetSelection( 0 );
sbSizerRegulatorsChooser->Add( m_choiceRegulatorSelector, 0, wxALL|wxEXPAND, 5 ); sbSizerRegulatorsChooser->Add( m_choiceRegulatorSelector, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticTextRegFile = new wxStaticText( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Regulators data file:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRegFile = new wxStaticText( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Regulators data file:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRegFile->Wrap( -1 ); m_staticTextRegFile->Wrap( -1 );
@ -241,14 +240,14 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
sbSizerRegulatorsChooser->Add( bSizerReulBtn, 1, wxEXPAND, 5 ); sbSizerRegulatorsChooser->Add( bSizerReulBtn, 1, wxEXPAND, 5 );
bSizerRegulRight->Add( sbSizerRegulatorsChooser, 0, wxEXPAND|wxRIGHT, 5 ); bSizerRegulRight->Add( sbSizerRegulatorsChooser, 0, wxEXPAND|wxRIGHT, 10 );
m_RegulMessage = new wxStaticText( m_panelRegulators, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_RegulMessage = new wxStaticText( m_panelRegulators, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_RegulMessage->Wrap( -1 ); m_RegulMessage->Wrap( -1 );
bSizerRegulRight->Add( m_RegulMessage, 0, wxALL, 5 ); bSizerRegulRight->Add( m_RegulMessage, 0, wxALL, 5 );
bSizerMainReg->Add( bSizerRegulRight, 1, wxEXPAND|wxTOP|wxLEFT, 5 ); bSizerMainReg->Add( bSizerRegulRight, 1, wxEXPAND|wxTOP|wxLEFT, 10 );
m_panelRegulators->SetSizer( bSizerMainReg ); m_panelRegulators->SetSizer( bSizerMainReg );
@ -1138,11 +1137,14 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
wxBoxSizer* bSizerViaSize; wxBoxSizer* bSizerViaSize;
bSizerViaSize = new wxBoxSizer( wxHORIZONTAL ); bSizerViaSize = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerViaLeftColumn;
bSizerViaLeftColumn = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerVS_Inputs; wxStaticBoxSizer* sbSizerVS_Inputs;
sbSizerVS_Inputs = new wxStaticBoxSizer( new wxStaticBox( m_panelViaSize, wxID_ANY, _("Parameters") ), wxVERTICAL ); sbSizerVS_Inputs = new wxStaticBoxSizer( new wxStaticBox( m_panelViaSize, wxID_ANY, _("Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerVS_Inputs; wxFlexGridSizer* fgSizerVS_Inputs;
fgSizerVS_Inputs = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizerVS_Inputs = new wxFlexGridSizer( 0, 3, 4, 0 );
fgSizerVS_Inputs->AddGrowableCol( 1 ); fgSizerVS_Inputs->AddGrowableCol( 1 );
fgSizerVS_Inputs->SetFlexibleDirection( wxBOTH ); fgSizerVS_Inputs->SetFlexibleDirection( wxBOTH );
fgSizerVS_Inputs->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizerVS_Inputs->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@ -1154,24 +1156,24 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
fgSizerVS_Inputs->Add( m_staticTextHoleDia, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 ); fgSizerVS_Inputs->Add( m_staticTextHoleDia, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_textCtrlHoleDia = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlHoleDia = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlHoleDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlHoleDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choiceHoleDiaChoices; wxArrayString m_choiceHoleDiaChoices;
m_choiceHoleDia = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHoleDiaChoices, 0 ); m_choiceHoleDia = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHoleDiaChoices, 0 );
m_choiceHoleDia->SetSelection( 0 ); m_choiceHoleDia->SetSelection( 0 );
fgSizerVS_Inputs->Add( m_choiceHoleDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_choiceHoleDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextPlatingThickness = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Plating thickness (T):"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextPlatingThickness = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Plating thickness (T):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPlatingThickness->Wrap( -1 ); m_staticTextPlatingThickness->Wrap( -1 );
fgSizerVS_Inputs->Add( m_staticTextPlatingThickness, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 ); fgSizerVS_Inputs->Add( m_staticTextPlatingThickness, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
m_textCtrlPlatingThickness = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlPlatingThickness = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlPlatingThickness, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizerVS_Inputs->Add( m_textCtrlPlatingThickness, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choicePlatingThicknessChoices; wxArrayString m_choicePlatingThicknessChoices;
m_choicePlatingThickness = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePlatingThicknessChoices, 0 ); m_choicePlatingThickness = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePlatingThicknessChoices, 0 );
m_choicePlatingThickness->SetSelection( 0 ); m_choicePlatingThickness->SetSelection( 0 );
fgSizerVS_Inputs->Add( m_choicePlatingThickness, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizerVS_Inputs->Add( m_choicePlatingThickness, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextViaLength = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Via length:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextViaLength = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Via length:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextViaLength->Wrap( -1 ); m_staticTextViaLength->Wrap( -1 );
@ -1180,12 +1182,12 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
fgSizerVS_Inputs->Add( m_staticTextViaLength, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 ); fgSizerVS_Inputs->Add( m_staticTextViaLength, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_textCtrlViaLength = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlViaLength = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlViaLength, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlViaLength, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choiceViaLengthChoices; wxArrayString m_choiceViaLengthChoices;
m_choiceViaLength = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceViaLengthChoices, 0 ); m_choiceViaLength = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceViaLengthChoices, 0 );
m_choiceViaLength->SetSelection( 0 ); m_choiceViaLength->SetSelection( 0 );
fgSizerVS_Inputs->Add( m_choiceViaLength, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_choiceViaLength, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextViaPadDia = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Via pad diameter:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextViaPadDia = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Via pad diameter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextViaPadDia->Wrap( -1 ); m_staticTextViaPadDia->Wrap( -1 );
@ -1194,12 +1196,12 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
fgSizerVS_Inputs->Add( m_staticTextViaPadDia, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 ); fgSizerVS_Inputs->Add( m_staticTextViaPadDia, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_textCtrlViaPadDia = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlViaPadDia = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlViaPadDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlViaPadDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choiceViaPadDiaChoices; wxArrayString m_choiceViaPadDiaChoices;
m_choiceViaPadDia = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceViaPadDiaChoices, 0 ); m_choiceViaPadDia = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceViaPadDiaChoices, 0 );
m_choiceViaPadDia->SetSelection( 0 ); m_choiceViaPadDia->SetSelection( 0 );
fgSizerVS_Inputs->Add( m_choiceViaPadDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_choiceViaPadDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextClearanceDia = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Clearance hole diameter:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextClearanceDia = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Clearance hole diameter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextClearanceDia->Wrap( -1 ); m_staticTextClearanceDia->Wrap( -1 );
@ -1208,12 +1210,12 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
fgSizerVS_Inputs->Add( m_staticTextClearanceDia, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 ); fgSizerVS_Inputs->Add( m_staticTextClearanceDia, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_textCtrlClearanceDia = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlClearanceDia = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlClearanceDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlClearanceDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choiceClearanceDiaChoices; wxArrayString m_choiceClearanceDiaChoices;
m_choiceClearanceDia = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceClearanceDiaChoices, 0 ); m_choiceClearanceDia = new UNIT_SELECTOR_LEN( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceClearanceDiaChoices, 0 );
m_choiceClearanceDia->SetSelection( 0 ); m_choiceClearanceDia->SetSelection( 0 );
fgSizerVS_Inputs->Add( m_choiceClearanceDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_choiceClearanceDia, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextImpedance = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Z0:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextImpedance = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Z0:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextImpedance->Wrap( -1 ); m_staticTextImpedance->Wrap( -1 );
@ -1222,86 +1224,107 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
fgSizerVS_Inputs->Add( m_staticTextImpedance, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 ); fgSizerVS_Inputs->Add( m_staticTextImpedance, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_textCtrlImpedance = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlImpedance = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlImpedance, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlImpedance, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choiceImpedanceChoices; wxArrayString m_choiceImpedanceChoices;
m_choiceImpedance = new UNIT_SELECTOR_RESISTOR( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceImpedanceChoices, 0 ); m_choiceImpedance = new UNIT_SELECTOR_RESISTOR( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceImpedanceChoices, 0 );
m_choiceImpedance->SetSelection( 0 ); m_choiceImpedance->SetSelection( 0 );
fgSizerVS_Inputs->Add( m_choiceImpedance, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_choiceImpedance, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticAppliedCurrent = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Applied current:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticAppliedCurrent = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Applied current:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticAppliedCurrent->Wrap( -1 ); m_staticAppliedCurrent->Wrap( -1 );
fgSizerVS_Inputs->Add( m_staticAppliedCurrent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 ); fgSizerVS_Inputs->Add( m_staticAppliedCurrent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_textCtrlAppliedCurrent = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlAppliedCurrent = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlAppliedCurrent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlAppliedCurrent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextAppliedCurrentUnits = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("A"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextAppliedCurrentUnits = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("A"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextAppliedCurrentUnits->Wrap( -1 ); m_staticTextAppliedCurrentUnits->Wrap( -1 );
fgSizerVS_Inputs->Add( m_staticTextAppliedCurrentUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextAppliedCurrentUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextResistivity = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Plating resistivity (Ohm.m):"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextResistivity = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Plating resistivity (Ohm.m):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextResistivity->Wrap( -1 ); m_staticTextResistivity->Wrap( -1 );
m_staticTextResistivity->SetToolTip( _("Specific resistance in ohms * meters") ); m_staticTextResistivity->SetToolTip( _("Specific resistance in ohms * meters") );
fgSizerVS_Inputs->Add( m_staticTextResistivity, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextResistivity, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
m_textCtrlPlatingResistivity = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlPlatingResistivity = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlPlatingResistivity, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlPlatingResistivity, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_button_ResistivityVia = new wxButton( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); m_button_ResistivityVia = new wxButton( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
fgSizerVS_Inputs->Add( m_button_ResistivityVia, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_button_ResistivityVia, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextPermittivity = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Er:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextPermittivity = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Er:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPermittivity->Wrap( -1 ); m_staticTextPermittivity->Wrap( -1 );
m_staticTextPermittivity->SetToolTip( _("Relative dielectric constant (epsilon r)") ); m_staticTextPermittivity->SetToolTip( _("Relative dielectric constant (epsilon r)") );
fgSizerVS_Inputs->Add( m_staticTextPermittivity, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextPermittivity, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
m_textCtrlPlatingPermittivity = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlPlatingPermittivity = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlPlatingPermittivity, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlPlatingPermittivity, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_button_Permittivity = new wxButton( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); m_button_Permittivity = new wxButton( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
fgSizerVS_Inputs->Add( m_button_Permittivity, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_button_Permittivity, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextTemperatureDiff = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Temperature rise:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTemperatureDiff = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Temperature rise:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTemperatureDiff->Wrap( -1 ); m_staticTextTemperatureDiff->Wrap( -1 );
m_staticTextTemperatureDiff->SetToolTip( _("Maximum acceptable rise in temperature") ); m_staticTextTemperatureDiff->SetToolTip( _("Maximum acceptable rise in temperature") );
fgSizerVS_Inputs->Add( m_staticTextTemperatureDiff, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextTemperatureDiff, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
m_textCtrlTemperatureDiff = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlTemperatureDiff = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlTemperatureDiff, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlTemperatureDiff, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextTemperatureUnits = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("deg C"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTemperatureUnits = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("deg C"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTemperatureUnits->Wrap( -1 ); m_staticTextTemperatureUnits->Wrap( -1 );
fgSizerVS_Inputs->Add( m_staticTextTemperatureUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextTemperatureUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextRiseTime = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Pulse rise time:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRiseTime = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("Pulse rise time:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRiseTime->Wrap( -1 ); m_staticTextRiseTime->Wrap( -1 );
m_staticTextRiseTime->SetToolTip( _("Pulse rise time to calculate reactance") ); m_staticTextRiseTime->SetToolTip( _("Pulse rise time to calculate reactance") );
fgSizerVS_Inputs->Add( m_staticTextRiseTime, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextRiseTime, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
m_textCtrlRiseTime = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlRiseTime = new wxTextCtrl( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerVS_Inputs->Add( m_textCtrlRiseTime, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizerVS_Inputs->Add( m_textCtrlRiseTime, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticTextRiseTimeUnits = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("ns"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRiseTimeUnits = new wxStaticText( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, _("ns"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRiseTimeUnits->Wrap( -1 ); m_staticTextRiseTimeUnits->Wrap( -1 );
m_staticTextRiseTimeUnits->SetToolTip( _("nanoseconds") ); m_staticTextRiseTimeUnits->SetToolTip( _("nanoseconds") );
fgSizerVS_Inputs->Add( m_staticTextRiseTimeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerVS_Inputs->Add( m_staticTextRiseTimeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
sbSizerVS_Inputs->Add( fgSizerVS_Inputs, 0, wxEXPAND, 5 ); sbSizerVS_Inputs->Add( fgSizerVS_Inputs, 0, wxEXPAND, 5 );
m_bitmap10 = new wxStaticBitmap( sbSizerVS_Inputs->GetStaticBox(), wxID_ANY, wxBitmap( via_xpm ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap10->SetToolTip( _("Top view of via") );
sbSizerVS_Inputs->Add( m_bitmap10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); bSizerViaLeftColumn->Add( sbSizerVS_Inputs, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_panelViaBitmap = new wxPanel( m_panelViaSize, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelViaBitmap->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNHIGHLIGHT ) );
wxBoxSizer* bSizer143;
bSizer143 = new wxBoxSizer( wxVERTICAL );
bSizerViaSize->Add( sbSizerVS_Inputs, 1, wxEXPAND|wxALL, 5 ); bSizer143->Add( 0, 0, 1, wxEXPAND, 5 );
m_viaBitmap = new wxStaticBitmap( m_panelViaBitmap, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_viaBitmap->SetToolTip( _("Top view of via") );
bSizer143->Add( m_viaBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10 );
bSizer143->Add( 0, 0, 1, wxEXPAND, 5 );
m_panelViaBitmap->SetSizer( bSizer143 );
m_panelViaBitmap->Layout();
bSizer143->Fit( m_panelViaBitmap );
bSizerViaLeftColumn->Add( m_panelViaBitmap, 1, wxEXPAND | wxALL, 8 );
bSizerViaSize->Add( bSizerViaLeftColumn, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerRight; wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL ); bSizerRight = new wxBoxSizer( wxVERTICAL );
@ -1312,6 +1335,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
wxFlexGridSizer* fgSizerTW_Results11; wxFlexGridSizer* fgSizerTW_Results11;
fgSizerTW_Results11 = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizerTW_Results11 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizerTW_Results11->AddGrowableCol( 1 ); fgSizerTW_Results11->AddGrowableCol( 1 );
fgSizerTW_Results11->AddGrowableCol( 2 );
fgSizerTW_Results11->SetFlexibleDirection( wxBOTH ); fgSizerTW_Results11->SetFlexibleDirection( wxBOTH );
fgSizerTW_Results11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizerTW_Results11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@ -1447,7 +1471,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_staticTextWarning->Wrap( -1 ); m_staticTextWarning->Wrap( -1 );
m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
sbSizerVS_Result->Add( m_staticTextWarning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); sbSizerVS_Result->Add( m_staticTextWarning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bSizerRight->Add( sbSizerVS_Result, 1, wxEXPAND|wxALL, 5 ); bSizerRight->Add( sbSizerVS_Result, 1, wxEXPAND|wxALL, 5 );
@ -1532,8 +1556,8 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
bSizeLeft->Add( sbSizerTW_Prms, 0, wxALL|wxEXPAND, 5 ); bSizeLeft->Add( sbSizerTW_Prms, 0, wxALL|wxEXPAND, 5 );
m_htmlWinFormulas = new wxHtmlWindow( m_panelTrackWidth, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_NO_SELECTION|wxHW_SCROLLBAR_AUTO|wxBORDER_SIMPLE ); m_htmlWinFormulas = new wxHtmlWindow( m_panelTrackWidth, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_NO_SELECTION|wxHW_SCROLLBAR_AUTO );
bSizeLeft->Add( m_htmlWinFormulas, 1, wxEXPAND|wxLEFT|wxTOP, 5 ); bSizeLeft->Add( m_htmlWinFormulas, 1, wxEXPAND|wxALL, 8 );
bSizerTrackWidth->Add( bSizeLeft, 1, wxEXPAND, 5 ); bSizerTrackWidth->Add( bSizeLeft, 1, wxEXPAND, 5 );
@ -1749,23 +1773,23 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
wxArrayString m_ElectricalSpacingUnitsSelectorChoices; wxArrayString m_ElectricalSpacingUnitsSelectorChoices;
m_ElectricalSpacingUnitsSelector = new UNIT_SELECTOR_LEN( m_panelElectricalSpacing, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ElectricalSpacingUnitsSelectorChoices, 0 ); m_ElectricalSpacingUnitsSelector = new UNIT_SELECTOR_LEN( m_panelElectricalSpacing, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ElectricalSpacingUnitsSelectorChoices, 0 );
m_ElectricalSpacingUnitsSelector->SetSelection( -1 ); m_ElectricalSpacingUnitsSelector->SetSelection( -1 );
bLeftSizerElectricalClearance->Add( m_ElectricalSpacingUnitsSelector, 0, wxALL|wxEXPAND, 5 ); bLeftSizerElectricalClearance->Add( m_ElectricalSpacingUnitsSelector, 0, wxEXPAND|wxTOP|wxBOTTOM, 20 );
m_staticline2 = new wxStaticLine( m_panelElectricalSpacing, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline2 = new wxStaticLine( m_panelElectricalSpacing, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLeftSizerElectricalClearance->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); bLeftSizerElectricalClearance->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_staticText891 = new wxStaticText( m_panelElectricalSpacing, wxID_ANY, _("Voltage > 500V:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText891 = new wxStaticText( m_panelElectricalSpacing, wxID_ANY, _("Voltage > 500V:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText891->Wrap( -1 ); m_staticText891->Wrap( -1 );
bLeftSizerElectricalClearance->Add( m_staticText891, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bLeftSizerElectricalClearance->Add( m_staticText891, 0, wxTOP, 5 );
m_ElectricalSpacingVoltage = new wxTextCtrl( m_panelElectricalSpacing, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_ElectricalSpacingVoltage = new wxTextCtrl( m_panelElectricalSpacing, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizerElectricalClearance->Add( m_ElectricalSpacingVoltage, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bLeftSizerElectricalClearance->Add( m_ElectricalSpacingVoltage, 0, wxEXPAND|wxBOTTOM, 5 );
m_buttonElectSpacingRefresh = new wxButton( m_panelElectricalSpacing, wxID_ANY, _("Update Values"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonElectSpacingRefresh = new wxButton( m_panelElectricalSpacing, wxID_ANY, _("Update Values"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizerElectricalClearance->Add( m_buttonElectSpacingRefresh, 0, wxALL|wxEXPAND, 5 ); bLeftSizerElectricalClearance->Add( m_buttonElectSpacingRefresh, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
bSizerElectricalClearance->Add( bLeftSizerElectricalClearance, 0, wxEXPAND, 5 ); bSizerElectricalClearance->Add( bLeftSizerElectricalClearance, 0, wxEXPAND|wxALL, 10 );
wxBoxSizer* bElectricalSpacingSizerRight; wxBoxSizer* bElectricalSpacingSizerRight;
bElectricalSpacingSizerRight = new wxBoxSizer( wxVERTICAL ); bElectricalSpacingSizerRight = new wxBoxSizer( wxVERTICAL );
@ -1786,6 +1810,13 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_gridElectricalSpacingValues->SetMargins( 0, 0 ); m_gridElectricalSpacingValues->SetMargins( 0, 0 );
// Columns // Columns
m_gridElectricalSpacingValues->SetColSize( 0, 100 );
m_gridElectricalSpacingValues->SetColSize( 1, 100 );
m_gridElectricalSpacingValues->SetColSize( 2, 100 );
m_gridElectricalSpacingValues->SetColSize( 3, 100 );
m_gridElectricalSpacingValues->SetColSize( 4, 100 );
m_gridElectricalSpacingValues->SetColSize( 5, 100 );
m_gridElectricalSpacingValues->SetColSize( 6, 100 );
m_gridElectricalSpacingValues->EnableDragColMove( false ); m_gridElectricalSpacingValues->EnableDragColMove( false );
m_gridElectricalSpacingValues->EnableDragColSize( true ); m_gridElectricalSpacingValues->EnableDragColSize( true );
m_gridElectricalSpacingValues->SetColLabelSize( 30 ); m_gridElectricalSpacingValues->SetColLabelSize( 30 );
@ -1799,18 +1830,27 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_gridElectricalSpacingValues->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_gridElectricalSpacingValues->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows // Rows
m_gridElectricalSpacingValues->AutoSizeRows(); m_gridElectricalSpacingValues->SetRowSize( 0, 24 );
m_gridElectricalSpacingValues->SetRowSize( 1, 24 );
m_gridElectricalSpacingValues->SetRowSize( 2, 24 );
m_gridElectricalSpacingValues->SetRowSize( 3, 24 );
m_gridElectricalSpacingValues->SetRowSize( 4, 24 );
m_gridElectricalSpacingValues->SetRowSize( 5, 24 );
m_gridElectricalSpacingValues->SetRowSize( 6, 24 );
m_gridElectricalSpacingValues->SetRowSize( 7, 24 );
m_gridElectricalSpacingValues->SetRowSize( 8, 24 );
m_gridElectricalSpacingValues->SetRowSize( 9, 24 );
m_gridElectricalSpacingValues->EnableDragRowSize( false ); m_gridElectricalSpacingValues->EnableDragRowSize( false );
m_gridElectricalSpacingValues->SetRowLabelSize( 100 ); m_gridElectricalSpacingValues->SetRowLabelSize( 100 );
m_gridElectricalSpacingValues->SetRowLabelValue( 0, _("0 ... 15V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 0, _("0 .. 15V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 1, _("16 ... 30V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 1, _("16 .. 30V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 2, _("31 ... 50V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 2, _("31 .. 50V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 3, _("51 ... 100V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 3, _("51 .. 100V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 4, _("101 ... 150V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 4, _("101 .. 150V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 5, _("151 ... 170V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 5, _("151 .. 170V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 6, _("171 ... 250V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 6, _("171 .. 250V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 7, _("251 ... 300V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 7, _("251 .. 300V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 8, _("301 ... 500V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 8, _("301 .. 500V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 9, _(" > 500V") ); m_gridElectricalSpacingValues->SetRowLabelValue( 9, _(" > 500V") );
m_gridElectricalSpacingValues->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER ); m_gridElectricalSpacingValues->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
@ -1818,14 +1858,14 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
// Cell Defaults // Cell Defaults
m_gridElectricalSpacingValues->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP ); m_gridElectricalSpacingValues->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
bElectricalSpacingSizerRight->Add( m_gridElectricalSpacingValues, 0, wxALL|wxEXPAND, 5 ); bElectricalSpacingSizerRight->Add( m_gridElectricalSpacingValues, 0, wxALL, 5 );
m_staticText88 = new wxStaticText( m_panelElectricalSpacing, wxID_ANY, _("* B1 - Internal Conductors\n* B2 - External Conductors, uncoated, sea level to 3050 m\n* B3 - External Conductors, uncoated, over 3050 m\n* B4 - External Conductors, with permanent polymer coating (any elevation)\n* A5 - External Conductors, with conformal coating over assembly (any elevation)\n* A6 - External Component lead/termination, uncoated\n* A7 - External Component lead termination, with conformal coating (any elevation)"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText88 = new wxStaticText( m_panelElectricalSpacing, wxID_ANY, _("* B1 - Internal Conductors\n* B2 - External Conductors, uncoated, sea level to 3050 m\n* B3 - External Conductors, uncoated, over 3050 m\n* B4 - External Conductors, with permanent polymer coating (any elevation)\n* A5 - External Conductors, with conformal coating over assembly (any elevation)\n* A6 - External Component lead/termination, uncoated\n* A7 - External Component lead termination, with conformal coating (any elevation)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText88->Wrap( -1 ); m_staticText88->Wrap( -1 );
bElectricalSpacingSizerRight->Add( m_staticText88, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bElectricalSpacingSizerRight->Add( m_staticText88, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerElectricalClearance->Add( bElectricalSpacingSizerRight, 1, wxEXPAND, 5 ); bSizerElectricalClearance->Add( bElectricalSpacingSizerRight, 1, wxEXPAND|wxLEFT, 20 );
m_panelElectricalSpacing->SetSizer( bSizerElectricalClearance ); m_panelElectricalSpacing->SetSizer( bSizerElectricalClearance );
@ -1836,10 +1876,16 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
wxBoxSizer* bSizerBoardClass; wxBoxSizer* bSizerBoardClass;
bSizerBoardClass = new wxBoxSizer( wxHORIZONTAL ); bSizerBoardClass = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerUnitsMargins;
bSizerUnitsMargins = new wxBoxSizer( wxVERTICAL );
wxArrayString m_BoardClassesUnitsSelectorChoices; wxArrayString m_BoardClassesUnitsSelectorChoices;
m_BoardClassesUnitsSelector = new UNIT_SELECTOR_LEN( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_BoardClassesUnitsSelectorChoices, 0 ); m_BoardClassesUnitsSelector = new UNIT_SELECTOR_LEN( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_BoardClassesUnitsSelectorChoices, 0 );
m_BoardClassesUnitsSelector->SetSelection( 0 ); m_BoardClassesUnitsSelector->SetSelection( 0 );
bSizerBoardClass->Add( m_BoardClassesUnitsSelector, 0, wxALL, 5 ); bSizerUnitsMargins->Add( m_BoardClassesUnitsSelector, 0, wxTOP|wxBOTTOM|wxRIGHT, 32 );
bSizerBoardClass->Add( bSizerUnitsMargins, 0, wxLEFT, 10 );
wxBoxSizer* brdclsSizerRight; wxBoxSizer* brdclsSizerRight;
brdclsSizerRight = new wxBoxSizer( wxVERTICAL ); brdclsSizerRight = new wxBoxSizer( wxVERTICAL );
@ -1860,9 +1906,15 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_gridClassesValuesDisplay->SetMargins( 0, 0 ); m_gridClassesValuesDisplay->SetMargins( 0, 0 );
// Columns // Columns
m_gridClassesValuesDisplay->SetColSize( 0, 100 );
m_gridClassesValuesDisplay->SetColSize( 1, 100 );
m_gridClassesValuesDisplay->SetColSize( 2, 100 );
m_gridClassesValuesDisplay->SetColSize( 3, 100 );
m_gridClassesValuesDisplay->SetColSize( 4, 100 );
m_gridClassesValuesDisplay->SetColSize( 5, 100 );
m_gridClassesValuesDisplay->EnableDragColMove( false ); m_gridClassesValuesDisplay->EnableDragColMove( false );
m_gridClassesValuesDisplay->EnableDragColSize( true ); m_gridClassesValuesDisplay->EnableDragColSize( true );
m_gridClassesValuesDisplay->SetColLabelSize( 70 ); m_gridClassesValuesDisplay->SetColLabelSize( 30 );
m_gridClassesValuesDisplay->SetColLabelValue( 0, _("Class 1") ); m_gridClassesValuesDisplay->SetColLabelValue( 0, _("Class 1") );
m_gridClassesValuesDisplay->SetColLabelValue( 1, _("Class 2") ); m_gridClassesValuesDisplay->SetColLabelValue( 1, _("Class 2") );
m_gridClassesValuesDisplay->SetColLabelValue( 2, _("Class 3") ); m_gridClassesValuesDisplay->SetColLabelValue( 2, _("Class 3") );
@ -1872,7 +1924,11 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_gridClassesValuesDisplay->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_gridClassesValuesDisplay->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows // Rows
m_gridClassesValuesDisplay->AutoSizeRows(); m_gridClassesValuesDisplay->SetRowSize( 0, 24 );
m_gridClassesValuesDisplay->SetRowSize( 1, 24 );
m_gridClassesValuesDisplay->SetRowSize( 2, 24 );
m_gridClassesValuesDisplay->SetRowSize( 3, 24 );
m_gridClassesValuesDisplay->SetRowSize( 4, 24 );
m_gridClassesValuesDisplay->EnableDragRowSize( false ); m_gridClassesValuesDisplay->EnableDragRowSize( false );
m_gridClassesValuesDisplay->SetRowLabelSize( 160 ); m_gridClassesValuesDisplay->SetRowLabelSize( 160 );
m_gridClassesValuesDisplay->SetRowLabelValue( 0, _("Lines width") ); m_gridClassesValuesDisplay->SetRowLabelValue( 0, _("Lines width") );

View File

@ -490,7 +490,7 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property> <property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
@ -500,7 +500,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property> <property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1"> <object class="wxFlexGridSizer" expanded="1">
<property name="cols">4</property> <property name="cols">4</property>
@ -1992,7 +1992,7 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">10</property>
<property name="flag">wxEXPAND|wxRIGHT</property> <property name="flag">wxEXPAND|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
@ -2005,7 +2005,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -12615,11 +12615,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="notebookpage" expanded="0"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Via Size</property> <property name="label">Via Size</property>
<property name="select">0</property> <property name="select">0</property>
<object class="wxPanel" expanded="0"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -12670,16 +12670,25 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerViaSize</property> <property name="name">bSizerViaSize</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerViaLeftColumn</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Parameters</property> <property name="label">Parameters</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -12702,7 +12711,7 @@
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property> <property name="permission">none</property>
<property name="rows">0</property> <property name="rows">0</property>
<property name="vgap">0</property> <property name="vgap">4</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT</property>
@ -12766,7 +12775,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -12831,7 +12840,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -12957,7 +12966,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13022,7 +13031,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13148,7 +13157,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13213,7 +13222,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13339,7 +13348,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13404,7 +13413,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13530,7 +13539,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13595,7 +13604,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13721,7 +13730,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13786,7 +13795,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13912,7 +13921,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -13977,7 +13986,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14038,7 +14047,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14099,7 +14108,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14164,7 +14173,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14237,7 +14246,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14298,7 +14307,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14363,7 +14372,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14436,7 +14445,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14497,7 +14506,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14562,7 +14571,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14623,7 +14632,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14684,7 +14693,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14749,7 +14758,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -14810,11 +14819,13 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> </object>
<property name="border">5</property> </object>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property> <object class="sizeritem" expanded="1">
<property name="proportion">0</property> <property name="border">8</property>
<object class="wxStaticBitmap" expanded="0"> <property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -14824,8 +14835,7 @@
<property name="aui_position"></property> <property name="aui_position"></property>
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg">wxSYS_COLOUR_BTNHIGHLIGHT</property>
<property name="bitmap">Load From File; ../bitmaps/via.xpm</property>
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
@ -14850,7 +14860,78 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_bitmap10</property> <property name="name">m_panelViaBitmap</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer143</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_viaBitmap</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -14868,6 +14949,19 @@
<property name="window_style"></property> <property name="window_style"></property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>
</object>
</object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -14898,7 +14992,7 @@
<object class="wxFlexGridSizer" expanded="0"> <object class="wxFlexGridSizer" expanded="0">
<property name="cols">3</property> <property name="cols">3</property>
<property name="flexible_direction">wxBOTH</property> <property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property> <property name="growablecols">1,2</property>
<property name="growablerows"></property> <property name="growablerows"></property>
<property name="hgap">0</property> <property name="hgap">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -16568,7 +16662,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -17562,8 +17656,8 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">8</property>
<property name="flag">wxEXPAND|wxLEFT|wxTOP</property> <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="0"> <object class="wxHtmlWindow" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -17616,7 +17710,7 @@
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxBORDER_SIMPLE</property> <property name="window_style"></property>
</object> </object>
</object> </object>
</object> </object>
@ -20174,11 +20268,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="notebookpage" expanded="0"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Electrical Spacing</property> <property name="label">Electrical Spacing</property>
<property name="select">0</property> <property name="select">0</property>
<object class="wxPanel" expanded="0"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -20229,23 +20323,23 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerElectricalClearance</property> <property name="name">bSizerElectricalClearance</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">10</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bLeftSizerElectricalClearance</property> <property name="name">bLeftSizerElectricalClearance</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">20</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20310,7 +20404,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticLine" expanded="0"> <object class="wxStaticLine" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20368,7 +20462,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxTOP</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20429,7 +20523,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20493,7 +20587,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20566,11 +20660,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">20</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bElectricalSpacingSizerRight</property> <property name="name">bElectricalSpacingSizerRight</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
@ -20638,7 +20732,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxGrid" expanded="0"> <object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20650,7 +20744,7 @@
<property name="aui_position"></property> <property name="aui_position"></property>
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="autosize_cols">0</property> <property name="autosize_cols">0</property>
<property name="autosize_rows">1</property> <property name="autosize_rows">0</property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg"></property>
<property name="caption"></property> <property name="caption"></property>
@ -20667,7 +20761,7 @@
<property name="col_label_values">&quot;B1&quot; &quot;B2&quot; &quot;B3&quot; &quot;B4&quot; &quot;A5&quot; &quot;A6&quot; &quot;A7&quot;</property> <property name="col_label_values">&quot;B1&quot; &quot;B2&quot; &quot;B3&quot; &quot;B4&quot; &quot;A5&quot; &quot;A6&quot; &quot;A7&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property> <property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">7</property> <property name="cols">7</property>
<property name="column_sizes"></property> <property name="column_sizes">100,100,100,100,100,100,100</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
@ -20710,9 +20804,9 @@
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_RIGHT</property> <property name="row_label_horiz_alignment">wxALIGN_RIGHT</property>
<property name="row_label_size">100</property> <property name="row_label_size">100</property>
<property name="row_label_values">&quot;0 ... 15V&quot; &quot;16 ... 30V&quot; &quot;31 ... 50V&quot; &quot;51 ... 100V&quot; &quot;101 ... 150V&quot; &quot;151 ... 170V&quot; &quot;171 ... 250V&quot; &quot;251 ... 300V&quot; &quot;301 ... 500V&quot; &quot; &gt; 500V&quot;</property> <property name="row_label_values">&quot;0 .. 15V&quot; &quot;16 .. 30V&quot; &quot;31 .. 50V&quot; &quot;51 .. 100V&quot; &quot;101 .. 150V&quot; &quot;151 .. 170V&quot; &quot;171 .. 250V&quot; &quot;251 .. 300V&quot; &quot;301 .. 500V&quot; &quot; &gt; 500V&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property> <property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property> <property name="row_sizes">24,24,24,24,24,24,24,24,24,24</property>
<property name="rows">10</property> <property name="rows">10</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
@ -20790,11 +20884,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="notebookpage" expanded="0"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Board Classes</property> <property name="label">Board Classes</property>
<property name="select">0</property> <property name="select">0</property>
<object class="wxPanel" expanded="0"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -20845,14 +20939,23 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerBoardClass</property> <property name="name">bSizerBoardClass</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerUnitsMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">32</property>
<property name="flag">wxALL</property> <property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -20915,6 +21018,8 @@
<event name="OnChoice">OnBoardClassesUnitsSelection</event> <event name="OnChoice">OnBoardClassesUnitsSelection</event>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
@ -20999,7 +21104,7 @@
<property name="aui_position"></property> <property name="aui_position"></property>
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="autosize_cols">0</property> <property name="autosize_cols">0</property>
<property name="autosize_rows">1</property> <property name="autosize_rows">0</property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg"></property>
<property name="caption"></property> <property name="caption"></property>
@ -21012,11 +21117,11 @@
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property> <property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">70</property> <property name="col_label_size">30</property>
<property name="col_label_values">&quot;Class 1&quot; &quot;Class 2&quot; &quot;Class 3&quot; &quot;Class 4&quot; &quot;Class 5&quot; &quot;Class 6&quot;</property> <property name="col_label_values">&quot;Class 1&quot; &quot;Class 2&quot; &quot;Class 3&quot; &quot;Class 4&quot; &quot;Class 5&quot; &quot;Class 6&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property> <property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">6</property> <property name="cols">6</property>
<property name="column_sizes"></property> <property name="column_sizes">100,100,100,100,100,100</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
@ -21061,7 +21166,7 @@
<property name="row_label_size">160</property> <property name="row_label_size">160</property>
<property name="row_label_values">&quot;Lines width&quot; &quot;Min clearance&quot; &quot;Via: (diam - drill)&quot; &quot;Plated Pad: (diam - drill)&quot; &quot;NP Pad: (diam - drill)&quot;</property> <property name="row_label_values">&quot;Lines width&quot; &quot;Min clearance&quot; &quot;Via: (diam - drill)&quot; &quot;Plated Pad: (diam - drill)&quot; &quot;NP Pad: (diam - drill)&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property> <property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property> <property name="row_sizes">24,24,24,24,24</property>
<property name="rows">5</property> <property name="rows">5</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>

View File

@ -280,7 +280,8 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER
wxStaticText* m_staticTextRiseTime; wxStaticText* m_staticTextRiseTime;
wxTextCtrl* m_textCtrlRiseTime; wxTextCtrl* m_textCtrlRiseTime;
wxStaticText* m_staticTextRiseTimeUnits; wxStaticText* m_staticTextRiseTimeUnits;
wxStaticBitmap* m_bitmap10; wxPanel* m_panelViaBitmap;
wxStaticBitmap* m_viaBitmap;
wxStaticText* m_staticTextArea11; wxStaticText* m_staticTextArea11;
wxStaticText* m_ViaResistance; wxStaticText* m_ViaResistance;
wxStaticText* m_IntTrackAreaUnitLabel1; wxStaticText* m_IntTrackAreaUnitLabel1;

View File

@ -19,84 +19,68 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <dialog_helpers.h> #include <vector>
#include "class_regulator_data.h"
#include "attenuators/attenuator_classes.h"
#include "pcb_calculator_frame.h"
#include <wx/wx.h>
#include <array> #include <array>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <dialog_helpers.h>
#include "class_regulator_data.h"
#include "pcb_calculator_frame.h"
#include <wx/wx.h>
#ifdef BENCHMARK #ifdef BENCHMARK
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include <vector>
#include "eserie.h" #include "eserie.h"
#include "profile.h"
wxString eseries_help = wxString eseries_help =
#include "eserie_help.h" #include "eserie_help.h"
eserie r; eserie r;
void eserie::set_reqR( double aR )
{
reqR = aR;
}
void eserie::set_rb( uint32_t a_rb ) void eserie::Exclude( double aValue )
{
rb_state = a_rb;
}
std::array<r_data, S4R + 1> eserie::get_rslt( void )
{
return results;
}
void eserie::exclude( double aValue )
{ {
if( aValue ) // if there is a value to exclude other than a wire jumper if( aValue ) // if there is a value to exclude other than a wire jumper
{ {
for( r_data& i : luts[rb_state] ) // then search it in the selected E-Serie lookup table for( r_data& i : luts[m_series] ) // then search it in the selected E-Serie lookup table
{ {
if( i.e_value == aValue ) // if value to exclude found if( i.e_value == aValue ) // if value to exclude found
{
i.e_use = false; // disable its use i.e_use = false; // disable its use
} }
} }
} }
}
void eserie::simple_solution( uint32_t aSize ) void eserie::simple_solution( uint32_t aSize )
{ {
uint32_t i; uint32_t i;
results[S2R].e_value = std::numeric_limits<double>::max(); // assume no 2R solution or max deviation m_results[S2R].e_value = std::numeric_limits<double>::max(); // assume no 2R solution or max deviation
for( i = 0; i < aSize; i++ ) for( i = 0; i < aSize; i++ )
{ {
if( abs( cmb_lut[i].e_value - reqR ) < abs( results[S2R].e_value ) ) if( abs( m_cmb_lut[i].e_value - m_required_value ) < abs( m_results[S2R].e_value ) )
{ {
results[S2R].e_value = cmb_lut[i].e_value - reqR; // save signed deviation in Ohms m_results[S2R].e_value = m_cmb_lut[i].e_value - m_required_value; // save signed deviation in Ohms
results[S2R].e_name = cmb_lut[i].e_name; // save combination text m_results[S2R].e_name = m_cmb_lut[i].e_name; // save combination text
results[S2R].e_use = true; // this is a possible solution m_results[S2R].e_use = true; // this is a possible solution
} }
} }
} }
void eserie::combine4( uint32_t aSize ) void eserie::combine4( uint32_t aSize )
{ {
uint32_t i,j; uint32_t i,j;
double tmp; double tmp;
std::string s; std::string s;
results[S4R].e_use = false; // disable 4R solution, until m_results[S4R].e_use = false; // disable 4R solution, until
results[S4R].e_value = results[S3R].e_value; // 4R becomes better than 3R solution m_results[S4R].e_value = m_results[S3R].e_value; // 4R becomes better than 3R solution
#ifdef BENCHMARK #ifdef BENCHMARK
PROF_COUNTER combine4_timer; // start timer to count execution time PROF_COUNTER combine4_timer; // start timer to count execution time
@ -106,90 +90,84 @@ void eserie::combine4( uint32_t aSize )
{ // scan valid intermediate 2R solutions { // scan valid intermediate 2R solutions
for( j = 0; j < aSize; j++ ) // inner loop combines all with itself for( j = 0; j < aSize; j++ ) // inner loop combines all with itself
{ {
tmp = cmb_lut[i].e_value + cmb_lut[j].e_value; // calculate 2R+2R serial tmp = m_cmb_lut[i].e_value + m_cmb_lut[j].e_value; // calculate 2R+2R serial
tmp -= reqR; // calculate 4R deviation tmp -= m_required_value; // calculate 4R deviation
if( abs( tmp ) < abs( results[S4R].e_value ) ) // if new 4R is better if( abs( tmp ) < abs( m_results[S4R].e_value ) ) // if new 4R is better
{ {
results[S4R].e_value = tmp; // save amount of benefit m_results[S4R].e_value = tmp; // save amount of benefit
std::string s = "( "; std::string s = "( ";
s.append( cmb_lut[i].e_name ); // mention 1st 2 component s.append( m_cmb_lut[i].e_name ); // mention 1st 2 component
s.append( " ) + ( " ); // in series s.append( " ) + ( " ); // in series
s.append( cmb_lut[j].e_name ); // with 2nd 2 components s.append( m_cmb_lut[j].e_name ); // with 2nd 2 components
s.append( " )" ); s.append( " )" );
results[S4R].e_name = s; // save the result and m_results[S4R].e_name = s; // save the result and
results[S4R].e_use = true; // enable for later use m_results[S4R].e_use = true; // enable for later use
} }
tmp = ( cmb_lut[i].e_value * cmb_lut[j].e_value ) / tmp = ( m_cmb_lut[i].e_value * m_cmb_lut[j].e_value ) /
( cmb_lut[i].e_value + cmb_lut[j].e_value ); // calculate 2R|2R parallel ( m_cmb_lut[i].e_value + m_cmb_lut[j].e_value ); // calculate 2R|2R parallel
tmp -= reqR; // calculate 4R deviation tmp -= m_required_value; // calculate 4R deviation
if( abs( tmp ) < abs( results[S4R].e_value ) ) // if new 4R is better if( abs( tmp ) < abs( m_results[S4R].e_value ) ) // if new 4R is better
{ {
results[S4R].e_value = tmp; // save amount of benefit m_results[S4R].e_value = tmp; // save amount of benefit
std::string s = "( "; std::string s = "( ";
s.append( cmb_lut[i].e_name ); // mention 1st 2 component s.append( m_cmb_lut[i].e_name ); // mention 1st 2 component
s.append( " ) | ( " ); // in parallel s.append( " ) | ( " ); // in parallel
s.append( cmb_lut[j].e_name ); // with 2nd 2 components s.append( m_cmb_lut[j].e_name ); // with 2nd 2 components
s.append( " )" ); s.append( " )" );
results[S4R].e_name = s; // save the result m_results[S4R].e_name = s; // save the result
results[S4R].e_use = true; // enable later use m_results[S4R].e_use = true; // enable later use
} }
} }
} }
#ifdef BENCHMARK #ifdef BENCHMARK
if( rb_state == E12 ) if( m_series == E12 )
{
std::cout<<"4R Time = "<<combine4_timer.msecs()<<" mSec"<<std::endl; std::cout<<"4R Time = "<<combine4_timer.msecs()<<" mSec"<<std::endl;
}
#endif #endif
} }
void eserie::new_calc( void )
{ void eserie::NewCalc( void )
for( r_data& i : cmb_lut )
{ {
for( r_data& i : m_cmb_lut )
i.e_use = false; // before any calculation is done, assume that i.e_use = false; // before any calculation is done, assume that
}
for( r_data& i : results ) for( r_data& i : m_results )
{
i.e_use = false; // no combinations and no results are available i.e_use = false; // no combinations and no results are available
}
for( r_data& i : luts[rb_state]) for( r_data& i : luts[m_series])
{
i.e_use = true; // all selecte E-values available i.e_use = true; // all selecte E-values available
} }
}
uint32_t eserie::combine2( void ) uint32_t eserie::combine2( void )
{ {
uint32_t combi2R = 0; // target index counts calculated 2R combinations uint32_t combi2R = 0; // target index counts calculated 2R combinations
std::string s; std::string s;
for( const r_data& i : luts[rb_state] ) // outer loop to sweep selected source lookup table for( const r_data& i : luts[m_series] ) // outer loop to sweep selected source lookup table
{ {
if( i.e_use ) if( i.e_use )
{ {
for( const r_data& j : luts[rb_state] ) // inner loop to combine values with itself for( const r_data& j : luts[m_series] ) // inner loop to combine values with itself
{ {
if( j.e_use ) if( j.e_use )
{ {
cmb_lut[combi2R].e_use = true; m_cmb_lut[combi2R].e_use = true;
cmb_lut[combi2R].e_value = i.e_value + j.e_value; // calculate 2R serial m_cmb_lut[combi2R].e_value = i.e_value + j.e_value; // calculate 2R serial
s = i.e_name; s = i.e_name;
s.append( " + " ); s.append( " + " );
cmb_lut[combi2R].e_name = s.append(j.e_name); m_cmb_lut[combi2R].e_name = s.append( j.e_name);
combi2R++; // next destination combi2R++; // next destination
cmb_lut[combi2R].e_use = true; // calculate 2R parallel m_cmb_lut[combi2R].e_use = true; // calculate 2R parallel
cmb_lut[combi2R].e_value = i.e_value * j.e_value / m_cmb_lut[combi2R].e_value = i.e_value * j.e_value /
( i.e_value + j.e_value ); ( i.e_value + j.e_value );
s = i.e_name; s = i.e_name;
s.append( " | " ); s.append( " | " );
cmb_lut[combi2R].e_name = s.append( j.e_name ); m_cmb_lut[combi2R].e_name = s.append( j.e_name );
combi2R++; // next destination combi2R++; // next destination
} }
} }
@ -198,112 +176,116 @@ uint32_t eserie::combine2( void )
return ( combi2R ); return ( combi2R );
} }
void eserie::combine3( uint32_t aSize ) void eserie::combine3( uint32_t aSize )
{ {
uint32_t j = 0; uint32_t j = 0;
double tmp = 0; // avoid warning for being uninitialized double tmp = 0; // avoid warning for being uninitialized
std::string s; std::string s;
results[S3R].e_use = false; // disable 3R solution, until m_results[S3R].e_use = false; // disable 3R solution, until
results[S3R].e_value = results[S2R].e_value; // 3R becomes better than 2R solution m_results[S3R].e_value = m_results[S2R].e_value; // 3R becomes better than 2R solution
for( const r_data& i : luts[rb_state] ) // 3R Outer loop to selected primary E serie LUT for( const r_data& i : luts[m_series] ) // 3R Outer loop to selected primary E serie LUT
{ {
if( i.e_use ) // skip all excluded values if( i.e_use ) // skip all excluded values
{ {
for( j = 0; j < aSize; j++ ) // inner loop combines with all 2R intermediate results for( j = 0; j < aSize; j++ ) // inner loop combines with all 2R intermediate results
{ // R+2R serial combi { // R+2R serial combi
tmp = cmb_lut[j].e_value + i.e_value; tmp = m_cmb_lut[j].e_value + i.e_value;
tmp -= reqR; // calculate deviation tmp -= m_required_value; // calculate deviation
if( abs( tmp ) < abs( results[S3R].e_value ) ) // compare if better if( abs( tmp ) < abs( m_results[S3R].e_value ) ) // compare if better
{ // then take it { // then take it
s = i.e_name; // mention 3rd component s = i.e_name; // mention 3rd component
s.append( " + ( " ); // in series s.append( " + ( " ); // in series
s.append( cmb_lut[j].e_name ); // with 2R combination s.append( m_cmb_lut[j].e_name ); // with 2R combination
s.append( " )" ); s.append( " )" );
results[S3R].e_name = s; // save S3R result m_results[S3R].e_name = s; // save S3R result
results[S3R].e_value = tmp; // save amount of benefit m_results[S3R].e_value = tmp; // save amount of benefit
results[S3R].e_use = true; // enable later use m_results[S3R].e_use = true; // enable later use
} }
tmp = i.e_value * cmb_lut[j].e_value / tmp = i.e_value * m_cmb_lut[j].e_value /
( i.e_value + cmb_lut[j].e_value ); // calculate R + 2R parallel ( i.e_value + m_cmb_lut[j].e_value ); // calculate R + 2R parallel
tmp -= reqR; // calculate deviation tmp -= m_required_value; // calculate deviation
if( abs( tmp ) < abs( results[S3R].e_value ) ) // compare if better if( abs( tmp ) < abs( m_results[S3R].e_value ) ) // compare if better
{ // then take it { // then take it
s = i.e_name; // mention 3rd component s = i.e_name; // mention 3rd component
s.append( " | ( " ); // in parallel s.append( " | ( " ); // in parallel
s.append( cmb_lut[j].e_name ); // with 2R combination s.append( m_cmb_lut[j].e_name ); // with 2R combination
s.append( " )" ); s.append( " )" );
results[S3R].e_name = s; m_results[S3R].e_name = s;
results[S3R].e_value = tmp; // save amount of benefit m_results[S3R].e_value = tmp; // save amount of benefit
results[S3R].e_use = true; // enable later use m_results[S3R].e_use = true; // enable later use
} }
} }
} }
} }
// if there is a 3R result with remaining deviation // if there is a 3R result with remaining deviation
if( ( results[S3R].e_use == true ) && tmp ) if(( m_results[S3R].e_use == true ) && tmp )
{ // consider to search a possibly better 4R solution { // consider to search a possibly better 4R solution
combine4( aSize ); // calculate 4R for small series always combine4( aSize ); // calculate 4R for small series always
} }
} }
void eserie::calculate( void )
void eserie::Calculate( void )
{ {
uint32_t no_of_2Rcombi = 0; uint32_t no_of_2Rcombi = 0;
no_of_2Rcombi = combine2(); // combine all 2R combinations for selected E serie no_of_2Rcombi = combine2(); // combine all 2R combinations for selected E serie
simple_solution( no_of_2Rcombi ); // search for simple 2 component solution simple_solution( no_of_2Rcombi ); // search for simple 2 component solution
if( results[S2R].e_value ) // if simple 2R result is not exact if( m_results[S2R].e_value ) // if simple 2R result is not exact
{
combine3( no_of_2Rcombi ); // continiue searching for a possibly better solution combine3( no_of_2Rcombi ); // continiue searching for a possibly better solution
}
strip3(); strip3();
strip4(); strip4();
} }
void eserie::strip3( void ) void eserie::strip3( void )
{ {
std::string s; std::string s;
if( results[S3R].e_use ) // if there is a 3 term result available if( m_results[S3R].e_use ) // if there is a 3 term result available
{ // what is connected either by two "|" or by 3 plus { // what is connected either by two "|" or by 3 plus
s = results[S3R].e_name; s = m_results[S3R].e_name;
if( ( std::count( s.begin(), s.end(), '+' ) == 2 ) || \ if( ( std::count( s.begin(), s.end(), '+' ) == 2 )
( std::count( s.begin(), s.end(), '|' ) == 2 ) ) || ( std::count( s.begin(), s.end(), '|' ) == 2 ) )
{ // then strip one pair of braces { // then strip one pair of braces
s.erase( s.find( "(" ), 1 ); // it is known sure, this is available s.erase( s.find( "(" ), 1 ); // it is known sure, this is available
s.erase( s.find( ")" ), 1 ); // in any unstripped 3R result term s.erase( s.find( ")" ), 1 ); // in any unstripped 3R result term
results[S3R].e_name = s; // use stripped result m_results[S3R].e_name = s; // use stripped result
} }
} }
} }
void eserie::strip4( void ) void eserie::strip4( void )
{ {
std::string s; std::string s;
if( results[S4R].e_use ) // if there is a 4 term result available if( m_results[S4R].e_use ) // if there is a 4 term result available
{ // what are connected either by 3 "+" or by 3 "|" { // what are connected either by 3 "+" or by 3 "|"
s = results[S4R].e_name; s = m_results[S4R].e_name;
if( ( std::count( s.begin(), s.end(), '+' ) == 3 ) || if( ( std::count( s.begin(), s.end(), '+' ) == 3 )
( std::count( s.begin(), s.end(), '|' ) == 3 ) ) || ( std::count( s.begin(), s.end(), '|' ) == 3 ) )
{ // then strip two pair of braces { // then strip two pair of braces
s.erase( s.find( "(" ), 1 ); // it is known sure, they are available s.erase( s.find( "(" ), 1 ); // it is known sure, they are available
s.erase( s.find( ")" ), 1 ); // in any unstripped 4R result term s.erase( s.find( ")" ), 1 ); // in any unstripped 4R result term
s.erase( s.find( "(" ), 1 ); s.erase( s.find( "(" ), 1 );
s.erase( s.find( ")" ), 1 ); s.erase( s.find( ")" ), 1 );
results[S4R].e_name = s; // use stripped result m_results[S4R].e_name = s; // use stripped result
} }
} }
} }
void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event ) void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event )
{ {
double reqr; // required resistor stored in local copy double reqr; // required resistor stored in local copy
@ -311,18 +293,18 @@ void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event )
wxString es, fs; // error and formula strings wxString es, fs; // error and formula strings
reqr = ( 1000 * DoubleFromString( m_ResRequired->GetValue() ) ); reqr = ( 1000 * DoubleFromString( m_ResRequired->GetValue() ) );
r.set_reqR(reqr); // keep a local copy of requred resistor value r.SetRequiredValue( reqr ); // keep a local copy of requred resistor value
r.new_calc(); // assume all values available r.NewCalc(); // assume all values available
/* /*
* Exclude itself. For the case, a value from the available series is found as required value, * Exclude itself. For the case, a value from the available series is found as required value,
* the calculator assumes this value needs a replacement for the reason of being not available. * the calculator assumes this value needs a replacement for the reason of being not available.
* Two further exclude values can be entered to exclude and are skipped as not being availabe. * Two further exclude values can be entered to exclude and are skipped as not being availabe.
* All values entered in KiloOhms are converted to Ohm for internal calculation * All values entered in KiloOhms are converted to Ohm for internal calculation
*/ */
r.exclude( 1000 * DoubleFromString( m_ResRequired->GetValue() ) ); r.Exclude( 1000 * DoubleFromString( m_ResRequired->GetValue()));
r.exclude( 1000 * DoubleFromString( m_ResExclude1->GetValue() ) ); r.Exclude( 1000 * DoubleFromString( m_ResExclude1->GetValue()));
r.exclude( 1000 * DoubleFromString( m_ResExclude2->GetValue() ) ); r.Exclude( 1000 * DoubleFromString( m_ResExclude2->GetValue()));
r.calculate(); r.Calculate();
fs = r.get_rslt()[S2R].e_name; // show 2R solution formula string fs = r.get_rslt()[S2R].e_name; // show 2R solution formula string
m_ESeries_Sol2R->SetValue( fs ); m_ESeries_Sol2R->SetValue( fs );
@ -332,14 +314,10 @@ void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event )
if( error ) if( error )
{ {
if( std::abs( error ) < 0.01 ) if( std::abs( error ) < 0.01 )
{
es.Printf( "<%.2f", 0.01 ); es.Printf( "<%.2f", 0.01 );
}
else else
{
es.Printf( "%+.2f",error); es.Printf( "%+.2f",error);
} }
}
else else
{ {
es = _( "Exact" ); es = _( "Exact" );
@ -355,14 +333,10 @@ void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event )
if( err3 ) if( err3 )
{ {
if( std::abs( err3 ) < 0.01 ) if( std::abs( err3 ) < 0.01 )
{
es.Printf( "<%.2f", 0.01 ); es.Printf( "<%.2f", 0.01 );
}
else else
{
es.Printf( "%+.2f",err3); es.Printf( "%+.2f",err3);
} }
}
else else
{ {
es = _( "Exact" ); es = _( "Exact" );
@ -389,13 +363,9 @@ void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event )
error = ( reqr / error - 1 ) * 100; // error in percent error = ( reqr / error - 1 ) * 100; // error in percent
if( error ) if( error )
{
es.Printf( "%+.2f",error ); es.Printf( "%+.2f",error );
}
else else
{
es = _( "Exact" ); es = _( "Exact" );
}
m_ESeriesError4R->SetValue( es ); m_ESeriesError4R->SetValue( es );
} }
@ -412,16 +382,16 @@ void PCB_CALCULATOR_FRAME::OnCalculateESeries( wxCommandEvent& event )
void PCB_CALCULATOR_FRAME::OnESeriesSelection( wxCommandEvent& event ) void PCB_CALCULATOR_FRAME::OnESeriesSelection( wxCommandEvent& event )
{ {
if( event.GetEventObject() == m_e1 ) if( event.GetEventObject() == m_e1 )
r.set_rb( E1 ); r.SetSeries( E1 );
else if( event.GetEventObject() == m_e3 ) else if( event.GetEventObject() == m_e3 )
r.set_rb( E3 ); r.SetSeries( E3 );
else if( event.GetEventObject() == m_e12 ) else if( event.GetEventObject() == m_e12 )
r.set_rb( E12 ); r.SetSeries( E12 );
else else
r.set_rb( E6 ); r.SetSeries( E6 );
} }
void PCB_CALCULATOR_FRAME::ES_Init() // initialize ESeries tab at each pcb-calculator start void PCB_CALCULATOR_FRAME::initESeriesPanel() // initialize ESeries tab at each pcb-calculator start
{ {
wxString msg; wxString msg;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2020 <janvi@veith.net> * Copyright (C) 2020 <janvi@veith.net>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@ -18,10 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* @file eserie.h
*/
extern double DoubleFromString( const wxString& TextValue ); extern double DoubleFromString( const wxString& TextValue );
/** /**
@ -126,40 +122,38 @@ struct r_data {
class eserie class eserie
{ {
private: public:
std::vector<std::vector<r_data>> luts { /**
{ E1_VAL }, * If any value of the selected E-serie not available, it can be entered as an exclude value.
{ E1_VAL, E3_ADD }, *
{ E1_VAL, E3_ADD, E6_ADD }, * @param aValue is the value to exclude from calculation
{ E1_VAL, E3_ADD, E6_ADD, E12_ADD } * Values to exclude are set to false in the selected E-serie source lookup table
};
/*
* TODO: Manual array size calculation is dangerous. Unlike legacy ANSI-C Arrays
* std::array can not drop length param by providing aggregate init list up
* to C++17. Reserved array size should be 2*E12² of std::vector primary list.
* Exceeding memory limit 7442 will crash the calculator without any warnings !
* Compare to previous MAX_COMB macro for legacy ANSI-C array automatic solution
* #define E12_SIZE sizeof ( e12_lut ) / sizeof ( r_data )
* #define MAX_COMB (2 * E12_SIZE * E12_SIZE)
* 2 component combinations including redundant swappable terms are for the moment
* 72 combinations for E1
* 512 combinations for E3
* 1922 combinations for E6
* 7442 combinations for E12
*/ */
void Exclude( double aValue );
#define MAX_CMB 7442 // maximum combinations for E12 /**
* initialize next calculation and erase results from previous calculation
*/
void NewCalc( void );
std::array<r_data,MAX_CMB> cmb_lut; // intermediate 2R combinations /**
std::array<r_data,S4R+1> results; // 2R, 3R and 4R results * called on calculate button to execute all the 2R, 3R and 4R calculations
uint32_t rb_state = E6; // Radio Button State */
uint32_t cb_state = false; // Check Box 4R enable void Calculate( void );
double reqR; // required Resistor
/**
* Interface for CheckBox, RadioButton, RequriedResistor and calculated Results
*/
void SetSeries( uint32_t aSeries ) { m_series = aSeries; }
void SetRequiredValue( double aValue ) { m_required_value = aValue; }
std::array<r_data,S4R+1> get_rslt( void ) { return m_results; }
private:
/** /**
* Build all 2R combinations from the selected E-serie values * Build all 2R combinations from the selected E-serie values
* *
* Pre-calculated value combinations are saved in intermediate look up table cmb_lut * Pre-calculated value combinations are saved in intermediate look up table m_cmb_lut
* @return is the number of found combinations what also depends from exclude values * @return is the number of found combinations what also depends from exclude values
*/ */
uint32_t combine2( void ); uint32_t combine2( void );
@ -167,7 +161,7 @@ class eserie
/** /**
* Search for closest two component solution * Search for closest two component solution
* *
* @param aSize is the number of valid 2R combinations in cmb_lut on where to search * @param aSize is the number of valid 2R combinations in m_cmb_lut on where to search
* The 2R result with smallest deviation will be saved in results * The 2R result with smallest deviation will be saved in results
*/ */
void simple_solution( uint32_t aSize ); void simple_solution( uint32_t aSize );
@ -175,8 +169,8 @@ class eserie
/** /**
* Check if there is a better 3 R solution than previous one using only two components. * Check if there is a better 3 R solution than previous one using only two components.
* *
* @param aSize gives the number of available combinations to be checked inside cmb_lut * @param aSize gives the number of available combinations to be checked inside m_cmb_lut
* Therefore cmb_lut is combinated with the primary E-serie look up table * Therefore m_cmb_lut is combinated with the primary E-serie look up table
* The 3R result with smallest deviation will be saved in results if better than 2R * The 3R result with smallest deviation will be saved in results if better than 2R
*/ */
void combine3( uint32_t aSize ); void combine3( uint32_t aSize );
@ -184,7 +178,7 @@ class eserie
/** /**
* Check if there is a better four component solution. * Check if there is a better four component solution.
* *
* @param aSsize gives the number of 2R combinations to be checked inside cmb_lut * @param aSsize gives the number of 2R combinations to be checked inside m_cmb_lut
* Occupied calculation time depends from number of available E-serie values * Occupied calculation time depends from number of available E-serie values
* with the power of 4 why execution for E12 is conditional with 4R check box * with the power of 4 why execution for E12 is conditional with 4R check box
* for the case the previously found 3R solution is already exact * for the case the previously found 3R solution is already exact
@ -209,30 +203,33 @@ class eserie
*/ */
void strip4( void ); void strip4( void );
public: private:
std::vector<std::vector<r_data>> luts {
/** { E1_VAL },
* If any value of the selected E-serie not available, it can be entered as an exclude value. { E1_VAL, E3_ADD },
* { E1_VAL, E3_ADD, E6_ADD },
* @param aValue is the value to exclude from calculation { E1_VAL, E3_ADD, E6_ADD, E12_ADD }
* Values to exclude are set to false in the selected E-serie source lookup table };
*/ /*
void exclude( double aValue ); * TODO: Manual array size calculation is dangerous. Unlike legacy ANSI-C Arrays
* std::array can not drop length param by providing aggregate init list up
/** * to C++17. Reserved array size should be 2*E12² of std::vector primary list.
* initialize next calculation and erase results from previous calculation * Exceeding memory limit 7442 will crash the calculator without any warnings !
*/ * Compare to previous MAX_COMB macro for legacy ANSI-C array automatic solution
void new_calc( void ); * #define E12_SIZE sizeof ( e12_lut ) / sizeof ( r_data )
* #define MAX_COMB (2 * E12_SIZE * E12_SIZE)
/** * 2 component combinations including redundant swappable terms are for the moment
* called on calculate button to execute all the 2R, 3R and 4R calculations * 72 combinations for E1
*/ * 512 combinations for E3
void calculate( void ); * 1922 combinations for E6
* 7442 combinations for E12
/** */
* Interface for CheckBox, RadioButton, RequriedResistor and calculated Results
*/ #define MAX_CMB 7442 // maximum combinations for E12
void set_rb ( uint32_t a_rb );
void set_reqR ( double aR ); std::array<r_data, MAX_CMB> m_cmb_lut; // intermediate 2R combinations
std::array<r_data,S4R+1> get_rslt ( void ); std::array<r_data, S4R+1> m_results; // 2R, 3R and 4R results
uint32_t m_series = E6; // Radio Button State
uint32_t m_enable_4R = false; // Check Box 4R enable
double m_required_value; // required Resistor
}; };

View File

@ -3,10 +3,10 @@ _HKI( "E-series defined in IEC 60063 are a widely accepted system of preferred\n
"numbers for electronic components. Available values are approximately\n" "numbers for electronic components. Available values are approximately\n"
"equally spaced in a logarithmic scale.\n" "equally spaced in a logarithmic scale.\n"
"\n" "\n"
" E12: 1,0 1,2 1,5 1,8 2,2 2,7 3,3 3,9 4,7 5,6 6,8 8,2\n" " E12: 1.0 1.2 1.5 1.8 2.2 2.7 3.3 3.9 4.7 5.6 6.8 8.2\n"
" E6: 1,0 - 1,5 - 2,2 - 3,3 - 4,7 - 6,8 -\n" " E6: 1.0 - 1.5 - 2.2 - 3.3 - 4.7 - 6.8 -\n"
" E3: 1,0 - - - 2,2 - - - 4,7 - - -\n" " E3: 1.0 - - - 2.2 - - - 4.7 - - -\n"
" E1: 1,0 - - - - - - - - - - -\n" " E1: 1.0 - - - - - - - - - - -\n"
"\n" "\n"
"This calculator finds combinations of standard E-series components to\n" "This calculator finds combinations of standard E-series components to\n"
"create arbitrary values. You can enter the required resistance from 0,0025 to 4000 kOhm. \n" "create arbitrary values. You can enter the required resistance from 0,0025 to 4000 kOhm. \n"

View File

@ -2,10 +2,10 @@ E-series defined in IEC 60063 are a widely accepted system of preferred
numbers for electronic components. Available values are approximately numbers for electronic components. Available values are approximately
equally spaced in a logarithmic scale. equally spaced in a logarithmic scale.
E12: 1,0 1,2 1,5 1,8 2,2 2,7 3,3 3,9 4,7 5,6 6,8 8,2 E12: 1.0 1.2 1.5 1.8 2.2 2.7 3.3 3.9 4.7 5.6 6.8 8.2
E6: 1,0 - 1,5 - 2,2 - 3,3 - 4,7 - 6,8 - E6: 1.0 - 1.5 - 2.2 - 3.3 - 4.7 - 6.8 -
E3: 1,0 - - - 2,2 - - - 4,7 - - - E3: 1.0 - - - 2.2 - - - 4.7 - - -
E1: 1,0 - - - - - - - - - - - E1: 1.0 - - - - - - - - - - -
This calculator finds combinations of standard E-series components to This calculator finds combinations of standard E-series components to
create arbitrary values. You can enter the required resistance from 0,0025 to 4000 kOhm. create arbitrary values. You can enter the required resistance from 0,0025 to 4000 kOhm.

View File

@ -22,10 +22,7 @@
#include <bitmaps.h> #include <bitmaps.h>
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
#include <kiface_i.h> #include <kiface_i.h>
#include "bitmaps/color_code_value_and_name.xpm" #include "bitmaps/via_dims.xpm"
#include "bitmaps/color_code_value.xpm"
#include "bitmaps/color_code_multiplier.xpm"
#include "bitmaps/color_code_tolerance.xpm"
#include "attenuators/attenuator_classes.h" #include "attenuators/attenuator_classes.h"
#include "class_regulator_data.h" #include "class_regulator_data.h"
#include "pcb_calculator_frame.h" #include "pcb_calculator_frame.h"
@ -51,8 +48,9 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_TWMode = TW_MASTER_CURRENT; m_TWMode = TW_MASTER_CURRENT;
m_TWNested = false; m_TWNested = false;
// TODO: make regulator bitmaps transparent so we can remove this // TODO: make regulator & via bitmaps transparent so we can remove these
m_panelRegulatorBitmaps->SetBackgroundColour( *wxWHITE ); m_panelRegulatorBitmaps->SetBackgroundColour( *wxWHITE );
m_panelViaBitmap->SetBackgroundColour( *wxWHITE );
SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
// some methods in code and avoid link errors // some methods in code and avoid link errors
@ -91,9 +89,10 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
TranslineTypeSelection( m_currTransLineType ); TranslineTypeSelection( m_currTransLineType );
m_TranslineSelection->SetSelection( m_currTransLineType ); m_TranslineSelection->SetSelection( m_currTransLineType );
TW_Init(); // Track Width initTrackWidthPanel();
VS_Init(); // Via Size initColorCodePanel();
ES_Init(); // E-Series initViaSizePanel();
initESeriesPanel();
SetAttenuator( m_AttenuatorsSelection->GetSelection() ); SetAttenuator( m_AttenuatorsSelection->GetSelection() );
@ -137,6 +136,11 @@ PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME()
for( unsigned ii = 0; ii < m_attenuator_list.size(); ii++ ) for( unsigned ii = 0; ii < m_attenuator_list.size(); ii++ )
delete m_attenuator_list[ii]; delete m_attenuator_list[ii];
delete m_ccValueNamesBitmap;
delete m_ccValuesBitmap;
delete m_ccMultipliersBitmap;
delete m_ccTolerancesBitmap;
// This needed for OSX: avoids furter OnDraw processing after this destructor and before // This needed for OSX: avoids furter OnDraw processing after this destructor and before
// the native window is destroyed // the native window is destroyed
this->Freeze(); this->Freeze();
@ -165,19 +169,13 @@ void PCB_CALCULATOR_FRAME::OnUpdateUI( wxUpdateUIEvent& event )
} }
} }
static wxBitmap* valueNameBitmap = new wxBitmap( color_code_value_and_name_xpm ); ToleranceSelection( m_rbToleranceSelection->GetSelection() );
m_Band1bitmap->SetBitmap( *valueNameBitmap );
static wxBitmap* valueBitmap = new wxBitmap( color_code_value_xpm ); static wxBitmap* viaBitmap = new wxBitmap( via_dims_xpm );
m_Band2bitmap->SetBitmap( *valueBitmap ); m_viaBitmap->SetBitmap( *viaBitmap );
m_Band3bitmap->SetBitmap( *valueBitmap );
m_Band4bitmap->SetBitmap( *valueBitmap );
static wxBitmap* multiplierBitmap = new wxBitmap( color_code_multiplier_xpm ); m_panelESeriesHelp->Refresh();
m_Band_mult_bitmap->SetBitmap( *multiplierBitmap ); m_htmlWinFormulas->Refresh();
static wxBitmap* toleranceBitmap = new wxBitmap( color_code_tolerance_xpm );
m_Band_tol_bitmap->SetBitmap( *toleranceBitmap );
// Until it's shown on screen the above won't work; but doing it anyway at least keeps // Until it's shown on screen the above won't work; but doing it anyway at least keeps
// putting new OnUpdateUI events into the queue until it *is* shown on screen. // putting new OnUpdateUI events into the queue until it *is* shown on screen.
@ -288,9 +286,9 @@ void PCB_CALCULATOR_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
Regulators_WriteConfig( cfg ); Regulators_WriteConfig( cfg );
} }
TW_WriteConfig(); writeTrackWidthConfig();
VS_WriteConfig(); writeViaSizeConfig();
for( unsigned ii = 0; ii < m_transline_list.size(); ii++ ) for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
m_transline_list[ii]->WriteConfig(); m_transline_list[ii]->WriteConfig();

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KICAD, a free EDA CAD application. * This program source code file is part of KICAD, a free EDA CAD application.
* *
* Copyright (C) 1992-2020 Kicad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -17,10 +17,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* @file pcb_calculator.h
*/
#ifndef PCB_CALCULATOR_H #ifndef PCB_CALCULATOR_H
#define PCB_CALCULATOR_H #define PCB_CALCULATOR_H
@ -38,42 +34,15 @@ class KIWAY;
class PCB_CALCULATOR_SETTINGS; class PCB_CALCULATOR_SETTINGS;
/* Class PCB_CALCULATOR_FRAME_BASE /*
This is the main frame for this application * Class PCB_CALCULATOR_FRAME_BASE
* This is the main frame for this application
*/ */
class PCB_CALCULATOR_FRAME : public PCB_CALCULATOR_FRAME_BASE class PCB_CALCULATOR_FRAME : public PCB_CALCULATOR_FRAME_BASE
{ {
public: public:
REGULATOR_LIST m_RegulatorList; // the list of known regulator REGULATOR_LIST m_RegulatorList; // the list of known regulator
private:
bool m_RegulatorListChanged; // set to true when m_RegulatorList
// was modified, and the corresponging file
// must be rewritten
enum // Which dimension is controlling the track
{ // width / current calculations:
TW_MASTER_CURRENT, // the maximum current,
TW_MASTER_EXT_WIDTH, // the external trace width,
TW_MASTER_INT_WIDTH // or the internal trace width?
} m_TWMode;
bool m_TWNested; // Used to stop events caused by setting the answers.
enum TRANSLINE_TYPE_ID m_currTransLineType;
TRANSLINE* m_currTransLine; // a pointer to the active transline
// List of translines: ordered like in dialog menu list
std::vector<TRANSLINE_IDENT*> m_transline_list;
ATTENUATOR* m_currAttenuator;
// List ofattenuators: ordered like in dialog menu list
std::vector<ATTENUATOR*> m_attenuator_list;
wxString m_lastSelectedRegulatorName; // last regulator name selected
int m_lastNotebookPage;
int m_lastRadioButton;
public:
PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ); PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent );
~PCB_CALCULATOR_FRAME(); ~PCB_CALCULATOR_FRAME();
@ -103,24 +72,17 @@ private:
*/ */
void SetDataFilename( const wxString& aFilename ); void SetDataFilename( const wxString& aFilename );
// Trace width / maximum current capability calculations.
/** /**
* Function TW_Init * Panel-specific initializers
* Read config and init dialog widgets values
*/ */
void TW_Init(); void initTrackWidthPanel();
void initESeriesPanel();
/** void initColorCodePanel();
* E-Series Resistor calculator Panel void initViaSizePanel();
* Called on calculator start to display markdown formula explanations
*/
void ES_Init( void );
/** /**
* Called on calculate button and executes all E-series calculations * Called on calculate button and executes all E-series calculations
*
*/ */
void OnCalculateESeries( wxCommandEvent& event ) override; void OnCalculateESeries( wxCommandEvent& event ) override;
/** /**
@ -130,10 +92,10 @@ private:
void OnESeriesSelection( wxCommandEvent& event ) override; void OnESeriesSelection( wxCommandEvent& event ) override;
/** /**
* Function TW_WriteConfig * Function writeTrackWidthConfig
* Write Track width parameters in config * Write Track width parameters in config
*/ */
void TW_WriteConfig(); void writeTrackWidthConfig();
/** /**
* Function OnTWParametersChanged * Function OnTWParametersChanged
@ -199,19 +161,11 @@ private:
*/ */
void TWUpdateModeDisplay(); void TWUpdateModeDisplay();
// Via size calculations
/** /**
* Function VS_Init * Function writeViaSizeConfig
* Read config and init dialog widgets values
*/
void VS_Init();
/**
* Function VS_WriteConfig
* Write Via Size parameters in config * Write Via Size parameters in config
*/ */
void VS_WriteConfig(); void writeViaSizeConfig();
/** /**
* Function OnViaCalculate * Function OnViaCalculate
@ -236,8 +190,7 @@ private:
/** /**
* Function OnViaResetButtonClick * Function OnViaResetButtonClick
* Called when the user clicks the reset button. This sets * Called when the user clicks the reset button; sets the parameters to their default values.
* the parameters to their default values.
*/ */
void OnViaResetButtonClick( wxCommandEvent& event ) override; void OnViaResetButtonClick( wxCommandEvent& event ) override;
@ -255,7 +208,6 @@ private:
void OnElectricalSpacingRefresh( wxCommandEvent& event ) override; void OnElectricalSpacingRefresh( wxCommandEvent& event ) override;
void ElectricalSpacingUpdateData( double aUnitScale ); void ElectricalSpacingUpdateData( double aUnitScale );
// Transline functions:
/** /**
* Function OnTranslineSelection * Function OnTranslineSelection
* Called on new transmission line selection * Called on new transmission line selection
@ -264,60 +216,57 @@ private:
/** /**
* Function OnTransLineResetButtonClick * Function OnTransLineResetButtonClick
* Called when the user clicks the reset button. This sets * Called when the user clicks the reset button; sets the parameters to their default values.
* the parameters to their default values.
*/ */
void OnTransLineResetButtonClick( wxCommandEvent& event ) override; void OnTransLineResetButtonClick( wxCommandEvent& event ) override;
/** /**
* Function OnTranslineAnalyse * Function OnTranslineAnalyse
* Run a new analyse for the current transline with current parameters * Run a new analyse for the current transline with current parameters and displays the
* and displays the electrical parameters * electrical parameters
*/ */
void OnTranslineAnalyse( wxCommandEvent& event ) override; void OnTranslineAnalyse( wxCommandEvent& event ) override;
/** /**
* Function OnTranslineSynthetize * Function OnTranslineSynthetize
* Run a new synthezis for the current transline with current parameters * Run a new synthezis for the current transline with current parameters and displays the
* and displays the geometrical parameters * geometrical parameters
*/ */
void OnTranslineSynthetize( wxCommandEvent& event ) override; void OnTranslineSynthetize( wxCommandEvent& event ) override;
/** /**
* Function OnTranslineEpsilonR_Button * Function OnTranslineEpsilonR_Button
* Shows a list of current relative dielectric constant(Er) * Shows a list of current relative dielectric constant(Er) and set the selected value in
* and set the selected value in main dialog frame * main dialog frame
*/ */
void OnTranslineEpsilonR_Button( wxCommandEvent& event ) override; void OnTranslineEpsilonR_Button( wxCommandEvent& event ) override;
/** /**
* Function OnTranslineTanD_Button * Function OnTranslineTanD_Button
* Shows a list of current dielectric loss factor (tangent delta) * Shows a list of current dielectric loss factor (tangent delta) and set the selected value
* and set the selected value in main dialog frame * in main dialog frame
*/ */
void OnTranslineTanD_Button( wxCommandEvent& event ) override; void OnTranslineTanD_Button( wxCommandEvent& event ) override;
/** /**
* Function OnTranslineRho_Button * Function OnTranslineRho_Button
* Shows a list of current Specific resistance list (rho) * Shows a list of current Specific resistance list (rho) and set the selected value in main
* and set the selected value in main dialog frame * dialog frame
*/ */
void OnTranslineRho_Button( wxCommandEvent& event ) override; void OnTranslineRho_Button( wxCommandEvent& event ) override;
/** /**
* Function TranslineTypeSelection * Function TranslineTypeSelection
* Must be called after selection of a new transline. * Must be called after selection of a new transline. Update all values, labels and tool
* Update all values, labels and tool tips of parameters needed * tips of parameters needed by the new transline; irrelevant parameters are blanked.
* by the new transline
* Irrelevant parameters texts are blanked.
* @param aType = the TRANSLINE_TYPE_ID of the new selected transline * @param aType = the TRANSLINE_TYPE_ID of the new selected transline
*/ */
void TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType ); void TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType );
/** /**
* Function TransfDlgDataToTranslineParams * Function TransfDlgDataToTranslineParams
* Read values entered in dialog frame, and transfert these * Read values entered in dialog frame, and transfert these values in current transline
* values in current transline parameters, converted in normalized units * parameters, converted in normalized units
*/ */
void TransfDlgDataToTranslineParams(); void TransfDlgDataToTranslineParams();
@ -352,11 +301,7 @@ private:
/** /**
* Function SelectLastSelectedRegulator * Function SelectLastSelectedRegulator
* select in choice box the last selected regulator * If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()
* (name in m_lastSelectedRegulatorName)
* and update the displayed values.
* if m_lastSelectedRegulatorName is empty, just calls
* RegulatorPageUpdate()
*/ */
void SelectLastSelectedRegulator(); void SelectLastSelectedRegulator();
@ -417,6 +362,35 @@ public:
{ {
return nullptr; return nullptr;
} }
private:
bool m_RegulatorListChanged; // Set when m_RegulatorList is modified and the corresponging file
// must be rewritten
enum // Which dimension is controlling the track width / current
{ // calculations:
TW_MASTER_CURRENT, // the maximum current,
TW_MASTER_EXT_WIDTH, // the external trace width,
TW_MASTER_INT_WIDTH // or the internal trace width?
} m_TWMode;
bool m_TWNested; // Used to stop events caused by setting the answers.
enum TRANSLINE_TYPE_ID m_currTransLineType;
TRANSLINE* m_currTransLine;
std::vector<TRANSLINE_IDENT*> m_transline_list;
ATTENUATOR* m_currAttenuator;
std::vector<ATTENUATOR*> m_attenuator_list;
wxString m_lastSelectedRegulatorName;
wxBitmap* m_ccValueNamesBitmap;
wxBitmap* m_ccValuesBitmap;
wxBitmap* m_ccMultipliersBitmap;
wxBitmap* m_ccTolerancesBitmap;
int m_lastNotebookPage;
}; };

View File

@ -42,7 +42,7 @@ wxString tracks_width_versus_current_formula =
extern double DoubleFromString( const wxString& TextValue ); extern double DoubleFromString( const wxString& TextValue );
void PCB_CALCULATOR_FRAME::TW_WriteConfig() void PCB_CALCULATOR_FRAME::writeTrackWidthConfig()
{ {
// Save current parameters values in config. // Save current parameters values in config.
auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() ); auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
@ -414,7 +414,7 @@ double PCB_CALCULATOR_FRAME::TWCalculateCurrent( double aWidth, double aThicknes
} }
void PCB_CALCULATOR_FRAME::TW_Init() void PCB_CALCULATOR_FRAME::initTrackWidthPanel()
{ {
wxString msg; wxString msg;

View File

@ -123,7 +123,7 @@ void PCB_CALCULATOR_FRAME::OnViaResetButtonClick( wxCommandEvent& event )
} }
void PCB_CALCULATOR_FRAME::VS_Init() void PCB_CALCULATOR_FRAME::initViaSizePanel()
{ {
auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() ); auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
@ -152,7 +152,8 @@ void PCB_CALCULATOR_FRAME::VS_Init()
m_textCtrlRiseTime->SetValue( cfg->m_ViaSize.pulse_rise_time ); m_textCtrlRiseTime->SetValue( cfg->m_ViaSize.pulse_rise_time );
} }
void PCB_CALCULATOR_FRAME::VS_WriteConfig()
void PCB_CALCULATOR_FRAME::writeViaSizeConfig()
{ {
auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() ); auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
@ -175,6 +176,7 @@ void PCB_CALCULATOR_FRAME::VS_WriteConfig()
cfg->m_ViaSize.pulse_rise_time = m_textCtrlRiseTime->GetValue(); cfg->m_ViaSize.pulse_rise_time = m_textCtrlRiseTime->GetValue();
} }
void PCB_CALCULATOR_FRAME::OnViaCalculate( wxCommandEvent& event ) void PCB_CALCULATOR_FRAME::OnViaCalculate( wxCommandEvent& event )
{ {
// Load parameters // Load parameters