14 changed files with 6757 additions and 103 deletions
-
3eeschema/CMakeLists.txt
-
162eeschema/dialogs/dialog_sim_settings.cpp
-
87eeschema/dialogs/dialog_sim_settings.h
-
404eeschema/dialogs/dialog_sim_settings_base.cpp
-
5680eeschema/dialogs/dialog_sim_settings_base.fbp
-
121eeschema/dialogs/dialog_sim_settings_base.h
-
114eeschema/netlist_exporters/netlist_exporter_pspice.cpp
-
25eeschema/netlist_exporters/netlist_exporter_pspice.h
-
97eeschema/sim/sim_plot_frame.cpp
-
12eeschema/sim/sim_plot_frame.h
-
19eeschema/sim/sim_plot_frame_base.cpp
-
131eeschema/sim/sim_plot_frame_base.fbp
-
2eeschema/sim/sim_plot_frame_base.h
-
3eeschema/sim/sim_plot_panel.cpp
@ -0,0 +1,162 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2016 CERN |
|||
* @author Maciej Suminski <maciej.suminski@cern.ch> |
|||
* |
|||
* 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 2 |
|||
* 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, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include "dialog_sim_settings.h"
|
|||
#include <wx/log.h>
|
|||
|
|||
/// @todo ngspice offers more types of analysis,
|
|||
//so there are a few tabs missing (e.g. pole-zero, distortion, sensitivity)
|
|||
|
|||
DIALOG_SIM_SETTINGS::DIALOG_SIM_SETTINGS( wxWindow* aParent ) |
|||
: DIALOG_SIM_SETTINGS_BASE( aParent ), m_exporter( nullptr ) |
|||
{ |
|||
m_posFloatValidator.SetMin( 0 + std::numeric_limits<double>::epsilon() ); |
|||
m_posFloatValidator.SetPrecision( 3 ); |
|||
m_posIntValidator.SetMin( 1 ); |
|||
|
|||
m_acPointsNumber->SetValidator( m_posIntValidator ); |
|||
m_acFreqStart->SetValidator( m_posFloatValidator ); |
|||
m_acFreqStop->SetValidator( m_posFloatValidator ); |
|||
|
|||
m_dcStart1->SetValidator( m_posFloatValidator ); |
|||
m_dcStop1->SetValidator( m_posFloatValidator ); |
|||
m_dcIncr1->SetValidator( m_posFloatValidator ); |
|||
|
|||
m_dcStart2->SetValidator( m_posFloatValidator ); |
|||
m_dcStop2->SetValidator( m_posFloatValidator ); |
|||
m_dcIncr2->SetValidator( m_posFloatValidator ); |
|||
|
|||
m_noisePointsNumber->SetValidator( m_posIntValidator ); |
|||
m_noiseFreqStart->SetValidator( m_posFloatValidator ); |
|||
m_noiseFreqStop->SetValidator( m_posFloatValidator ); |
|||
|
|||
m_transStep->SetValidator( m_posFloatValidator ); |
|||
m_transFinal->SetValidator( m_posFloatValidator ); |
|||
m_transInitial->SetValidator( m_posFloatValidator ); |
|||
} |
|||
|
|||
|
|||
bool DIALOG_SIM_SETTINGS::TransferDataFromWindow() |
|||
{ |
|||
if( !wxDialog::TransferDataFromWindow() ) |
|||
return false; |
|||
|
|||
wxWindow* page = m_simPages->GetCurrentPage(); |
|||
|
|||
// AC analysis
|
|||
if( page == m_pgAC ) |
|||
{ |
|||
m_simCommand = wxString::Format( ".ac %s %s %s %s", |
|||
scaleToString( m_acScale->GetSelection() ), |
|||
m_acPointsNumber->GetValue(), m_acFreqStart->GetValue(), m_acFreqStop->GetValue() ); |
|||
} |
|||
|
|||
|
|||
// DC transfer analysis
|
|||
else if( page == m_pgDC ) |
|||
{ |
|||
// At least one source has to be enabled
|
|||
if( !m_dcEnable1->IsChecked() && !m_dcEnable1->IsChecked() ) |
|||
return false; |
|||
|
|||
wxString simCmd = wxString( ".dc " ); |
|||
|
|||
if( m_dcEnable1->IsChecked() ) |
|||
{ |
|||
if( m_dcSource1->GetValue().IsEmpty() ) |
|||
return false; |
|||
|
|||
simCmd += wxString::Format( "%s %s %s %s", |
|||
m_dcSource1->GetValue(), m_dcStart1->GetValue(), |
|||
m_dcStop1->GetValue(), m_dcIncr1->GetValue() ); |
|||
} |
|||
|
|||
if( m_dcEnable2->IsChecked() ) |
|||
{ |
|||
if( m_dcSource2->GetValue().IsEmpty() ) |
|||
return false; |
|||
|
|||
simCmd += wxString::Format( "%s %s %s %s", |
|||
m_dcSource2->GetValue(), m_dcStart2->GetValue(), |
|||
m_dcStop2->GetValue(), m_dcIncr2->GetValue() ); |
|||
} |
|||
|
|||
m_simCommand = simCmd; |
|||
} |
|||
|
|||
|
|||
// Noise analysis
|
|||
else if( page == m_pgNoise ) |
|||
{ |
|||
if( m_noiseMeas->GetValue().IsEmpty() || m_noiseSrc->GetValue().IsEmpty() ) |
|||
return false; |
|||
|
|||
// TODO missing node number
|
|||
wxString ref = m_noiseRef->GetValue().IsEmpty() ? wxString() : wxString::Format( ", %d", 42 ); |
|||
m_simCommand = wxString::Format( ".noise v(%d%s) %s %s %s %s %s", |
|||
42, ref, m_noiseSrc->GetValue(), scaleToString( m_noiseScale->GetSelection() ), |
|||
m_noisePointsNumber->GetValue(), m_noiseFreqStart->GetValue(), m_noiseFreqStop->GetValue() ); |
|||
} |
|||
|
|||
|
|||
// DC operating point analysis
|
|||
else if( page == m_pgOP ) |
|||
{ |
|||
m_simCommand = wxString( ".op" ); |
|||
} |
|||
|
|||
|
|||
// Transient analysis
|
|||
else if( page == m_pgTransient ) |
|||
{ |
|||
m_simCommand = wxString::Format( ".trans %s %s %s", |
|||
m_transStep->GetValue(), m_transFinal->GetValue(), m_transInitial->GetValue() ); |
|||
} |
|||
|
|||
|
|||
// Custom directives
|
|||
else if( page == m_pgCustom ) |
|||
{ |
|||
m_simCommand = m_customTxt->GetValue(); |
|||
} |
|||
|
|||
else |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
bool DIALOG_SIM_SETTINGS::TransferDataToWindow() |
|||
{ |
|||
/// @todo one day it could interpret the sim command and fill out appropriate fields..
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
void DIALOG_SIM_SETTINGS::onLoadDirectives( wxCommandEvent& event ) |
|||
{ |
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2016 CERN |
|||
* @author Maciej Suminski <maciej.suminski@cern.ch> |
|||
* |
|||
* 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 2 |
|||
* 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, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef DIALOG_SIM_SETTINGS_BASE_H |
|||
#define DIALOG_SIM_SETTINGS_BASE_H |
|||
|
|||
#include "dialog_sim_settings_base.h" |
|||
#include <wx/valnum.h> |
|||
|
|||
class NETLIST_EXPORTER_PSPICE_SIM; |
|||
|
|||
class DIALOG_SIM_SETTINGS : public DIALOG_SIM_SETTINGS_BASE |
|||
{ |
|||
public: |
|||
DIALOG_SIM_SETTINGS( wxWindow* aParent ); |
|||
|
|||
const wxString& GetSimCommand() const |
|||
{ |
|||
return m_simCommand; |
|||
} |
|||
|
|||
void SetNetlistExporter( NETLIST_EXPORTER_PSPICE_SIM* aExporter ) |
|||
{ |
|||
m_exporter = aExporter; |
|||
} |
|||
|
|||
bool TransferDataFromWindow() override; |
|||
bool TransferDataToWindow() override; |
|||
|
|||
private: |
|||
enum SCALE_TYPE |
|||
{ |
|||
DECADE, |
|||
OCTAVE, |
|||
LINEAR |
|||
}; |
|||
|
|||
void onLoadDirectives( wxCommandEvent& event ) override; |
|||
|
|||
static wxString scaleToString( int aOption ) |
|||
{ |
|||
switch( aOption ) |
|||
{ |
|||
case DECADE: |
|||
return wxString( "dec" ); |
|||
|
|||
case OCTAVE: |
|||
return wxString( "oct" ); |
|||
|
|||
case LINEAR: |
|||
return wxString( "lin" ); |
|||
} |
|||
|
|||
wxASSERT_MSG( false, "Unhandled scale type" ); |
|||
|
|||
return wxEmptyString; |
|||
} |
|||
|
|||
wxString m_simCommand; |
|||
NETLIST_EXPORTER_PSPICE_SIM* m_exporter; |
|||
|
|||
wxFloatingPointValidator<double> m_posFloatValidator; |
|||
wxIntegerValidator<int> m_posIntValidator; |
|||
}; |
|||
|
|||
#endif /* DIALOG_SIM_SETTINGS_BASE_H */ |
|||
@ -0,0 +1,404 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version Jun 24 2016)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO "NOT" EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "dialog_sim_settings_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
DIALOG_SIM_SETTINGS_BASE::DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) |
|||
{ |
|||
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); |
|||
|
|||
wxBoxSizer* bSizer1; |
|||
bSizer1 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_simPages = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_pgAC = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
wxBoxSizer* bSizer3; |
|||
bSizer3 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
|
|||
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
wxString m_acScaleChoices[] = { wxT("Decade"), wxT("Octave"), wxT("Linear") }; |
|||
int m_acScaleNChoices = sizeof( m_acScaleChoices ) / sizeof( wxString ); |
|||
m_acScale = new wxRadioBox( m_pgAC, wxID_ANY, wxT("Frequency scale"), wxDefaultPosition, wxDefaultSize, m_acScaleNChoices, m_acScaleChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_acScale->SetSelection( 0 ); |
|||
bSizer3->Add( m_acScale, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); |
|||
|
|||
|
|||
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
wxFlexGridSizer* fgSizer1; |
|||
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 ); |
|||
fgSizer1->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticText1 = new wxStaticText( m_pgAC, wxID_ANY, wxT("Number of points"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText1->Wrap( -1 ); |
|||
fgSizer1->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_acPointsNumber = new wxTextCtrl( m_pgAC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer1->Add( m_acPointsNumber, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
m_staticText2 = new wxStaticText( m_pgAC, wxID_ANY, wxT("Start frequency [Hz]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText2->Wrap( -1 ); |
|||
fgSizer1->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_acFreqStart = new wxTextCtrl( m_pgAC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer1->Add( m_acFreqStart, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
m_staticText3 = new wxStaticText( m_pgAC, wxID_ANY, wxT("Stop frequency [Hz]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText3->Wrap( -1 ); |
|||
fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_acFreqStop = new wxTextCtrl( m_pgAC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer1->Add( m_acFreqStop, 0, wxALL, 5 ); |
|||
|
|||
|
|||
bSizer3->Add( fgSizer1, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); |
|||
|
|||
|
|||
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
m_pgAC->SetSizer( bSizer3 ); |
|||
m_pgAC->Layout(); |
|||
bSizer3->Fit( m_pgAC ); |
|||
m_simPages->AddPage( m_pgAC, wxT("AC"), true ); |
|||
m_pgDC = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
wxBoxSizer* bSizer4; |
|||
bSizer4 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxStaticBoxSizer* sbSizer21; |
|||
sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( m_pgDC, wxID_ANY, wxT("DC sweep source 1") ), wxVERTICAL ); |
|||
|
|||
m_dcEnable1 = new wxCheckBox( sbSizer21->GetStaticBox(), wxID_ANY, wxT("Enable"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sbSizer21->Add( m_dcEnable1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); |
|||
|
|||
wxFlexGridSizer* fgSizer21; |
|||
fgSizer21 = new wxFlexGridSizer( 0, 2, 0, 0 ); |
|||
fgSizer21->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer21->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticText41 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, wxT("DC source"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText41->Wrap( -1 ); |
|||
fgSizer21->Add( m_staticText41, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcSource1 = new wxComboBox( sbSizer21->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
|||
fgSizer21->Add( m_dcSource1, 0, wxALL, 5 ); |
|||
|
|||
m_staticText51 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, wxT("Starting voltage [V]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText51->Wrap( -1 ); |
|||
fgSizer21->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcStart1 = new wxTextCtrl( sbSizer21->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer21->Add( m_dcStart1, 0, wxALL, 5 ); |
|||
|
|||
m_staticText61 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, wxT("Final voltage [V]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText61->Wrap( -1 ); |
|||
fgSizer21->Add( m_staticText61, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcStop1 = new wxTextCtrl( sbSizer21->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer21->Add( m_dcStop1, 0, wxALL, 5 ); |
|||
|
|||
m_staticText71 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, wxT("Increment step [V]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText71->Wrap( -1 ); |
|||
fgSizer21->Add( m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcIncr1 = new wxTextCtrl( sbSizer21->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer21->Add( m_dcIncr1, 0, wxALL, 5 ); |
|||
|
|||
|
|||
sbSizer21->Add( fgSizer21, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); |
|||
|
|||
|
|||
bSizer4->Add( sbSizer21, 1, wxEXPAND, 5 ); |
|||
|
|||
wxStaticBoxSizer* sbSizer2; |
|||
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_pgDC, wxID_ANY, wxT("DC sweep source 2") ), wxVERTICAL ); |
|||
|
|||
m_dcEnable2 = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Enable"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sbSizer2->Add( m_dcEnable2, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); |
|||
|
|||
wxFlexGridSizer* fgSizer2; |
|||
fgSizer2 = new wxFlexGridSizer( 0, 2, 0, 0 ); |
|||
fgSizer2->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticText4 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("DC source"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText4->Wrap( -1 ); |
|||
fgSizer2->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcSource2 = new wxComboBox( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
|||
fgSizer2->Add( m_dcSource2, 0, wxALL, 5 ); |
|||
|
|||
m_staticText5 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Starting voltage [V]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText5->Wrap( -1 ); |
|||
fgSizer2->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcStart2 = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer2->Add( m_dcStart2, 0, wxALL, 5 ); |
|||
|
|||
m_staticText6 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Final voltage [V]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText6->Wrap( -1 ); |
|||
fgSizer2->Add( m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcStop2 = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer2->Add( m_dcStop2, 0, wxALL, 5 ); |
|||
|
|||
m_staticText7 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Increment step [V]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText7->Wrap( -1 ); |
|||
fgSizer2->Add( m_staticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_dcIncr2 = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer2->Add( m_dcIncr2, 0, wxALL, 5 ); |
|||
|
|||
|
|||
sbSizer2->Add( fgSizer2, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); |
|||
|
|||
|
|||
bSizer4->Add( sbSizer2, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
m_pgDC->SetSizer( bSizer4 ); |
|||
m_pgDC->Layout(); |
|||
bSizer4->Fit( m_pgDC ); |
|||
m_simPages->AddPage( m_pgDC, wxT("DC Transfer"), false ); |
|||
m_pgDistortion = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
m_pgDistortion->Hide(); |
|||
|
|||
m_simPages->AddPage( m_pgDistortion, wxT("Distortion"), false ); |
|||
m_pgNoise = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
wxBoxSizer* bSizer15; |
|||
bSizer15 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
|
|||
bSizer15->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
wxFlexGridSizer* fgSizer7; |
|||
fgSizer7 = new wxFlexGridSizer( 0, 3, 0, 0 ); |
|||
fgSizer7->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticText14 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("Measured node"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText14->Wrap( -1 ); |
|||
fgSizer7->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_noiseMeas = new wxComboBox( m_pgNoise, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
|||
fgSizer7->Add( m_noiseMeas, 0, wxALL, 5 ); |
|||
|
|||
|
|||
fgSizer7->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
m_staticText15 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("Reference node"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText15->Wrap( -1 ); |
|||
fgSizer7->Add( m_staticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_noiseRef = new wxComboBox( m_pgNoise, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
|||
fgSizer7->Add( m_noiseRef, 0, wxALL, 5 ); |
|||
|
|||
m_staticText23 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("(optional; default GND)"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText23->Wrap( -1 ); |
|||
fgSizer7->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_staticText16 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("Noise source"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText16->Wrap( -1 ); |
|||
fgSizer7->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_noiseSrc = new wxComboBox( m_pgNoise, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
|||
fgSizer7->Add( m_noiseSrc, 0, wxALL, 5 ); |
|||
|
|||
|
|||
fgSizer7->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
bSizer15->Add( fgSizer7, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); |
|||
|
|||
|
|||
bSizer15->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
wxString m_noiseScaleChoices[] = { wxT("Decade"), wxT("Octave"), wxT("Linear") }; |
|||
int m_noiseScaleNChoices = sizeof( m_noiseScaleChoices ) / sizeof( wxString ); |
|||
m_noiseScale = new wxRadioBox( m_pgNoise, wxID_ANY, wxT("Frequency scale"), wxDefaultPosition, wxDefaultSize, m_noiseScaleNChoices, m_noiseScaleChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_noiseScale->SetSelection( 0 ); |
|||
bSizer15->Add( m_noiseScale, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); |
|||
|
|||
|
|||
bSizer15->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
wxFlexGridSizer* fgSizer11; |
|||
fgSizer11 = new wxFlexGridSizer( 0, 2, 0, 0 ); |
|||
fgSizer11->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticText11 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("Number of points"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText11->Wrap( -1 ); |
|||
fgSizer11->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_noisePointsNumber = new wxTextCtrl( m_pgNoise, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer11->Add( m_noisePointsNumber, 0, wxALL, 5 ); |
|||
|
|||
m_staticText21 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("Start frequency [Hz]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText21->Wrap( -1 ); |
|||
fgSizer11->Add( m_staticText21, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_noiseFreqStart = new wxTextCtrl( m_pgNoise, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer11->Add( m_noiseFreqStart, 0, wxALL, 5 ); |
|||
|
|||
m_staticText31 = new wxStaticText( m_pgNoise, wxID_ANY, wxT("Stop frequency [Hz]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText31->Wrap( -1 ); |
|||
fgSizer11->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_noiseFreqStop = new wxTextCtrl( m_pgNoise, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer11->Add( m_noiseFreqStop, 0, wxALL, 5 ); |
|||
|
|||
|
|||
bSizer15->Add( fgSizer11, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); |
|||
|
|||
|
|||
bSizer15->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
m_pgNoise->SetSizer( bSizer15 ); |
|||
m_pgNoise->Layout(); |
|||
bSizer15->Fit( m_pgNoise ); |
|||
m_simPages->AddPage( m_pgNoise, wxT("Noise"), false ); |
|||
m_pgOP = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
wxBoxSizer* bSizer8; |
|||
bSizer8 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
|
|||
bSizer8->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
m_staticText13 = new wxStaticText( m_pgOP, wxID_ANY, wxT("This tab has no settings"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText13->Wrap( -1 ); |
|||
bSizer8->Add( m_staticText13, 0, wxALIGN_CENTER, 5 ); |
|||
|
|||
|
|||
bSizer8->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
m_pgOP->SetSizer( bSizer8 ); |
|||
m_pgOP->Layout(); |
|||
bSizer8->Fit( m_pgOP ); |
|||
m_simPages->AddPage( m_pgOP, wxT("Operating Point"), false ); |
|||
m_pgPoleZero = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
m_pgPoleZero->Hide(); |
|||
|
|||
m_simPages->AddPage( m_pgPoleZero, wxT("Pole-Zero"), false ); |
|||
m_pgSensitivity = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
m_pgSensitivity->Hide(); |
|||
|
|||
m_simPages->AddPage( m_pgSensitivity, wxT("Sensitvity"), false ); |
|||
m_pgTransferFunction = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
m_pgTransferFunction->Hide(); |
|||
|
|||
m_simPages->AddPage( m_pgTransferFunction, wxT("Transfer Function"), false ); |
|||
m_pgTransient = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
wxBoxSizer* bSizer81; |
|||
bSizer81 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
|
|||
bSizer81->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
wxFlexGridSizer* fgSizer6; |
|||
fgSizer6 = new wxFlexGridSizer( 0, 3, 0, 0 ); |
|||
fgSizer6->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticText151 = new wxStaticText( m_pgTransient, wxID_ANY, wxT("Time step [s]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText151->Wrap( -1 ); |
|||
fgSizer6->Add( m_staticText151, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_transStep = new wxTextCtrl( m_pgTransient, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer6->Add( m_transStep, 0, wxALL, 5 ); |
|||
|
|||
|
|||
fgSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
m_staticText161 = new wxStaticText( m_pgTransient, wxID_ANY, wxT("Final time [s]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText161->Wrap( -1 ); |
|||
fgSizer6->Add( m_staticText161, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_transFinal = new wxTextCtrl( m_pgTransient, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer6->Add( m_transFinal, 0, wxALL, 5 ); |
|||
|
|||
|
|||
fgSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
m_staticText17 = new wxStaticText( m_pgTransient, wxID_ANY, wxT("Initial time [s]"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText17->Wrap( -1 ); |
|||
fgSizer6->Add( m_staticText17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
m_transInitial = new wxTextCtrl( m_pgTransient, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer6->Add( m_transInitial, 0, wxALL, 5 ); |
|||
|
|||
m_staticText24 = new wxStaticText( m_pgTransient, wxID_ANY, wxT("(optional; default 0)"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText24->Wrap( -1 ); |
|||
fgSizer6->Add( m_staticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); |
|||
|
|||
|
|||
bSizer81->Add( fgSizer6, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); |
|||
|
|||
|
|||
bSizer81->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
m_pgTransient->SetSizer( bSizer81 ); |
|||
m_pgTransient->Layout(); |
|||
bSizer81->Fit( m_pgTransient ); |
|||
m_simPages->AddPage( m_pgTransient, wxT("Transient"), false ); |
|||
m_pgCustom = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); |
|||
wxBoxSizer* bSizer2; |
|||
bSizer2 = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_staticText18 = new wxStaticText( m_pgCustom, wxID_ANY, wxT("Spice directives:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText18->Wrap( -1 ); |
|||
bSizer2->Add( m_staticText18, 0, wxALL, 5 ); |
|||
|
|||
m_customTxt = new wxTextCtrl( m_pgCustom, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); |
|||
m_customTxt->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); |
|||
|
|||
bSizer2->Add( m_customTxt, 1, wxALL|wxEXPAND, 5 ); |
|||
|
|||
m_loadDirectives = new wxButton( m_pgCustom, wxID_ANY, wxT("Load directives from schematic"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizer2->Add( m_loadDirectives, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
|
|||
m_pgCustom->SetSizer( bSizer2 ); |
|||
m_pgCustom->Layout(); |
|||
bSizer2->Fit( m_pgCustom ); |
|||
m_simPages->AddPage( m_pgCustom, wxT("Custom"), false ); |
|||
|
|||
bSizer1->Add( m_simPages, 1, wxEXPAND | wxALL, 5 ); |
|||
|
|||
m_sdbSizer1 = new wxStdDialogButtonSizer(); |
|||
m_sdbSizer1OK = new wxButton( this, wxID_OK ); |
|||
m_sdbSizer1->AddButton( m_sdbSizer1OK ); |
|||
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); |
|||
m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); |
|||
m_sdbSizer1->Realize(); |
|||
|
|||
bSizer1->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
|
|||
this->SetSizer( bSizer1 ); |
|||
this->Layout(); |
|||
|
|||
this->Centre( wxBOTH ); |
|||
|
|||
// Connect Events
|
|||
m_loadDirectives->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_SETTINGS_BASE::onLoadDirectives ), NULL, this ); |
|||
} |
|||
|
|||
DIALOG_SIM_SETTINGS_BASE::~DIALOG_SIM_SETTINGS_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
m_loadDirectives->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_SETTINGS_BASE::onLoadDirectives ), NULL, this ); |
|||
|
|||
} |
|||
5680
eeschema/dialogs/dialog_sim_settings_base.fbp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,121 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Jun 24 2016) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO "NOT" EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#ifndef __DIALOG_SIM_SETTINGS_BASE_H__ |
|||
#define __DIALOG_SIM_SETTINGS_BASE_H__ |
|||
|
|||
#include <wx/artprov.h> |
|||
#include <wx/xrc/xmlres.h> |
|||
#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/stattext.h> |
|||
#include <wx/textctrl.h> |
|||
#include <wx/valtext.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/panel.h> |
|||
#include <wx/bitmap.h> |
|||
#include <wx/image.h> |
|||
#include <wx/icon.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/combobox.h> |
|||
#include <wx/statbox.h> |
|||
#include <wx/button.h> |
|||
#include <wx/notebook.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_SIM_SETTINGS_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_SIM_SETTINGS_BASE : public wxDialog |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
wxNotebook* m_simPages; |
|||
wxPanel* m_pgAC; |
|||
wxRadioBox* m_acScale; |
|||
wxStaticText* m_staticText1; |
|||
wxTextCtrl* m_acPointsNumber; |
|||
wxStaticText* m_staticText2; |
|||
wxTextCtrl* m_acFreqStart; |
|||
wxStaticText* m_staticText3; |
|||
wxTextCtrl* m_acFreqStop; |
|||
wxPanel* m_pgDC; |
|||
wxCheckBox* m_dcEnable1; |
|||
wxStaticText* m_staticText41; |
|||
wxComboBox* m_dcSource1; |
|||
wxStaticText* m_staticText51; |
|||
wxTextCtrl* m_dcStart1; |
|||
wxStaticText* m_staticText61; |
|||
wxTextCtrl* m_dcStop1; |
|||
wxStaticText* m_staticText71; |
|||
wxTextCtrl* m_dcIncr1; |
|||
wxCheckBox* m_dcEnable2; |
|||
wxStaticText* m_staticText4; |
|||
wxComboBox* m_dcSource2; |
|||
wxStaticText* m_staticText5; |
|||
wxTextCtrl* m_dcStart2; |
|||
wxStaticText* m_staticText6; |
|||
wxTextCtrl* m_dcStop2; |
|||
wxStaticText* m_staticText7; |
|||
wxTextCtrl* m_dcIncr2; |
|||
wxPanel* m_pgDistortion; |
|||
wxPanel* m_pgNoise; |
|||
wxStaticText* m_staticText14; |
|||
wxComboBox* m_noiseMeas; |
|||
wxStaticText* m_staticText15; |
|||
wxComboBox* m_noiseRef; |
|||
wxStaticText* m_staticText23; |
|||
wxStaticText* m_staticText16; |
|||
wxComboBox* m_noiseSrc; |
|||
wxRadioBox* m_noiseScale; |
|||
wxStaticText* m_staticText11; |
|||
wxTextCtrl* m_noisePointsNumber; |
|||
wxStaticText* m_staticText21; |
|||
wxTextCtrl* m_noiseFreqStart; |
|||
wxStaticText* m_staticText31; |
|||
wxTextCtrl* m_noiseFreqStop; |
|||
wxPanel* m_pgOP; |
|||
wxStaticText* m_staticText13; |
|||
wxPanel* m_pgPoleZero; |
|||
wxPanel* m_pgSensitivity; |
|||
wxPanel* m_pgTransferFunction; |
|||
wxPanel* m_pgTransient; |
|||
wxStaticText* m_staticText151; |
|||
wxTextCtrl* m_transStep; |
|||
wxStaticText* m_staticText161; |
|||
wxTextCtrl* m_transFinal; |
|||
wxStaticText* m_staticText17; |
|||
wxTextCtrl* m_transInitial; |
|||
wxStaticText* m_staticText24; |
|||
wxPanel* m_pgCustom; |
|||
wxStaticText* m_staticText18; |
|||
wxTextCtrl* m_customTxt; |
|||
wxButton* m_loadDirectives; |
|||
wxStdDialogButtonSizer* m_sdbSizer1; |
|||
wxButton* m_sdbSizer1OK; |
|||
wxButton* m_sdbSizer1Cancel; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void onLoadDirectives( wxCommandEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Simulation settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 439,534 ), long style = wxDEFAULT_DIALOG_STYLE ); |
|||
~DIALOG_SIM_SETTINGS_BASE(); |
|||
|
|||
}; |
|||
|
|||
#endif //__DIALOG_SIM_SETTINGS_BASE_H__ |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue