pcb_calculator rework: move transline panel to its own files panel_transline_xx

also a small code cleanup
This commit is contained in:
jean-pierre charras 2021-10-05 17:32:31 +02:00
parent 813fd8ee0a
commit a74851bb5d
20 changed files with 6183 additions and 5961 deletions

View File

@ -21,6 +21,7 @@ set( PCB_CALCULATOR_SRCS
panel_eserie.cpp panel_eserie.cpp
panel_regulator.cpp panel_regulator.cpp
panel_track_width.cpp panel_track_width.cpp
panel_transline.cpp
panel_via_size.cpp panel_via_size.cpp
transline_ident.cpp transline_ident.cpp
widgets/unit_selector.cpp widgets/unit_selector.cpp
@ -41,10 +42,11 @@ set( PCB_CALCULATOR_SRCS
dialogs/panel_board_class_base.cpp dialogs/panel_board_class_base.cpp
dialogs/panel_regulator_base.cpp dialogs/panel_regulator_base.cpp
dialogs/panel_color_code_base.cpp dialogs/panel_color_code_base.cpp
dialogs/panel_electrical_spacing_base.cpp
dialogs/panel_eserie_base.cpp dialogs/panel_eserie_base.cpp
dialogs/panel_via_size_base.cpp dialogs/panel_via_size_base.cpp
dialogs/panel_track_width_base.cpp dialogs/panel_track_width_base.cpp
dialogs/panel_electrical_spacing_base.cpp dialogs/panel_transline_base.cpp
../common/env_vars.cpp # needed on MSW to avoid a link issue (a symbol not found) ../common/env_vars.cpp # needed on MSW to avoid a link issue (a symbol not found)
) )

View File

@ -27,7 +27,6 @@
#include <build_version.h> #include <build_version.h>
#include <class_regulator_data.h> #include <class_regulator_data.h>
#include <common.h>
#include <datafile_read_write.h> #include <datafile_read_write.h>
#include <string_utils.h> #include <string_utils.h>
#include <locale_io.h> #include <locale_io.h>

View File

@ -27,6 +27,23 @@
extern double DoubleFromString( const wxString& TextValue ); extern double DoubleFromString( const wxString& TextValue );
DIALOG_REGULATOR_FORM::DIALOG_REGULATOR_FORM( PANEL_REGULATOR* parent, const wxString& aRegName ) :
DIALOG_REGULATOR_FORM_BASE( parent )
{
m_textCtrlName->SetValue( aRegName );
m_textCtrlName->Enable( aRegName.IsEmpty() );
UpdateDialog();
m_sdbSizerOK->SetDefault();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
DIALOG_REGULATOR_FORM::~DIALOG_REGULATOR_FORM()
{
}
bool DIALOG_REGULATOR_FORM::TransferDataFromWindow() bool DIALOG_REGULATOR_FORM::TransferDataFromWindow()
{ {

View File

@ -39,20 +39,9 @@ class REGULATOR_DATA;
class DIALOG_REGULATOR_FORM : public DIALOG_REGULATOR_FORM_BASE class DIALOG_REGULATOR_FORM : public DIALOG_REGULATOR_FORM_BASE
{ {
public: public:
DIALOG_REGULATOR_FORM( PANEL_REGULATOR* parent, const wxString& aRegName ) DIALOG_REGULATOR_FORM( PANEL_REGULATOR* parent, const wxString& aRegName );
: DIALOG_REGULATOR_FORM_BASE( parent )
{
m_textCtrlName->SetValue( aRegName );
m_textCtrlName->Enable( aRegName.IsEmpty() );
UpdateDialog();
m_sdbSizerOK->SetDefault(); ~DIALOG_REGULATOR_FORM();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
~DIALOG_REGULATOR_FORM(){};
/** /**
* @return true if regulator parameters are acceptable. * @return true if regulator parameters are acceptable.

View File

@ -0,0 +1,146 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* 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 Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PANEL_TRANSLINE_H
#define PANEL_TRANSLINE_H
#include "panel_transline_base.h"
#include <transline/transline.h>
#include "transline_ident.h"
class PCB_CALCULATOR_SETTINGS;
class PANEL_TRANSLINE : public PANEL_TRANSLINE_BASE
{
public:
PANEL_TRANSLINE( wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_TRANSLINE();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Accessors:
wxRadioBox* GetTranslineSelector() { return m_TranslineSelection; }
TRANSLINE_TYPE_ID GetCurrTransLineType() { return m_currTransLineType; }
/**
* Read/write params values and results.
*
* @param aPrmId is the parameter id to write.
* @param aValue is the value to write.
*/
void SetPrmValue( enum PRMS_ID aPrmId, double aValue );
/**
* Put the text into the given result line.
*
* @param aLineNumber is the line (0 to 5) where to display the text.
* @param aText is the text to display.
*/
void SetResult( int aLineNumber, const wxString& aText );
/**
* Set the background color of a parameter.
*
* @param aPrmId is the parameter id to set.
* @param aCol is the new color.
*/
void SetPrmBgColor( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol );
/**
* Return a param value.
*
* @param aPrmId is the parameter id to write.
* @return the value always in normalized unit (meter, Hz, Ohm, radian).
*/
double GetPrmValue( enum PRMS_ID aPrmId ) const;
/**
* @return true if the parameter aPrmId is selected.
*/
bool IsPrmSelected( enum PRMS_ID aPrmId ) const;
/**
* Called on new transmission line selection.
*/
void OnTranslineSelection( wxCommandEvent& event ) override;
/**
* Called when the user clicks the reset button; sets the parameters to their default values.
*/
void OnTransLineResetButtonClick( wxCommandEvent& event ) override;
/**
* Run a new analyze for the current transline with current parameters and displays the
* electrical parameters.
*/
void OnTranslineAnalyse( wxCommandEvent& event ) override;
/**
* Run a new synthesis for the current transline with current parameters and displays the
* geometrical parameters.
*/
void OnTranslineSynthetize( wxCommandEvent& event ) override;
/**
* Shows a list of current relative dielectric constant(Er) and set the selected value in
* main dialog frame.
*/
void OnTranslineEpsilonR_Button( wxCommandEvent& event ) override;
/**
* Show a list of current dielectric loss factor (tangent delta) and set the selected value
* in main dialog frame.
*/
void OnTranslineTanD_Button( wxCommandEvent& event ) override;
/**
* Show a list of current Specific resistance list (rho) and set the selected value in main
* dialog frame.
*/
void OnTranslineRho_Button( wxCommandEvent& event ) override;
/**
* Must be called after selection of a new transline.
*
* Update all values, labels and tool tips of parameters needed by the new transline;
* irrelevant parameters are blanked.
*
* @param aType is the #TRANSLINE_TYPE_ID of the new selected transmission line.
*/
void TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType );
/**
* Read values entered in dialog frame, and transfer these values in current transline
* parameters, converted in normalized units.
*/
void TransfDlgDataToTranslineParams();
private:
TRANSLINE* m_currTransLine;
std::vector<TRANSLINE_IDENT*> m_transline_list;
enum TRANSLINE_TYPE_ID m_currTransLineType;
};
#endif

View File

@ -0,0 +1,498 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/unit_selector.h"
#include "panel_transline_base.h"
///////////////////////////////////////////////////////////////////////////
PANEL_TRANSLINE_BASE::PANEL_TRANSLINE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizeTransline;
bSizeTransline = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxString m_TranslineSelectionChoices[] = { _("Microstrip Line"), _("Coplanar wave guide"), _("Coplanar wave guide w/ ground plane"), _("Rectangular Waveguide"), _("Coaxial Line"), _("Coupled Microstrip Line"), _("Stripline"), _("Twisted Pair") };
int m_TranslineSelectionNChoices = sizeof( m_TranslineSelectionChoices ) / sizeof( wxString );
m_TranslineSelection = new wxRadioBox( this, wxID_ANY, _("Transmission Line Type"), wxDefaultPosition, wxDefaultSize, m_TranslineSelectionNChoices, m_TranslineSelectionChoices, 1, wxRA_SPECIFY_COLS );
m_TranslineSelection->SetSelection( 2 );
bLeftSizer->Add( m_TranslineSelection, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bLeftSizer->Add( 0, 5, 0, wxEXPAND, 5 );
m_translineBitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_translineBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 );
bSizeTransline->Add( bLeftSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bMiddleSizer;
bMiddleSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSubstrateBoxSizer;
sbSubstrateBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Substrate Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerSubstPrms;
fgSizerSubstPrms = new wxFlexGridSizer( 9, 3, 3, 0 );
fgSizerSubstPrms->AddGrowableCol( 1 );
fgSizerSubstPrms->SetFlexibleDirection( wxBOTH );
fgSizerSubstPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_EpsilonR_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Er:"), wxDefaultPosition, wxDefaultSize, 0 );
m_EpsilonR_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_EpsilonR_label, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
wxBoxSizer* bSizer441;
bSizer441 = new wxBoxSizer( wxHORIZONTAL );
m_Value_EpsilonR = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer441->Add( m_Value_EpsilonR, 1, wxEXPAND|wxLEFT, 5 );
m_button_EpsilonR = new wxButton( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer441->Add( m_button_EpsilonR, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerSubstPrms->Add( bSizer441, 1, wxEXPAND, 5 );
fgSizerSubstPrms->Add( 0, 0, 1, wxEXPAND, 5 );
m_TanD_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Tan delta:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TanD_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_TanD_label, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
wxBoxSizer* bSizer442;
bSizer442 = new wxBoxSizer( wxHORIZONTAL );
m_Value_TanD = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer442->Add( m_Value_TanD, 1, wxEXPAND|wxLEFT, 5 );
m_button_TanD = new wxButton( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer442->Add( m_button_TanD, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerSubstPrms->Add( bSizer442, 1, wxEXPAND, 5 );
fgSizerSubstPrms->Add( 0, 0, 1, wxEXPAND, 5 );
m_Rho_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Rho:"), wxDefaultPosition, wxDefaultSize, 0 );
m_Rho_label->Wrap( -1 );
m_Rho_label->SetToolTip( _("Specific resistance in ohms * meters") );
fgSizerSubstPrms->Add( m_Rho_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer443;
bSizer443 = new wxBoxSizer( wxHORIZONTAL );
m_Value_Rho = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer443->Add( m_Value_Rho, 1, wxEXPAND|wxLEFT, 5 );
m_button_Rho = new wxButton( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer443->Add( m_button_Rho, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerSubstPrms->Add( bSizer443, 1, wxEXPAND, 5 );
fgSizerSubstPrms->Add( 0, 0, 1, wxEXPAND, 5 );
m_substrate_prm4_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("H:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm4_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm4_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm4_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm4_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm4_choiceUnitChoices;
m_SubsPrm4_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm4_choiceUnitChoices, 0 );
m_SubsPrm4_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm4_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm5_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("H_t:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm5_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm5_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm5_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm5_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm5_choiceUnitChoices;
m_SubsPrm5_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm5_choiceUnitChoices, 0 );
m_SubsPrm5_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm5_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm6_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("T:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm6_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm6_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm6_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm6_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm6_choiceUnitChoices;
m_SubsPrm6_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm6_choiceUnitChoices, 0 );
m_SubsPrm6_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm6_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm7_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Rough:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm7_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm7_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm7_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm7_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm7_choiceUnitChoices;
m_SubsPrm7_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm7_choiceUnitChoices, 0 );
m_SubsPrm7_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm7_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm8_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Insulator mu:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm8_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm8_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm8_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm8_Value, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm8_choiceUnitChoices;
m_SubsPrm8_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm8_choiceUnitChoices, 0 );
m_SubsPrm8_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm8_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm9_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Conductor mu:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm9_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm9_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Substrate_prm9_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm9_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm9_choiceUnitChoices;
m_SubsPrm9_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm9_choiceUnitChoices, 0 );
m_SubsPrm9_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm9_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSubstrateBoxSizer->Add( fgSizerSubstPrms, 1, wxEXPAND|wxBOTTOM, 5 );
bMiddleSizer->Add( sbSubstrateBoxSizer, 0, wxEXPAND|wxBOTTOM, 5 );
wxStaticBoxSizer* sbCmpPrmsSizer;
sbCmpPrmsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizeCmpPrms;
fgSizeCmpPrms = new wxFlexGridSizer( 1, 3, 0, 0 );
fgSizeCmpPrms->AddGrowableCol( 1 );
fgSizeCmpPrms->SetFlexibleDirection( wxBOTH );
fgSizeCmpPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_Frequency_label = new wxStaticText( sbCmpPrmsSizer->GetStaticBox(), wxID_ANY, _("Frequency:"), wxDefaultPosition, wxDefaultSize, 0 );
m_Frequency_label->Wrap( -1 );
fgSizeCmpPrms->Add( m_Frequency_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Value_Frequency_Ctrl = new wxTextCtrl( sbCmpPrmsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeCmpPrms->Add( m_Value_Frequency_Ctrl, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxArrayString m_choiceUnit_FrequencyChoices;
m_choiceUnit_Frequency = new UNIT_SELECTOR_FREQUENCY( sbCmpPrmsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_FrequencyChoices, 0 );
m_choiceUnit_Frequency->SetSelection( 0 );
fgSizeCmpPrms->Add( m_choiceUnit_Frequency, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbCmpPrmsSizer->Add( fgSizeCmpPrms, 0, wxEXPAND|wxBOTTOM, 5 );
bMiddleSizer->Add( sbCmpPrmsSizer, 0, wxEXPAND|wxTOP, 5 );
wxBoxSizer* bSizerHelpBitmaps;
bSizerHelpBitmaps = new wxBoxSizer( wxVERTICAL );
m_bmCMicrostripZoddZeven = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerHelpBitmaps->Add( m_bmCMicrostripZoddZeven, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 );
m_fgSizerZcomment = new wxFlexGridSizer( 0, 2, 0, 15 );
m_fgSizerZcomment->AddGrowableCol( 0 );
m_fgSizerZcomment->AddGrowableCol( 1 );
m_fgSizerZcomment->SetFlexibleDirection( wxBOTH );
m_fgSizerZcomment->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextZdiff = new wxStaticText( this, wxID_ANY, _("Zdiff =\n2*Z0( (1 - 0.48exp( -0.96*S/H ) )"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextZdiff->Wrap( -1 );
m_staticTextZdiff->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_fgSizerZcomment->Add( m_staticTextZdiff, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextZcommon = new wxStaticText( this, wxID_ANY, _("Zcommon = Zeven / 2"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextZcommon->Wrap( -1 );
m_staticTextZcommon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_fgSizerZcomment->Add( m_staticTextZcommon, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
bSizerHelpBitmaps->Add( m_fgSizerZcomment, 0, wxEXPAND, 5 );
bMiddleSizer->Add( bSizerHelpBitmaps, 1, wxALIGN_CENTER_HORIZONTAL, 5 );
bSizeTransline->Add( bMiddleSizer, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* btranslineRightSizer;
btranslineRightSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Physical Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerPhysPrms;
fgSizerPhysPrms = new wxFlexGridSizer( 4, 4, 3, 0 );
fgSizerPhysPrms->AddGrowableCol( 1 );
fgSizerPhysPrms->SetFlexibleDirection( wxBOTH );
fgSizerPhysPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_phys_prm1_label = new wxStaticText( btranslineRightSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_phys_prm1_label->Wrap( -1 );
fgSizerPhysPrms->Add( m_phys_prm1_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Phys_prm1_Value = new wxTextCtrl( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_Phys_prm1_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_Param1Choices;
m_choiceUnit_Param1 = new UNIT_SELECTOR_LEN( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_Param1Choices, 0 );
m_choiceUnit_Param1->SetSelection( 0 );
fgSizerPhysPrms->Add( m_choiceUnit_Param1, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_radioBtnPrm1 = new wxRadioButton( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
fgSizerPhysPrms->Add( m_radioBtnPrm1, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_phys_prm2_label = new wxStaticText( btranslineRightSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_phys_prm2_label->Wrap( -1 );
fgSizerPhysPrms->Add( m_phys_prm2_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Phys_prm2_Value = new wxTextCtrl( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_Phys_prm2_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_Param2Choices;
m_choiceUnit_Param2 = new UNIT_SELECTOR_LEN( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_Param2Choices, 0 );
m_choiceUnit_Param2->SetSelection( 0 );
fgSizerPhysPrms->Add( m_choiceUnit_Param2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_radioBtnPrm2 = new wxRadioButton( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_radioBtnPrm2, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_phys_prm3_label = new wxStaticText( btranslineRightSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_phys_prm3_label->Wrap( -1 );
fgSizerPhysPrms->Add( m_phys_prm3_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Phys_prm3_Value = new wxTextCtrl( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_Phys_prm3_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_Param3Choices;
m_choiceUnit_Param3 = new UNIT_SELECTOR_LEN( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_Param3Choices, 0 );
m_choiceUnit_Param3->SetSelection( 0 );
fgSizerPhysPrms->Add( m_choiceUnit_Param3, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerPhysPrms->Add( 0, 0, 0, 0, 5 );
btranslineRightSizer->Add( fgSizerPhysPrms, 0, wxEXPAND|wxBOTTOM, 5 );
bRightSizer->Add( btranslineRightSizer, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* btranslineButtonsSizer;
btranslineButtonsSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_bpButtonAnalyze = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizerButtons->Add( m_bpButtonAnalyze, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_AnalyseButton = new wxButton( this, wxID_ANY, _("Analyze"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_AnalyseButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_SynthetizeButton = new wxButton( this, wxID_ANY, _("Synthesize"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_SynthetizeButton, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_bpButtonSynthetize = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizerButtons->Add( m_bpButtonSynthetize, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
btranslineButtonsSizer->Add( bSizerButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
bRightSizer->Add( btranslineButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
wxStaticBoxSizer* sbElectricalResultsSizer;
sbElectricalResultsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Electrical Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerResults;
fgSizerResults = new wxFlexGridSizer( 3, 3, 3, 0 );
fgSizerResults->AddGrowableCol( 1 );
fgSizerResults->SetFlexibleDirection( wxBOTH );
fgSizerResults->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_elec_prm1_label = new wxStaticText( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
m_elec_prm1_label->Wrap( -1 );
fgSizerResults->Add( m_elec_prm1_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Elec_prm1_Value = new wxTextCtrl( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerResults->Add( m_Elec_prm1_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_ElecPrm1Choices;
m_choiceUnit_ElecPrm1 = new UNIT_SELECTOR_RESISTOR( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_ElecPrm1Choices, 0 );
m_choiceUnit_ElecPrm1->SetSelection( 0 );
fgSizerResults->Add( m_choiceUnit_ElecPrm1, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_elec_prm2_label = new wxStaticText( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
m_elec_prm2_label->Wrap( -1 );
fgSizerResults->Add( m_elec_prm2_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Elec_prm2_Value = new wxTextCtrl( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerResults->Add( m_Elec_prm2_Value, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_ElecPrm2Choices;
m_choiceUnit_ElecPrm2 = new UNIT_SELECTOR_RESISTOR( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_ElecPrm2Choices, 0 );
m_choiceUnit_ElecPrm2->SetSelection( 0 );
fgSizerResults->Add( m_choiceUnit_ElecPrm2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_elec_prm3_label = new wxStaticText( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_elec_prm3_label->Wrap( -1 );
fgSizerResults->Add( m_elec_prm3_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Elec_prm3_Value = new wxTextCtrl( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerResults->Add( m_Elec_prm3_Value, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_ElecPrm3Choices;
m_choiceUnit_ElecPrm3 = new UNIT_SELECTOR_ANGLE( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_ElecPrm3Choices, 0 );
m_choiceUnit_ElecPrm3->SetSelection( 0 );
fgSizerResults->Add( m_choiceUnit_ElecPrm3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbElectricalResultsSizer->Add( fgSizerResults, 0, wxEXPAND|wxBOTTOM, 5 );
bRightSizer->Add( sbElectricalResultsSizer, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbMessagesSizer;
sbMessagesSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Results") ), wxVERTICAL );
wxFlexGridSizer* fgSizerTranslResults;
fgSizerTranslResults = new wxFlexGridSizer( 8, 2, 0, 0 );
fgSizerTranslResults->AddGrowableCol( 1 );
fgSizerTranslResults->SetFlexibleDirection( wxBOTH );
fgSizerTranslResults->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_left_message1 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message1->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message1, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message1 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message1->Wrap( -1 );
fgSizerTranslResults->Add( m_Message1, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message2 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message2->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message2, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message2 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message2->Wrap( -1 );
fgSizerTranslResults->Add( m_Message2, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_left_message3 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message3->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message3, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message3 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message3->Wrap( -1 );
fgSizerTranslResults->Add( m_Message3, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message4 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message4->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message4, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message4 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message4->Wrap( -1 );
fgSizerTranslResults->Add( m_Message4, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message5 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message5->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxALIGN_RIGHT, 5 );
m_Message5 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message5->Wrap( -1 );
fgSizerTranslResults->Add( m_Message5, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message6 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message6->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message6, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message6 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message6->Wrap( -1 );
fgSizerTranslResults->Add( m_Message6, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message7 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message7->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message7, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message7 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message7->Wrap( -1 );
fgSizerTranslResults->Add( m_Message7, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message8 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message8->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message8, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_Message8 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message8->Wrap( -1 );
fgSizerTranslResults->Add( m_Message8, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
sbMessagesSizer->Add( fgSizerTranslResults, 1, wxEXPAND, 5 );
bRightSizer->Add( sbMessagesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_buttonTransLineReset = new wxButton( this, wxID_ANY, _("Reset to Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_buttonTransLineReset, 0, wxALIGN_RIGHT|wxALL, 5 );
bSizeTransline->Add( bRightSizer, 1, wxEXPAND, 5 );
this->SetSizer( bSizeTransline );
this->Layout();
// Connect Events
m_TranslineSelection->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineSelection ), NULL, this );
m_button_EpsilonR->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineEpsilonR_Button ), NULL, this );
m_button_TanD->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineTanD_Button ), NULL, this );
m_button_Rho->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineRho_Button ), NULL, this );
m_bpButtonAnalyze->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineAnalyse ), NULL, this );
m_AnalyseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineAnalyse ), NULL, this );
m_SynthetizeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineSynthetize ), NULL, this );
m_bpButtonSynthetize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineSynthetize ), NULL, this );
m_buttonTransLineReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTransLineResetButtonClick ), NULL, this );
}
PANEL_TRANSLINE_BASE::~PANEL_TRANSLINE_BASE()
{
// Disconnect Events
m_TranslineSelection->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineSelection ), NULL, this );
m_button_EpsilonR->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineEpsilonR_Button ), NULL, this );
m_button_TanD->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineTanD_Button ), NULL, this );
m_button_Rho->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineRho_Button ), NULL, this );
m_bpButtonAnalyze->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineAnalyse ), NULL, this );
m_AnalyseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineAnalyse ), NULL, this );
m_SynthetizeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineSynthetize ), NULL, this );
m_bpButtonSynthetize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTranslineSynthetize ), NULL, this );
m_buttonTransLineReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TRANSLINE_BASE::OnTransLineResetButtonClick ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,143 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class UNIT_SELECTOR_ANGLE;
class UNIT_SELECTOR_FREQUENCY;
class UNIT_SELECTOR_LEN;
class UNIT_SELECTOR_RESISTOR;
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/statbox.h>
#include <wx/radiobut.h>
#include <wx/bmpbuttn.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_TRANSLINE_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_TRANSLINE_BASE : public wxPanel
{
private:
protected:
wxRadioBox* m_TranslineSelection;
wxStaticBitmap* m_translineBitmap;
wxStaticText* m_EpsilonR_label;
wxTextCtrl* m_Value_EpsilonR;
wxButton* m_button_EpsilonR;
wxStaticText* m_TanD_label;
wxTextCtrl* m_Value_TanD;
wxButton* m_button_TanD;
wxStaticText* m_Rho_label;
wxTextCtrl* m_Value_Rho;
wxButton* m_button_Rho;
wxStaticText* m_substrate_prm4_label;
wxTextCtrl* m_Substrate_prm4_Value;
UNIT_SELECTOR_LEN* m_SubsPrm4_choiceUnit;
wxStaticText* m_substrate_prm5_label;
wxTextCtrl* m_Substrate_prm5_Value;
UNIT_SELECTOR_LEN* m_SubsPrm5_choiceUnit;
wxStaticText* m_substrate_prm6_label;
wxTextCtrl* m_Substrate_prm6_Value;
UNIT_SELECTOR_LEN* m_SubsPrm6_choiceUnit;
wxStaticText* m_substrate_prm7_label;
wxTextCtrl* m_Substrate_prm7_Value;
UNIT_SELECTOR_LEN* m_SubsPrm7_choiceUnit;
wxStaticText* m_substrate_prm8_label;
wxTextCtrl* m_Substrate_prm8_Value;
UNIT_SELECTOR_LEN* m_SubsPrm8_choiceUnit;
wxStaticText* m_substrate_prm9_label;
wxTextCtrl* m_Substrate_prm9_Value;
UNIT_SELECTOR_LEN* m_SubsPrm9_choiceUnit;
wxStaticText* m_Frequency_label;
wxTextCtrl* m_Value_Frequency_Ctrl;
UNIT_SELECTOR_FREQUENCY* m_choiceUnit_Frequency;
wxStaticBitmap* m_bmCMicrostripZoddZeven;
wxFlexGridSizer* m_fgSizerZcomment;
wxStaticText* m_staticTextZdiff;
wxStaticText* m_staticTextZcommon;
wxStaticText* m_phys_prm1_label;
wxTextCtrl* m_Phys_prm1_Value;
UNIT_SELECTOR_LEN* m_choiceUnit_Param1;
wxRadioButton* m_radioBtnPrm1;
wxStaticText* m_phys_prm2_label;
wxTextCtrl* m_Phys_prm2_Value;
UNIT_SELECTOR_LEN* m_choiceUnit_Param2;
wxRadioButton* m_radioBtnPrm2;
wxStaticText* m_phys_prm3_label;
wxTextCtrl* m_Phys_prm3_Value;
UNIT_SELECTOR_LEN* m_choiceUnit_Param3;
wxBitmapButton* m_bpButtonAnalyze;
wxButton* m_AnalyseButton;
wxButton* m_SynthetizeButton;
wxBitmapButton* m_bpButtonSynthetize;
wxStaticText* m_elec_prm1_label;
wxTextCtrl* m_Elec_prm1_Value;
UNIT_SELECTOR_RESISTOR* m_choiceUnit_ElecPrm1;
wxStaticText* m_elec_prm2_label;
wxTextCtrl* m_Elec_prm2_Value;
UNIT_SELECTOR_RESISTOR* m_choiceUnit_ElecPrm2;
wxStaticText* m_elec_prm3_label;
wxTextCtrl* m_Elec_prm3_Value;
UNIT_SELECTOR_ANGLE* m_choiceUnit_ElecPrm3;
wxStaticText* m_left_message1;
wxStaticText* m_Message1;
wxStaticText* m_left_message2;
wxStaticText* m_Message2;
wxStaticText* m_left_message3;
wxStaticText* m_Message3;
wxStaticText* m_left_message4;
wxStaticText* m_Message4;
wxStaticText* m_left_message5;
wxStaticText* m_Message5;
wxStaticText* m_left_message6;
wxStaticText* m_Message6;
wxStaticText* m_left_message7;
wxStaticText* m_Message7;
wxStaticText* m_left_message8;
wxStaticText* m_Message8;
wxButton* m_buttonTransLineReset;
// Virtual event handlers, overide them in your derived class
virtual void OnTranslineSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineEpsilonR_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineTanD_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineRho_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineAnalyse( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineSynthetize( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTransLineResetButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
PANEL_TRANSLINE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 724,460 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_TRANSLINE_BASE();
};

View File

@ -5,8 +5,6 @@
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "widgets/unit_selector.h"
#include "pcb_calculator_frame_base.h" #include "pcb_calculator_frame_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -30,464 +28,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_Notebook->AddPage( m_panelESeries, _("E-Series"), false ); m_Notebook->AddPage( m_panelESeries, _("E-Series"), false );
m_panelColorCode = new PANEL_COLOR_CODE( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelColorCode = new PANEL_COLOR_CODE( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_Notebook->AddPage( m_panelColorCode, _("Color Code"), false ); m_Notebook->AddPage( m_panelColorCode, _("Color Code"), false );
m_panelTransline = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelTransline = new PANEL_TRANSLINE( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizeTransline;
bSizeTransline = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxString m_TranslineSelectionChoices[] = { _("Microstrip Line"), _("Coplanar wave guide"), _("Coplanar wave guide w/ ground plane"), _("Rectangular Waveguide"), _("Coaxial Line"), _("Coupled Microstrip Line"), _("Stripline"), _("Twisted Pair") };
int m_TranslineSelectionNChoices = sizeof( m_TranslineSelectionChoices ) / sizeof( wxString );
m_TranslineSelection = new wxRadioBox( m_panelTransline, wxID_ANY, _("Transmission Line Type"), wxDefaultPosition, wxDefaultSize, m_TranslineSelectionNChoices, m_TranslineSelectionChoices, 1, wxRA_SPECIFY_COLS );
m_TranslineSelection->SetSelection( 2 );
bLeftSizer->Add( m_TranslineSelection, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bLeftSizer->Add( 0, 5, 0, wxEXPAND, 5 );
m_translineBitmap = new wxStaticBitmap( m_panelTransline, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_translineBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 );
bSizeTransline->Add( bLeftSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bMiddleSizer;
bMiddleSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSubstrateBoxSizer;
sbSubstrateBoxSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelTransline, wxID_ANY, _("Substrate Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerSubstPrms;
fgSizerSubstPrms = new wxFlexGridSizer( 9, 3, 3, 0 );
fgSizerSubstPrms->AddGrowableCol( 1 );
fgSizerSubstPrms->SetFlexibleDirection( wxBOTH );
fgSizerSubstPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_EpsilonR_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Er:"), wxDefaultPosition, wxDefaultSize, 0 );
m_EpsilonR_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_EpsilonR_label, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
wxBoxSizer* bSizer441;
bSizer441 = new wxBoxSizer( wxHORIZONTAL );
m_Value_EpsilonR = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer441->Add( m_Value_EpsilonR, 1, wxEXPAND|wxLEFT, 5 );
m_button_EpsilonR = new wxButton( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer441->Add( m_button_EpsilonR, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerSubstPrms->Add( bSizer441, 1, wxEXPAND, 5 );
fgSizerSubstPrms->Add( 0, 0, 1, wxEXPAND, 5 );
m_TanD_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Tan delta:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TanD_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_TanD_label, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
wxBoxSizer* bSizer442;
bSizer442 = new wxBoxSizer( wxHORIZONTAL );
m_Value_TanD = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer442->Add( m_Value_TanD, 1, wxEXPAND|wxLEFT, 5 );
m_button_TanD = new wxButton( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer442->Add( m_button_TanD, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerSubstPrms->Add( bSizer442, 1, wxEXPAND, 5 );
fgSizerSubstPrms->Add( 0, 0, 1, wxEXPAND, 5 );
m_Rho_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Rho:"), wxDefaultPosition, wxDefaultSize, 0 );
m_Rho_label->Wrap( -1 );
m_Rho_label->SetToolTip( _("Specific resistance in ohms * meters") );
fgSizerSubstPrms->Add( m_Rho_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer443;
bSizer443 = new wxBoxSizer( wxHORIZONTAL );
m_Value_Rho = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer443->Add( m_Value_Rho, 1, wxEXPAND|wxLEFT, 5 );
m_button_Rho = new wxButton( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer443->Add( m_button_Rho, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerSubstPrms->Add( bSizer443, 1, wxEXPAND, 5 );
fgSizerSubstPrms->Add( 0, 0, 1, wxEXPAND, 5 );
m_substrate_prm4_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("H:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm4_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm4_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm4_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm4_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm4_choiceUnitChoices;
m_SubsPrm4_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm4_choiceUnitChoices, 0 );
m_SubsPrm4_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm4_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm5_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("H_t:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm5_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm5_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm5_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm5_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm5_choiceUnitChoices;
m_SubsPrm5_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm5_choiceUnitChoices, 0 );
m_SubsPrm5_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm5_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm6_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("T:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm6_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm6_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm6_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm6_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm6_choiceUnitChoices;
m_SubsPrm6_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm6_choiceUnitChoices, 0 );
m_SubsPrm6_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm6_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm7_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Rough:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm7_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm7_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm7_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm7_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm7_choiceUnitChoices;
m_SubsPrm7_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm7_choiceUnitChoices, 0 );
m_SubsPrm7_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm7_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm8_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Insulator mu:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm8_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm8_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Substrate_prm8_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm8_Value, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm8_choiceUnitChoices;
m_SubsPrm8_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm8_choiceUnitChoices, 0 );
m_SubsPrm8_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm8_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_substrate_prm9_label = new wxStaticText( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, _("Conductor mu:"), wxDefaultPosition, wxDefaultSize, 0 );
m_substrate_prm9_label->Wrap( -1 );
fgSizerSubstPrms->Add( m_substrate_prm9_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Substrate_prm9_Value = new wxTextCtrl( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerSubstPrms->Add( m_Substrate_prm9_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_SubsPrm9_choiceUnitChoices;
m_SubsPrm9_choiceUnit = new UNIT_SELECTOR_LEN( sbSubstrateBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SubsPrm9_choiceUnitChoices, 0 );
m_SubsPrm9_choiceUnit->SetSelection( 0 );
fgSizerSubstPrms->Add( m_SubsPrm9_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSubstrateBoxSizer->Add( fgSizerSubstPrms, 1, wxEXPAND|wxBOTTOM, 5 );
bMiddleSizer->Add( sbSubstrateBoxSizer, 0, wxEXPAND|wxBOTTOM, 5 );
wxStaticBoxSizer* sbCmpPrmsSizer;
sbCmpPrmsSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelTransline, wxID_ANY, _("Component Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizeCmpPrms;
fgSizeCmpPrms = new wxFlexGridSizer( 1, 3, 0, 0 );
fgSizeCmpPrms->AddGrowableCol( 1 );
fgSizeCmpPrms->SetFlexibleDirection( wxBOTH );
fgSizeCmpPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_Frequency_label = new wxStaticText( sbCmpPrmsSizer->GetStaticBox(), wxID_ANY, _("Frequency:"), wxDefaultPosition, wxDefaultSize, 0 );
m_Frequency_label->Wrap( -1 );
fgSizeCmpPrms->Add( m_Frequency_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Value_Frequency_Ctrl = new wxTextCtrl( sbCmpPrmsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeCmpPrms->Add( m_Value_Frequency_Ctrl, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxArrayString m_choiceUnit_FrequencyChoices;
m_choiceUnit_Frequency = new UNIT_SELECTOR_FREQUENCY( sbCmpPrmsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_FrequencyChoices, 0 );
m_choiceUnit_Frequency->SetSelection( 0 );
fgSizeCmpPrms->Add( m_choiceUnit_Frequency, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbCmpPrmsSizer->Add( fgSizeCmpPrms, 0, wxEXPAND|wxBOTTOM, 5 );
bMiddleSizer->Add( sbCmpPrmsSizer, 0, wxEXPAND|wxTOP, 5 );
wxBoxSizer* bSizerHelpBitmaps;
bSizerHelpBitmaps = new wxBoxSizer( wxVERTICAL );
m_bmCMicrostripZoddZeven = new wxStaticBitmap( m_panelTransline, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerHelpBitmaps->Add( m_bmCMicrostripZoddZeven, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 );
m_fgSizerZcomment = new wxFlexGridSizer( 0, 2, 0, 15 );
m_fgSizerZcomment->AddGrowableCol( 0 );
m_fgSizerZcomment->AddGrowableCol( 1 );
m_fgSizerZcomment->SetFlexibleDirection( wxBOTH );
m_fgSizerZcomment->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextZdiff = new wxStaticText( m_panelTransline, wxID_ANY, _("Zdiff =\n2*Z0( (1 - 0.48exp( -0.96*S/H ) )"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextZdiff->Wrap( -1 );
m_staticTextZdiff->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_fgSizerZcomment->Add( m_staticTextZdiff, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextZcommon = new wxStaticText( m_panelTransline, wxID_ANY, _("Zcommon = Zeven / 2"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextZcommon->Wrap( -1 );
m_staticTextZcommon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_fgSizerZcomment->Add( m_staticTextZcommon, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
bSizerHelpBitmaps->Add( m_fgSizerZcomment, 0, wxEXPAND, 5 );
bMiddleSizer->Add( bSizerHelpBitmaps, 1, wxALIGN_CENTER_HORIZONTAL, 5 );
bSizeTransline->Add( bMiddleSizer, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* btranslineRightSizer;
btranslineRightSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelTransline, wxID_ANY, _("Physical Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerPhysPrms;
fgSizerPhysPrms = new wxFlexGridSizer( 4, 4, 3, 0 );
fgSizerPhysPrms->AddGrowableCol( 1 );
fgSizerPhysPrms->SetFlexibleDirection( wxBOTH );
fgSizerPhysPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_phys_prm1_label = new wxStaticText( btranslineRightSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_phys_prm1_label->Wrap( -1 );
fgSizerPhysPrms->Add( m_phys_prm1_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Phys_prm1_Value = new wxTextCtrl( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_Phys_prm1_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_Param1Choices;
m_choiceUnit_Param1 = new UNIT_SELECTOR_LEN( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_Param1Choices, 0 );
m_choiceUnit_Param1->SetSelection( 0 );
fgSizerPhysPrms->Add( m_choiceUnit_Param1, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_radioBtnPrm1 = new wxRadioButton( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
fgSizerPhysPrms->Add( m_radioBtnPrm1, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_phys_prm2_label = new wxStaticText( btranslineRightSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_phys_prm2_label->Wrap( -1 );
fgSizerPhysPrms->Add( m_phys_prm2_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Phys_prm2_Value = new wxTextCtrl( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_Phys_prm2_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_Param2Choices;
m_choiceUnit_Param2 = new UNIT_SELECTOR_LEN( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_Param2Choices, 0 );
m_choiceUnit_Param2->SetSelection( 0 );
fgSizerPhysPrms->Add( m_choiceUnit_Param2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_radioBtnPrm2 = new wxRadioButton( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_radioBtnPrm2, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_phys_prm3_label = new wxStaticText( btranslineRightSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_phys_prm3_label->Wrap( -1 );
fgSizerPhysPrms->Add( m_phys_prm3_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Phys_prm3_Value = new wxTextCtrl( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPhysPrms->Add( m_Phys_prm3_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_Param3Choices;
m_choiceUnit_Param3 = new UNIT_SELECTOR_LEN( btranslineRightSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_Param3Choices, 0 );
m_choiceUnit_Param3->SetSelection( 0 );
fgSizerPhysPrms->Add( m_choiceUnit_Param3, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerPhysPrms->Add( 0, 0, 0, 0, 5 );
btranslineRightSizer->Add( fgSizerPhysPrms, 0, wxEXPAND|wxBOTTOM, 5 );
bRightSizer->Add( btranslineRightSizer, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* btranslineButtonsSizer;
btranslineButtonsSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_bpButtonAnalyze = new wxBitmapButton( m_panelTransline, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizerButtons->Add( m_bpButtonAnalyze, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_AnalyseButton = new wxButton( m_panelTransline, wxID_ANY, _("Analyze"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_AnalyseButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_SynthetizeButton = new wxButton( m_panelTransline, wxID_ANY, _("Synthesize"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_SynthetizeButton, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_bpButtonSynthetize = new wxBitmapButton( m_panelTransline, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizerButtons->Add( m_bpButtonSynthetize, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
btranslineButtonsSizer->Add( bSizerButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
bRightSizer->Add( btranslineButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
wxStaticBoxSizer* sbElectricalResultsSizer;
sbElectricalResultsSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelTransline, wxID_ANY, _("Electrical Parameters") ), wxVERTICAL );
wxFlexGridSizer* fgSizerResults;
fgSizerResults = new wxFlexGridSizer( 3, 3, 3, 0 );
fgSizerResults->AddGrowableCol( 1 );
fgSizerResults->SetFlexibleDirection( wxBOTH );
fgSizerResults->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_elec_prm1_label = new wxStaticText( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
m_elec_prm1_label->Wrap( -1 );
fgSizerResults->Add( m_elec_prm1_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Elec_prm1_Value = new wxTextCtrl( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerResults->Add( m_Elec_prm1_Value, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_ElecPrm1Choices;
m_choiceUnit_ElecPrm1 = new UNIT_SELECTOR_RESISTOR( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_ElecPrm1Choices, 0 );
m_choiceUnit_ElecPrm1->SetSelection( 0 );
fgSizerResults->Add( m_choiceUnit_ElecPrm1, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_elec_prm2_label = new wxStaticText( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
m_elec_prm2_label->Wrap( -1 );
fgSizerResults->Add( m_elec_prm2_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_Elec_prm2_Value = new wxTextCtrl( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerResults->Add( m_Elec_prm2_Value, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_ElecPrm2Choices;
m_choiceUnit_ElecPrm2 = new UNIT_SELECTOR_RESISTOR( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_ElecPrm2Choices, 0 );
m_choiceUnit_ElecPrm2->SetSelection( 0 );
fgSizerResults->Add( m_choiceUnit_ElecPrm2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_elec_prm3_label = new wxStaticText( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_elec_prm3_label->Wrap( -1 );
fgSizerResults->Add( m_elec_prm3_label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Elec_prm3_Value = new wxTextCtrl( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerResults->Add( m_Elec_prm3_Value, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_choiceUnit_ElecPrm3Choices;
m_choiceUnit_ElecPrm3 = new UNIT_SELECTOR_ANGLE( sbElectricalResultsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnit_ElecPrm3Choices, 0 );
m_choiceUnit_ElecPrm3->SetSelection( 0 );
fgSizerResults->Add( m_choiceUnit_ElecPrm3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbElectricalResultsSizer->Add( fgSizerResults, 0, wxEXPAND|wxBOTTOM, 5 );
bRightSizer->Add( sbElectricalResultsSizer, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbMessagesSizer;
sbMessagesSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelTransline, wxID_ANY, _("Results") ), wxVERTICAL );
wxFlexGridSizer* fgSizerTranslResults;
fgSizerTranslResults = new wxFlexGridSizer( 8, 2, 0, 0 );
fgSizerTranslResults->AddGrowableCol( 1 );
fgSizerTranslResults->SetFlexibleDirection( wxBOTH );
fgSizerTranslResults->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_left_message1 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message1->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message1, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message1 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message1->Wrap( -1 );
fgSizerTranslResults->Add( m_Message1, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message2 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message2->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message2, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message2 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message2->Wrap( -1 );
fgSizerTranslResults->Add( m_Message2, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_left_message3 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message3->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message3, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message3 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message3->Wrap( -1 );
fgSizerTranslResults->Add( m_Message3, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message4 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message4->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message4, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message4 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message4->Wrap( -1 );
fgSizerTranslResults->Add( m_Message4, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message5 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message5->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxALIGN_RIGHT, 5 );
m_Message5 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message5->Wrap( -1 );
fgSizerTranslResults->Add( m_Message5, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message6 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message6->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message6, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message6 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message6->Wrap( -1 );
fgSizerTranslResults->Add( m_Message6, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message7 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message7->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message7, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_Message7 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message7->Wrap( -1 );
fgSizerTranslResults->Add( m_Message7, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_left_message8 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_left_message8->Wrap( -1 );
fgSizerTranslResults->Add( m_left_message8, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxRIGHT, 5 );
m_Message8 = new wxStaticText( sbMessagesSizer->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_Message8->Wrap( -1 );
fgSizerTranslResults->Add( m_Message8, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
sbMessagesSizer->Add( fgSizerTranslResults, 1, wxEXPAND, 5 );
bRightSizer->Add( sbMessagesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_buttonTransLineReset = new wxButton( m_panelTransline, wxID_ANY, _("Reset to Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_buttonTransLineReset, 0, wxALIGN_RIGHT|wxALL, 5 );
bSizeTransline->Add( bRightSizer, 1, wxEXPAND, 5 );
m_panelTransline->SetSizer( bSizeTransline );
m_panelTransline->Layout();
bSizeTransline->Fit( m_panelTransline );
m_Notebook->AddPage( m_panelTransline, _("TransLine"), false ); m_Notebook->AddPage( m_panelTransline, _("TransLine"), false );
m_panelViaSize = new PANEL_VIA_SIZE( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelViaSize = new PANEL_VIA_SIZE( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_Notebook->AddPage( m_panelViaSize, _("Via Size"), false ); m_Notebook->AddPage( m_panelViaSize, _("Via Size"), false );
@ -503,22 +44,12 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
this->SetSizer( bmainFrameSizer ); this->SetSizer( bmainFrameSizer );
this->Layout(); this->Layout();
bmainFrameSizer->Fit( this );
this->Centre( wxBOTH ); this->Centre( wxBOTH );
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( PCB_CALCULATOR_FRAME_BASE::OnClosePcbCalc ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( PCB_CALCULATOR_FRAME_BASE::OnClosePcbCalc ) );
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PCB_CALCULATOR_FRAME_BASE::OnUpdateUI ) ); this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PCB_CALCULATOR_FRAME_BASE::OnUpdateUI ) );
m_TranslineSelection->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSelection ), NULL, this );
m_button_EpsilonR->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineEpsilonR_Button ), NULL, this );
m_button_TanD->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineTanD_Button ), NULL, this );
m_button_Rho->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineRho_Button ), NULL, this );
m_bpButtonAnalyze->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineAnalyse ), NULL, this );
m_AnalyseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineAnalyse ), NULL, this );
m_SynthetizeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_bpButtonSynthetize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_buttonTransLineReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTransLineResetButtonClick ), NULL, this );
} }
PCB_CALCULATOR_FRAME_BASE::~PCB_CALCULATOR_FRAME_BASE() PCB_CALCULATOR_FRAME_BASE::~PCB_CALCULATOR_FRAME_BASE()
@ -526,14 +57,5 @@ PCB_CALCULATOR_FRAME_BASE::~PCB_CALCULATOR_FRAME_BASE()
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( PCB_CALCULATOR_FRAME_BASE::OnClosePcbCalc ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( PCB_CALCULATOR_FRAME_BASE::OnClosePcbCalc ) );
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PCB_CALCULATOR_FRAME_BASE::OnUpdateUI ) ); this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PCB_CALCULATOR_FRAME_BASE::OnUpdateUI ) );
m_TranslineSelection->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSelection ), NULL, this );
m_button_EpsilonR->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineEpsilonR_Button ), NULL, this );
m_button_TanD->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineTanD_Button ), NULL, this );
m_button_Rho->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineRho_Button ), NULL, this );
m_bpButtonAnalyze->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineAnalyse ), NULL, this );
m_AnalyseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineAnalyse ), NULL, this );
m_SynthetizeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_bpButtonSynthetize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_buttonTransLineReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTransLineResetButtonClick ), NULL, this );
} }

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,11 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class UNIT_SELECTOR_ANGLE;
class UNIT_SELECTOR_FREQUENCY;
class UNIT_SELECTOR_LEN;
class UNIT_SELECTOR_RESISTOR;
#include "panel_regulator.h" #include "panel_regulator.h"
#include "panel_attenuators.h" #include "panel_attenuators.h"
#include "panel_eserie.h" #include "panel_eserie.h"
#include "panel_color_code.h" #include "panel_color_code.h"
#include "panel_transline.h"
#include "panel_via_size.h" #include "panel_via_size.h"
#include "panel_track_width.h" #include "panel_track_width.h"
#include "panel_electrical_spacing.h" #include "panel_electrical_spacing.h"
@ -34,17 +30,8 @@ class UNIT_SELECTOR_RESISTOR;
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/radiobox.h>
#include <wx/statbmp.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/statbox.h>
#include <wx/radiobut.h>
#include <wx/bmpbuttn.h>
#include <wx/notebook.h> #include <wx/notebook.h>
#include <wx/sizer.h>
#include <wx/frame.h> #include <wx/frame.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -64,84 +51,7 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER
PANEL_ATTENUATORS* m_panelAttenuators; PANEL_ATTENUATORS* m_panelAttenuators;
PANEL_E_SERIE* m_panelESeries; PANEL_E_SERIE* m_panelESeries;
PANEL_COLOR_CODE* m_panelColorCode; PANEL_COLOR_CODE* m_panelColorCode;
wxPanel* m_panelTransline; PANEL_TRANSLINE* m_panelTransline;
wxRadioBox* m_TranslineSelection;
wxStaticBitmap* m_translineBitmap;
wxStaticText* m_EpsilonR_label;
wxTextCtrl* m_Value_EpsilonR;
wxButton* m_button_EpsilonR;
wxStaticText* m_TanD_label;
wxTextCtrl* m_Value_TanD;
wxButton* m_button_TanD;
wxStaticText* m_Rho_label;
wxTextCtrl* m_Value_Rho;
wxButton* m_button_Rho;
wxStaticText* m_substrate_prm4_label;
wxTextCtrl* m_Substrate_prm4_Value;
UNIT_SELECTOR_LEN* m_SubsPrm4_choiceUnit;
wxStaticText* m_substrate_prm5_label;
wxTextCtrl* m_Substrate_prm5_Value;
UNIT_SELECTOR_LEN* m_SubsPrm5_choiceUnit;
wxStaticText* m_substrate_prm6_label;
wxTextCtrl* m_Substrate_prm6_Value;
UNIT_SELECTOR_LEN* m_SubsPrm6_choiceUnit;
wxStaticText* m_substrate_prm7_label;
wxTextCtrl* m_Substrate_prm7_Value;
UNIT_SELECTOR_LEN* m_SubsPrm7_choiceUnit;
wxStaticText* m_substrate_prm8_label;
wxTextCtrl* m_Substrate_prm8_Value;
UNIT_SELECTOR_LEN* m_SubsPrm8_choiceUnit;
wxStaticText* m_substrate_prm9_label;
wxTextCtrl* m_Substrate_prm9_Value;
UNIT_SELECTOR_LEN* m_SubsPrm9_choiceUnit;
wxStaticText* m_Frequency_label;
wxTextCtrl* m_Value_Frequency_Ctrl;
UNIT_SELECTOR_FREQUENCY* m_choiceUnit_Frequency;
wxStaticBitmap* m_bmCMicrostripZoddZeven;
wxFlexGridSizer* m_fgSizerZcomment;
wxStaticText* m_staticTextZdiff;
wxStaticText* m_staticTextZcommon;
wxStaticText* m_phys_prm1_label;
wxTextCtrl* m_Phys_prm1_Value;
UNIT_SELECTOR_LEN* m_choiceUnit_Param1;
wxRadioButton* m_radioBtnPrm1;
wxStaticText* m_phys_prm2_label;
wxTextCtrl* m_Phys_prm2_Value;
UNIT_SELECTOR_LEN* m_choiceUnit_Param2;
wxRadioButton* m_radioBtnPrm2;
wxStaticText* m_phys_prm3_label;
wxTextCtrl* m_Phys_prm3_Value;
UNIT_SELECTOR_LEN* m_choiceUnit_Param3;
wxBitmapButton* m_bpButtonAnalyze;
wxButton* m_AnalyseButton;
wxButton* m_SynthetizeButton;
wxBitmapButton* m_bpButtonSynthetize;
wxStaticText* m_elec_prm1_label;
wxTextCtrl* m_Elec_prm1_Value;
UNIT_SELECTOR_RESISTOR* m_choiceUnit_ElecPrm1;
wxStaticText* m_elec_prm2_label;
wxTextCtrl* m_Elec_prm2_Value;
UNIT_SELECTOR_RESISTOR* m_choiceUnit_ElecPrm2;
wxStaticText* m_elec_prm3_label;
wxTextCtrl* m_Elec_prm3_Value;
UNIT_SELECTOR_ANGLE* m_choiceUnit_ElecPrm3;
wxStaticText* m_left_message1;
wxStaticText* m_Message1;
wxStaticText* m_left_message2;
wxStaticText* m_Message2;
wxStaticText* m_left_message3;
wxStaticText* m_Message3;
wxStaticText* m_left_message4;
wxStaticText* m_Message4;
wxStaticText* m_left_message5;
wxStaticText* m_Message5;
wxStaticText* m_left_message6;
wxStaticText* m_Message6;
wxStaticText* m_left_message7;
wxStaticText* m_Message7;
wxStaticText* m_left_message8;
wxStaticText* m_Message8;
wxButton* m_buttonTransLineReset;
PANEL_VIA_SIZE* m_panelViaSize; PANEL_VIA_SIZE* m_panelViaSize;
PANEL_TRACK_WIDTH* m_panelTrackWidth; PANEL_TRACK_WIDTH* m_panelTrackWidth;
PANEL_ELECTRICAL_SPACING* m_panelElectricalSpacing; PANEL_ELECTRICAL_SPACING* m_panelElectricalSpacing;
@ -150,18 +60,11 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnClosePcbCalc( wxCloseEvent& event ) { event.Skip(); } virtual void OnClosePcbCalc( wxCloseEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnTranslineSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineEpsilonR_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineTanD_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineRho_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineAnalyse( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineSynthetize( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTransLineResetButtonClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PCB Calculator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL, const wxString& name = wxT("pcb_calculator") ); PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PCB Calculator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 646,361 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL, const wxString& name = wxT("pcb_calculator") );
~PCB_CALCULATOR_FRAME_BASE(); ~PCB_CALCULATOR_FRAME_BASE();

View File

@ -27,7 +27,6 @@
#include <string_utils.h> #include <string_utils.h>
#include "pcb_calculator_settings.h" #include "pcb_calculator_settings.h"
#include <panel_eserie.h> #include <panel_eserie.h>
//#include <widgets/unit_selector.h>
#include <i18n_utility.h> // For _HKI definition #include <i18n_utility.h> // For _HKI definition
wxString eseries_help = wxString eseries_help =

View File

@ -26,16 +26,19 @@
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
#include "class_regulator_data.h" #include "class_regulator_data.h"
#include "pcb_calculator_frame.h"
#include "pcb_calculator_settings.h" #include "pcb_calculator_settings.h"
#include "dialogs/dialog_regulator_form.h" #include "dialogs/dialog_regulator_form.h"
#include "../dialogs/panel_regulator.h" #include "dialogs/panel_regulator.h"
#include <bitmaps.h> #include <bitmaps.h>
extern double DoubleFromString( const wxString& TextValue ); extern double DoubleFromString( const wxString& TextValue );
// extension of pcb_calculator data filename:
static const wxString DataFileNameExt( wxT( "pcbcalc" ) );
PANEL_REGULATOR::PANEL_REGULATOR( wxWindow* parent, wxWindowID id, PANEL_REGULATOR::PANEL_REGULATOR( wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style, const wxString& name ) : long style, const wxString& name ) :

View File

@ -29,7 +29,6 @@
#include <kiface_base.h> #include <kiface_base.h>
#include <string_utils.h> #include <string_utils.h>
//#include "pcb_calculator_frame.h"
#include "pcb_calculator_settings.h" #include "pcb_calculator_settings.h"
#include "units_scales.h" #include "units_scales.h"
#include <panel_track_width.h> #include <panel_track_width.h>

View File

@ -0,0 +1,105 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2011 jean-pierre.charras
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* 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 Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <bitmaps.h>
#include "pcb_calculator_settings.h"
#include <panel_transline.h>
PANEL_TRANSLINE::PANEL_TRANSLINE( wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
long style, const wxString& name ) :
PANEL_TRANSLINE_BASE( parent, id, pos, size, style, name )
{
m_currTransLine = nullptr;
m_currTransLineType = DEFAULT_TYPE;
m_bpButtonAnalyze->SetBitmap( KiBitmap( BITMAPS::small_down ) );
m_bpButtonSynthetize->SetBitmap( KiBitmap( BITMAPS::small_up ) );
// Populate transline list ordered like in dialog menu list
const static TRANSLINE_TYPE_ID tltype_list[8] =
{
MICROSTRIP_TYPE,
CPW_TYPE,
GROUNDED_CPW_TYPE,
RECTWAVEGUIDE_TYPE,
COAX_TYPE,
C_MICROSTRIP_TYPE,
STRIPLINE_TYPE,
TWISTEDPAIR_TYPE
};
for( int ii = 0; ii < 8; ii++ )
m_transline_list.push_back( new TRANSLINE_IDENT( tltype_list[ii] ) );
m_EpsilonR_label->SetLabel( wxT( "εr" ) );
}
PANEL_TRANSLINE::~PANEL_TRANSLINE()
{
for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
delete m_transline_list[ii];
}
void PANEL_TRANSLINE::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
aCfg->m_TransLine.type = m_currTransLineType;
for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
m_transline_list[ii]->WriteConfig();
}
void PANEL_TRANSLINE::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
m_currTransLineType = static_cast<TRANSLINE_TYPE_ID>( aCfg->m_TransLine.type );
for( TRANSLINE_IDENT* transline : m_transline_list )
transline->ReadConfig();
TranslineTypeSelection( m_currTransLineType );
m_TranslineSelection->SetSelection( m_currTransLineType );
}
void PANEL_TRANSLINE::OnTranslineAnalyse( wxCommandEvent& event )
{
if( m_currTransLine )
{
TransfDlgDataToTranslineParams();
m_currTransLine->analyze();
}
}
void PANEL_TRANSLINE::OnTranslineSynthetize( wxCommandEvent& event )
{
if( m_currTransLine )
{
TransfDlgDataToTranslineParams();
m_currTransLine->synthesize();
}
}

View File

@ -45,12 +45,9 @@
#include <cmath> #include <cmath>
#include <wx/choicdlg.h> #include <wx/choicdlg.h>
//#include <kiface_base.h>
#include <bitmaps.h> #include <bitmaps.h>
#include "attenuators/attenuator_classes.h"
#include "common_data.h" #include "common_data.h"
//#include "pcb_calculator_frame.h"
#include "pcb_calculator_settings.h" #include "pcb_calculator_settings.h"
#include "units_scales.h" #include "units_scales.h"
#include "panel_via_size.h" #include "panel_via_size.h"

View File

@ -23,6 +23,7 @@
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
#include "pcb_calculator_frame.h" #include "pcb_calculator_frame.h"
#include "panel_transline.h"
#include "transline/transline.h" #include "transline/transline.h"
/* /*
@ -78,55 +79,57 @@ double DoubleFromString( const wxString& TextValue )
} }
// A helper function to get a reference to the PANEL_TRANSLINE
PANEL_TRANSLINE* getTranslinePanel()
{
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow();
return frame->GetPanelTransline();
}
// Functions to Read/Write parameters in pcb_calculator main frame: // Functions to Read/Write parameters in pcb_calculator main frame:
// They are only wrapper to actual functions, so all transline functions do not // They are only wrapper to actual functions, so all transline functions do not
// depend on Graphic User Interface // depend on Graphic User Interface
void SetPropertyInDialog( enum PRMS_ID aPrmId, double value ) void SetPropertyInDialog( enum PRMS_ID aPrmId, double value )
{ {
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow(); getTranslinePanel()->SetPrmValue( aPrmId, value );
frame->SetPrmValue( aPrmId, value );
} }
void SetPropertyBgColorInDialog( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol ) void SetPropertyBgColorInDialog( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol )
{ {
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow(); getTranslinePanel()->SetPrmBgColor( aPrmId, aCol );
frame->SetPrmBgColor( aPrmId, aCol );
} }
/* Puts the text into the given result line. /* Puts the text into the given result line.
*/ */
void SetResultInDialog( int line, const char* aText ) void SetResultInDialog( int line, const char* aText )
{ {
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow();
wxString msg = wxString::FromUTF8( aText ); wxString msg = wxString::FromUTF8( aText );
frame->SetResult( line, msg ); getTranslinePanel()->SetResult( line, msg );
} }
/* print aValue into the given result line. /* print aValue into the given result line.
*/ */
void SetResultInDialog( int aLineNumber, double aValue, const char* aText ) void SetResultInDialog( int aLineNumber, double aValue, const char* aText )
{ {
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow();
wxString msg = wxString::FromUTF8( aText ); wxString msg = wxString::FromUTF8( aText );
wxString fullmsg; wxString fullmsg;
fullmsg.Printf( wxT( "%g " ), aValue ); fullmsg.Printf( wxT( "%g " ), aValue );
fullmsg += msg; fullmsg += msg;
frame->SetResult( aLineNumber, fullmsg ); getTranslinePanel()->SetResult( aLineNumber, fullmsg );
} }
/* Returns a named property value. */ /* Returns a named property value. */
double GetPropertyInDialog( enum PRMS_ID aPrmId ) double GetPropertyInDialog( enum PRMS_ID aPrmId )
{ {
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow(); return getTranslinePanel()->GetPrmValue( aPrmId );
return frame->GetPrmValue( aPrmId );
} }
// Returns true if the param aPrmId is selected // Returns true if the param aPrmId is selected
// Has meaning only for params that have a radio button // Has meaning only for params that have a radio button
bool IsSelectedInDialog( enum PRMS_ID aPrmId ) bool IsSelectedInDialog( enum PRMS_ID aPrmId )
{ {
PCB_CALCULATOR_FRAME* frame = (PCB_CALCULATOR_FRAME*) wxTheApp->GetTopWindow(); return getTranslinePanel()->IsPrmSelected( aPrmId );
return frame->IsPrmSelected( aPrmId );
} }
@ -136,7 +139,7 @@ bool IsSelectedInDialog( enum PRMS_ID aPrmId )
* @param aPrmId = param id to write * @param aPrmId = param id to write
* @return the value always in normalized unit (meter, Hz, Ohm, radian) * @return the value always in normalized unit (meter, Hz, Ohm, radian)
*/ */
double PCB_CALCULATOR_FRAME::GetPrmValue( enum PRMS_ID aPrmId ) const double PANEL_TRANSLINE::GetPrmValue( enum PRMS_ID aPrmId ) const
{ {
TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType]; TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType];
for( unsigned ii = 0; ii < tr_ident->GetPrmsCount(); ii++ ) for( unsigned ii = 0; ii < tr_ident->GetPrmsCount(); ii++ )
@ -154,7 +157,7 @@ double PCB_CALCULATOR_FRAME::GetPrmValue( enum PRMS_ID aPrmId ) const
* @param aPrmId = param id to write * @param aPrmId = param id to write
* @param aValue = value to write * @param aValue = value to write
*/ */
void PCB_CALCULATOR_FRAME::SetPrmValue( enum PRMS_ID aPrmId, double aValue ) void PANEL_TRANSLINE::SetPrmValue( enum PRMS_ID aPrmId, double aValue )
{ {
TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType]; TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType];
for( unsigned ii = 0; ii < tr_ident->GetPrmsCount(); ii++ ) for( unsigned ii = 0; ii < tr_ident->GetPrmsCount(); ii++ )
@ -180,7 +183,7 @@ void PCB_CALCULATOR_FRAME::SetPrmValue( enum PRMS_ID aPrmId, double aValue )
* @param aPrmId = @ref PRMS_ID of the parameter * @param aPrmId = @ref PRMS_ID of the parameter
* @param aCol = color ( @ref KIGFX::COLOR4D * ) * @param aCol = color ( @ref KIGFX::COLOR4D * )
*/ */
void PCB_CALCULATOR_FRAME::SetPrmBgColor( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol ) void PANEL_TRANSLINE::SetPrmBgColor( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol )
{ {
wxColour wxcol = wxColour( static_cast<unsigned char>( aCol->r * 255 ), wxColour wxcol = wxColour( static_cast<unsigned char>( aCol->r * 255 ),
static_cast<unsigned char>( aCol->g * 255 ), static_cast<unsigned char>( aCol->g * 255 ),
@ -214,7 +217,7 @@ void PCB_CALCULATOR_FRAME::SetPrmBgColor( enum PRMS_ID aPrmId, const KIGFX::COLO
* @param aLineNumber = the line (0 to MSG_CNT_MAX-1) wher to display the text * @param aLineNumber = the line (0 to MSG_CNT_MAX-1) wher to display the text
* @param aText = the text to display * @param aText = the text to display
*/ */
void PCB_CALCULATOR_FRAME::SetResult( int aLineNumber, const wxString& aText ) void PANEL_TRANSLINE::SetResult( int aLineNumber, const wxString& aText )
{ {
#define MSG_CNT_MAX 8 #define MSG_CNT_MAX 8
wxStaticText* messages[MSG_CNT_MAX] = wxStaticText* messages[MSG_CNT_MAX] =
@ -238,7 +241,7 @@ void PCB_CALCULATOR_FRAME::SetResult( int aLineNumber, const wxString& aText )
* @return true if the param aPrmId is selected * @return true if the param aPrmId is selected
* Has meaning only for params that have a radio button * Has meaning only for params that have a radio button
*/ */
bool PCB_CALCULATOR_FRAME::IsPrmSelected( enum PRMS_ID aPrmId ) const bool PANEL_TRANSLINE::IsPrmSelected( enum PRMS_ID aPrmId ) const
{ {
switch( aPrmId ) switch( aPrmId )
{ {

View File

@ -26,50 +26,20 @@
#include "pcb_calculator_settings.h" #include "pcb_calculator_settings.h"
// extension of pcb_calculator data filename:
const wxString DataFileNameExt( wxT( "pcbcalc" ) );
PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
PCB_CALCULATOR_FRAME_BASE( aParent ), PCB_CALCULATOR_FRAME_BASE( aParent ),
m_lastNotebookPage( -1 ), m_lastNotebookPage( -1 ),
m_macHack( true ) m_macHack( true )
{ {
m_bpButtonAnalyze->SetBitmap( KiBitmap( BITMAPS::small_down ) );
m_bpButtonSynthetize->SetBitmap( KiBitmap( BITMAPS::small_up ) );
SetKiway( this, aKiway ); SetKiway( this, aKiway );
m_currTransLine = nullptr;
m_currTransLineType = DEFAULT_TYPE;
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
// Populate transline list ordered like in dialog menu list
const static TRANSLINE_TYPE_ID tltype_list[8] =
{
MICROSTRIP_TYPE,
CPW_TYPE,
GROUNDED_CPW_TYPE,
RECTWAVEGUIDE_TYPE,
COAX_TYPE,
C_MICROSTRIP_TYPE,
STRIPLINE_TYPE,
TWISTEDPAIR_TYPE
};
for( int ii = 0; ii < 8; ii++ )
m_transline_list.push_back( new TRANSLINE_IDENT( tltype_list[ii] ) );
m_EpsilonR_label->SetLabel( wxT( "εr" ) );
LoadSettings( config() ); LoadSettings( config() );
m_panelRegulators->ReadDataFile(); m_panelRegulators->ReadDataFile();
TranslineTypeSelection( m_currTransLineType );
m_TranslineSelection->SetSelection( m_currTransLineType );
// Give an icon // Give an icon
wxIcon icon; wxIcon icon;
wxIconBundle icon_bundle; wxIconBundle icon_bundle;
@ -95,9 +65,6 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME() PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME()
{ {
for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
delete m_transline_list[ii];
// This needed for OSX: avoids further OnDraw processing after this destructor and before // This needed for OSX: avoids further OnDraw processing after this destructor and before
// the native window is destroyed // the native window is destroyed
this->Freeze(); this->Freeze();
@ -112,9 +79,9 @@ void PCB_CALCULATOR_FRAME::OnUpdateUI( wxUpdateUIEvent& event )
// This is getting seriously ridiculous.... // This is getting seriously ridiculous....
wxCommandEvent event2( wxEVT_RADIOBUTTON ); wxCommandEvent event2( wxEVT_RADIOBUTTON );
event2.SetEventObject( m_TranslineSelection ); event2.SetEventObject( m_panelTransline->GetTranslineSelector() );
event2.SetInt( m_currTransLineType ); event2.SetInt( m_panelTransline->GetCurrTransLineType() );
m_TranslineSelection->Command( event2 ); m_panelTransline->GetTranslineSelector()->Command( event2 );
for( int i = 0; i < m_panelAttenuators->m_AttenuatorList.size(); ++i ) for( int i = 0; i < m_panelAttenuators->m_AttenuatorList.size(); ++i )
{ {
@ -204,9 +171,10 @@ void PCB_CALCULATOR_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
PCB_CALCULATOR_SETTINGS* cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( aCfg ); PCB_CALCULATOR_SETTINGS* cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( aCfg );
m_currTransLineType = static_cast<TRANSLINE_TYPE_ID>( cfg->m_TransLine.type );
m_Notebook->ChangeSelection( cfg->m_LastPage ); m_Notebook->ChangeSelection( cfg->m_LastPage );
m_panelTransline->LoadSettings( cfg );
// Attenuators panel config: // Attenuators panel config:
m_panelAttenuators->LoadSettings( cfg ); m_panelAttenuators->LoadSettings( cfg );
@ -216,9 +184,6 @@ void PCB_CALCULATOR_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
// color panel config: // color panel config:
m_panelColorCode->LoadSettings( cfg ); m_panelColorCode->LoadSettings( cfg );
for( TRANSLINE_IDENT* transline : m_transline_list )
transline->ReadConfig();
m_panelViaSize->LoadSettings( cfg ); m_panelViaSize->LoadSettings( cfg );
m_panelTrackWidth->LoadSettings( cfg ); m_panelTrackWidth->LoadSettings( cfg );
m_panelElectricalSpacing->LoadSettings( cfg ); m_panelElectricalSpacing->LoadSettings( cfg );
@ -240,8 +205,8 @@ void PCB_CALCULATOR_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
if( cfg ) if( cfg )
{ {
cfg->m_LastPage = m_Notebook->GetSelection(); cfg->m_LastPage = m_Notebook->GetSelection();
cfg->m_TransLine.type = m_currTransLineType;
m_panelTransline->SaveSettings( cfg );
m_panelRegulators->Regulators_WriteConfig( cfg ); m_panelRegulators->Regulators_WriteConfig( cfg );
m_panelAttenuators->SaveSettings( cfg ); m_panelAttenuators->SaveSettings( cfg );
m_panelColorCode->SaveSettings( cfg ); m_panelColorCode->SaveSettings( cfg );
@ -251,27 +216,4 @@ void PCB_CALCULATOR_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
m_panelBoardClass->SaveSettings( cfg ); m_panelBoardClass->SaveSettings( cfg );
} }
for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
m_transline_list[ii]->WriteConfig();
}
void PCB_CALCULATOR_FRAME::OnTranslineAnalyse( wxCommandEvent& event )
{
if( m_currTransLine )
{
TransfDlgDataToTranslineParams();
m_currTransLine->analyze();
}
}
void PCB_CALCULATOR_FRAME::OnTranslineSynthetize( wxCommandEvent& event )
{
if( m_currTransLine )
{
TransfDlgDataToTranslineParams();
m_currTransLine->synthesize();
}
} }

View File

@ -20,17 +20,11 @@
#ifndef PCB_CALCULATOR_H #ifndef PCB_CALCULATOR_H
#define PCB_CALCULATOR_H #define PCB_CALCULATOR_H
#include "transline/transline.h" // Included for SUBST_PRMS_ID definition.
#include "transline_ident.h"
#include "pcb_calculator_frame_base.h" #include "pcb_calculator_frame_base.h"
#include "attenuators/attenuator_classes.h"
extern const wxString PcbCalcDataFileExt;
class APP_SETTINGS_BASE; class APP_SETTINGS_BASE;
class KIWAY; class KIWAY;
class PCB_CALCULATOR_SETTINGS; class PANEL_TRANSLINE;
/** /**
@ -42,49 +36,15 @@ public:
PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ); PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent );
~PCB_CALCULATOR_FRAME(); ~PCB_CALCULATOR_FRAME();
/** // Pcb calculator doesn't host a tool framework
* Read/write params values and results.
*
* @param aPrmId is the parameter id to write.
* @param aValue is the value to write.
*/
void SetPrmValue( enum PRMS_ID aPrmId, double aValue );
/**
* Put the text into the given result line.
*
* @param aLineNumber is the line (0 to 5) where to display the text.
* @param aText is the text to display.
*/
void SetResult( int aLineNumber, const wxString& aText );
/**
* Set the background color of a parameter.
*
* @param aPrmId is the parameter id to set.
* @param aCol is the new color.
*/
void SetPrmBgColor( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol );
/**
* Return a param value.
*
* @param aPrmId is the parameter id to write.
* @return the value always in normalized unit (meter, Hz, Ohm, radian).
*/
double GetPrmValue( enum PRMS_ID aPrmId ) const;
/**
* @return true if the parameter aPrmId is selected.
*/
bool IsPrmSelected( enum PRMS_ID aPrmId ) const;
// Calculator doesn't host a tool framework
wxWindow* GetToolCanvas() const override wxWindow* GetToolCanvas() const override
{ {
return nullptr; return nullptr;
} }
// Accessor:
PANEL_TRANSLINE* GetPanelTransline() { return m_panelTransline; }
private: private:
// Event handlers // Event handlers
void OnClosePcbCalc( wxCloseEvent& event ) override; void OnClosePcbCalc( wxCloseEvent& event ) override;
@ -95,67 +55,7 @@ private:
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override; void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override; void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
/**
* Called on new transmission line selection.
*/
void OnTranslineSelection( wxCommandEvent& event ) override;
/**
* Called when the user clicks the reset button; sets the parameters to their default values.
*/
void OnTransLineResetButtonClick( wxCommandEvent& event ) override;
/**
* Run a new analyze for the current transline with current parameters and displays the
* electrical parameters.
*/
void OnTranslineAnalyse( wxCommandEvent& event ) override;
/**
* Run a new synthesis for the current transline with current parameters and displays the
* geometrical parameters.
*/
void OnTranslineSynthetize( wxCommandEvent& event ) override;
/**
* Shows a list of current relative dielectric constant(Er) and set the selected value in
* main dialog frame.
*/
void OnTranslineEpsilonR_Button( wxCommandEvent& event ) override;
/**
* Show a list of current dielectric loss factor (tangent delta) and set the selected value
* in main dialog frame.
*/
void OnTranslineTanD_Button( wxCommandEvent& event ) override;
/**
* Show a list of current Specific resistance list (rho) and set the selected value in main
* dialog frame.
*/
void OnTranslineRho_Button( wxCommandEvent& event ) override;
/**
* Must be called after selection of a new transline.
*
* Update all values, labels and tool tips of parameters needed by the new transline;
* irrelevant parameters are blanked.
*
* @param aType is the #TRANSLINE_TYPE_ID of the new selected transmission line.
*/
void TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType );
/**
* Read values entered in dialog frame, and transfer these values in current transline
* parameters, converted in normalized units.
*/
void TransfDlgDataToTranslineParams();
private: private:
enum TRANSLINE_TYPE_ID m_currTransLineType;
TRANSLINE* m_currTransLine;
std::vector<TRANSLINE_IDENT*> m_transline_list;
int m_lastNotebookPage; int m_lastNotebookPage;
bool m_macHack; bool m_macHack;
}; };

View File

@ -23,7 +23,8 @@
#include <bitmaps.h> #include <bitmaps.h>
#include "common_data.h" #include "common_data.h"
#include "pcb_calculator_frame.h" #include "panel_transline.h"
#include <widgets/unit_selector.h>
extern double DoubleFromString( const wxString& TextValue ); extern double DoubleFromString( const wxString& TextValue );
@ -108,7 +109,7 @@ static bool findMatch( wxArrayString& aList, const wxString& aValue, int& aIdx )
} }
void PCB_CALCULATOR_FRAME::OnTranslineEpsilonR_Button( wxCommandEvent& event ) void PANEL_TRANSLINE::OnTranslineEpsilonR_Button( wxCommandEvent& event )
{ {
wxArrayString list = StandardRelativeDielectricConstantList(); wxArrayString list = StandardRelativeDielectricConstantList();
list.Add( "" ); // Add an empty line for no selection list.Add( "" ); // Add an empty line for no selection
@ -126,7 +127,7 @@ void PCB_CALCULATOR_FRAME::OnTranslineEpsilonR_Button( wxCommandEvent& event )
} }
void PCB_CALCULATOR_FRAME::OnTranslineTanD_Button( wxCommandEvent& event ) void PANEL_TRANSLINE::OnTranslineTanD_Button( wxCommandEvent& event )
{ {
wxArrayString list = StandardLossTangentList(); wxArrayString list = StandardLossTangentList();
list.Add( "" ); // Add an empty line for no selection list.Add( "" ); // Add an empty line for no selection
@ -144,7 +145,7 @@ void PCB_CALCULATOR_FRAME::OnTranslineTanD_Button( wxCommandEvent& event )
} }
void PCB_CALCULATOR_FRAME::OnTranslineRho_Button( wxCommandEvent& event ) void PANEL_TRANSLINE::OnTranslineRho_Button( wxCommandEvent& event )
{ {
wxArrayString list = StandardResistivityList(); wxArrayString list = StandardResistivityList();
list.Add( "" ); // Add an empty line for no selection list.Add( "" ); // Add an empty line for no selection
@ -171,7 +172,7 @@ struct DLG_PRM_DATA
}; };
void PCB_CALCULATOR_FRAME::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType ) void PANEL_TRANSLINE::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType )
{ {
m_currTransLineType = aType; m_currTransLineType = aType;
@ -393,7 +394,7 @@ void PCB_CALCULATOR_FRAME::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType
} }
void PCB_CALCULATOR_FRAME::TransfDlgDataToTranslineParams() void PANEL_TRANSLINE::TransfDlgDataToTranslineParams()
{ {
TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType]; TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType];
@ -417,7 +418,7 @@ void PCB_CALCULATOR_FRAME::TransfDlgDataToTranslineParams()
} }
void PCB_CALCULATOR_FRAME::OnTranslineSelection( wxCommandEvent& event ) void PANEL_TRANSLINE::OnTranslineSelection( wxCommandEvent& event )
{ {
enum TRANSLINE_TYPE_ID id = (enum TRANSLINE_TYPE_ID) event.GetSelection(); enum TRANSLINE_TYPE_ID id = (enum TRANSLINE_TYPE_ID) event.GetSelection();
@ -425,16 +426,16 @@ void PCB_CALCULATOR_FRAME::OnTranslineSelection( wxCommandEvent& event )
// Texts and units choice widgets can have their size modified: // Texts and units choice widgets can have their size modified:
// The new size must be taken in account // The new size must be taken in account
m_panelTransline->GetSizer()->Layout(); GetSizer()->Layout();
m_panelTransline->Refresh(); Refresh();
} }
void PCB_CALCULATOR_FRAME::OnTransLineResetButtonClick( wxCommandEvent& event ) void PANEL_TRANSLINE::OnTransLineResetButtonClick( wxCommandEvent& event )
{ {
TranslineTypeSelection( DEFAULT_TYPE ); TranslineTypeSelection( DEFAULT_TYPE );
m_TranslineSelection->SetSelection( DEFAULT_TYPE ); m_TranslineSelection->SetSelection( DEFAULT_TYPE );
m_panelTransline->GetSizer()->Layout(); GetSizer()->Layout();
m_panelTransline->Refresh(); Refresh();
} }