diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt
index 153ea03583..3548114718 100644
--- a/eeschema/CMakeLists.txt
+++ b/eeschema/CMakeLists.txt
@@ -272,6 +272,7 @@ if( KICAD_SPICE )
sim/sim_plot_frame.cpp
sim/sim_plot_frame_base.cpp
sim/sim_plot_panel.cpp
+ sim/sim_panel_base.cpp
sim/spice_simulator.cpp
sim/spice_value.cpp
simulation_cursors.cpp
diff --git a/eeschema/dialogs/dialog_sim_settings.cpp b/eeschema/dialogs/dialog_sim_settings.cpp
index 0c602c1339..f308ab1b6d 100644
--- a/eeschema/dialogs/dialog_sim_settings.cpp
+++ b/eeschema/dialogs/dialog_sim_settings.cpp
@@ -67,7 +67,6 @@ DIALOG_SIM_SETTINGS::DIALOG_SIM_SETTINGS( wxWindow* aParent )
// wxPanel::Hide() isn't enough on some platforms
m_simPages->RemovePage( m_simPages->FindPage( m_pgDistortion ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgNoise ) );
- m_simPages->RemovePage( m_simPages->FindPage( m_pgOP ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgPoleZero ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgSensitivity ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgTransferFunction ) );
diff --git a/eeschema/dialogs/dialog_sim_settings_base.cpp b/eeschema/dialogs/dialog_sim_settings_base.cpp
index 03a2978b69..1be449dc11 100644
--- a/eeschema/dialogs/dialog_sim_settings_base.cpp
+++ b/eeschema/dialogs/dialog_sim_settings_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Dec 30 2017)
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -12,75 +12,75 @@
DIALOG_SIM_SETTINGS_BASE::DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( 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_simPages->SetMinSize( wxSize( 650,-1 ) );
-
+
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[] = { _("Decade"), _("Octave"), _("Linear") };
int m_acScaleNChoices = sizeof( m_acScaleChoices ) / sizeof( wxString );
m_acScale = new wxRadioBox( m_pgAC, wxID_ANY, _("Frequency scale"), wxDefaultPosition, wxDefaultSize, m_acScaleNChoices, m_acScaleChoices, 1, wxRA_SPECIFY_COLS );
m_acScale->SetSelection( 0 );
m_acScale->Hide();
-
+
bSizer3->Add( m_acScale, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
-
-
+
+
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
-
+
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
+
m_staticText1 = new wxStaticText( m_pgAC, wxID_ANY, _("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 );
-
-
+
+
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
-
+
m_staticText2 = new wxStaticText( m_pgAC, wxID_ANY, _("Start frequency:"), 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_staticText19 = new wxStaticText( m_pgAC, wxID_ANY, _("Hertz"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText19->Wrap( -1 );
fgSizer1->Add( m_staticText19, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
+
m_staticText3 = new wxStaticText( m_pgAC, wxID_ANY, _("Stop frequency:"), 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|wxEXPAND, 5 );
-
+
m_staticText110 = new wxStaticText( m_pgAC, wxID_ANY, _("Hertz"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText110->Wrap( -1 );
fgSizer1->Add( m_staticText110, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
-
+
+
bSizer3->Add( fgSizer1, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
-
-
+
+
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
-
-
+
+
m_pgAC->SetSizer( bSizer3 );
m_pgAC->Layout();
bSizer3->Fit( m_pgAC );
@@ -88,329 +88,327 @@ DIALOG_SIM_SETTINGS_BASE::DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID
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, _("DC sweep source 1:") ), wxVERTICAL );
-
+
m_dcEnable1 = new wxCheckBox( sbSizer21->GetStaticBox(), wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, 0 );
- m_dcEnable1->SetValue(true);
+ m_dcEnable1->SetValue(true);
sbSizer21->Add( m_dcEnable1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
-
+
wxFlexGridSizer* fgSizer21;
fgSizer21 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer21->SetFlexibleDirection( wxBOTH );
fgSizer21->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
+
m_staticText41 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("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 );
+
+ m_dcSource1 = new wxComboBox( sbSizer21->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fgSizer21->Add( m_dcSource1, 0, wxALL, 5 );
-
-
+
+
fgSizer21->Add( 0, 0, 1, wxEXPAND, 5 );
-
+
m_staticText51 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("Starting voltage:"), 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_staticText511 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("Volts"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText511->Wrap( -1 );
fgSizer21->Add( m_staticText511, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
+
m_staticText61 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("Final voltage:"), 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_staticText512 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("Volts"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText512->Wrap( -1 );
fgSizer21->Add( m_staticText512, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
+
m_staticText71 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("Increment step:"), 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 );
-
+
m_staticText513 = new wxStaticText( sbSizer21->GetStaticBox(), wxID_ANY, _("Volts"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText513->Wrap( -1 );
fgSizer21->Add( m_staticText513, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
-
+
+
sbSizer21->Add( fgSizer21, 1, wxALIGN_CENTER_HORIZONTAL, 5 );
-
-
+
+
bSizer4->Add( sbSizer21, 0, wxEXPAND, 5 );
-
+
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_pgDC, wxID_ANY, _("DC sweep source 2:") ), wxVERTICAL );
-
+
m_dcEnable2 = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer2->Add( m_dcEnable2, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
-
+
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer2->SetFlexibleDirection( wxBOTH );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
+
m_staticText4 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("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 );
+
+ m_dcSource2 = new wxComboBox( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fgSizer2->Add( m_dcSource2, 0, wxALL, 5 );
-
-
+
+
fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
-
+
m_staticText5 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Starting voltage:"), 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_staticText52 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Volts"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText52->Wrap( -1 );
fgSizer2->Add( m_staticText52, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
+
m_staticText6 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Final voltage:"), 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_staticText53 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Volts"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText53->Wrap( -1 );
fgSizer2->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
+
m_staticText7 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Increment step:"), 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 );
-
+
m_staticText54 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Volts"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText54->Wrap( -1 );
fgSizer2->Add( m_staticText54, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
-
+
+
sbSizer2->Add( fgSizer2, 1, wxALIGN_CENTER_HORIZONTAL, 5 );
-
-
+
+
bSizer4->Add( sbSizer2, 0, wxEXPAND, 5 );
-
-
+
+
m_pgDC->SetSizer( bSizer4 );
m_pgDC->Layout();
bSizer4->Fit( m_pgDC );
m_simPages->AddPage( m_pgDC, _("DC Transfer"), true );
m_pgDistortion = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_pgDistortion->Hide();
-
+
m_simPages->AddPage( m_pgDistortion, _("Distortion"), false );
m_pgNoise = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_pgNoise->Hide();
-
+
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, _("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 );
+
+ 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, _("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 );
+
+ 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, _("(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, _("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 );
+
+ 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, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
-
-
+
+
bSizer15->Add( 0, 0, 1, wxEXPAND, 5 );
-
+
wxString m_noiseScaleChoices[] = { _("Decade"), _("Octave"), _("Linear") };
int m_noiseScaleNChoices = sizeof( m_noiseScaleChoices ) / sizeof( wxString );
m_noiseScale = new wxRadioBox( m_pgNoise, wxID_ANY, _("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, _("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, _("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, _("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, 0, 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, _("Noise"), false );
m_pgOP = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
- m_pgOP->Hide();
-
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
-
-
+
+
bSizer8->Add( 0, 0, 1, wxEXPAND, 5 );
-
+
m_staticText13 = new wxStaticText( m_pgOP, wxID_ANY, _("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, _("Operating Point"), false );
m_pgPoleZero = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_pgPoleZero->Hide();
-
+
m_simPages->AddPage( m_pgPoleZero, _("Pole-Zero"), false );
m_pgSensitivity = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_pgSensitivity->Hide();
-
+
m_simPages->AddPage( m_pgSensitivity, _("Sensitivity"), false );
m_pgTransferFunction = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_pgTransferFunction->Hide();
-
+
m_simPages->AddPage( m_pgTransferFunction, _("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, 4, 0, 0 );
fgSizer6->SetFlexibleDirection( wxBOTH );
fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
+
m_staticText151 = new wxStaticText( m_pgTransient, wxID_ANY, _("Time step:"), 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 );
-
+
m_staticText1511 = new wxStaticText( m_pgTransient, wxID_ANY, _("seconds"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1511->Wrap( -1 );
fgSizer6->Add( m_staticText1511, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
-
+
+
fgSizer6->Add( 0, 0, 0, wxEXPAND, 5 );
-
+
m_staticText161 = new wxStaticText( m_pgTransient, wxID_ANY, _("Final time:"), 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 );
-
+
m_staticText1512 = new wxStaticText( m_pgTransient, wxID_ANY, _("seconds"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1512->Wrap( -1 );
fgSizer6->Add( m_staticText1512, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
-
-
+
+
fgSizer6->Add( 0, 0, 0, wxEXPAND, 5 );
-
+
m_staticText17 = new wxStaticText( m_pgTransient, wxID_ANY, _("Initial time:"), 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_staticText1513 = new wxStaticText( m_pgTransient, wxID_ANY, _("seconds"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1513->Wrap( -1 );
fgSizer6->Add( m_staticText1513, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT, 5 );
-
+
m_staticText24 = new wxStaticText( m_pgTransient, wxID_ANY, _("(optional; default 0)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText24->Wrap( -1 );
fgSizer6->Add( m_staticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-
-
+
+
bSizer81->Add( fgSizer6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
-
-
+
+
bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
-
-
+
+
m_pgTransient->SetSizer( bSizer81 );
m_pgTransient->Layout();
bSizer81->Fit( m_pgTransient );
@@ -418,56 +416,56 @@ DIALOG_SIM_SETTINGS_BASE::DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID
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, _("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, _("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, _("Custom"), false );
-
+
bSizer1->Add( m_simPages, 1, wxEXPAND | wxALL, 5 );
-
+
wxBoxSizer* bSizer88;
bSizer88 = new wxBoxSizer( wxVERTICAL );
-
+
m_fixPassiveVals = new wxCheckBox( this, wxID_ANY, _("Adjust passive symbol values (e.g. M -> Meg; 100 nF -> 100n)"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer88->Add( m_fixPassiveVals, 0, wxALL, 5 );
-
+
m_fixIncludePaths = new wxCheckBox( this, wxID_ANY, _("Add full path for .include library directives"), wxDefaultPosition, wxDefaultSize, 0 );
- m_fixIncludePaths->SetValue(true);
+ m_fixIncludePaths->SetValue(true);
bSizer88->Add( m_fixIncludePaths, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
-
-
+
+
bSizer1->Add( bSizer88, 0, wxEXPAND|wxALL, 5 );
-
+
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
-
+
bSizer1->Add( m_sdbSizer, 0, wxALL|wxALIGN_RIGHT, 5 );
-
-
+
+
this->SetSizer( bSizer1 );
this->Layout();
bSizer1->Fit( this );
-
+
this->Centre( wxBOTH );
-
+
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SIM_SETTINGS_BASE::onInitDlg ) );
m_loadDirectives->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_SETTINGS_BASE::onLoadDirectives ), NULL, this );
@@ -478,5 +476,5 @@ DIALOG_SIM_SETTINGS_BASE::~DIALOG_SIM_SETTINGS_BASE()
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SIM_SETTINGS_BASE::onInitDlg ) );
m_loadDirectives->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_SETTINGS_BASE::onLoadDirectives ), NULL, this );
-
+
}
diff --git a/eeschema/dialogs/dialog_sim_settings_base.fbp b/eeschema/dialogs/dialog_sim_settings_base.fbp
index f0ff065048..40ebbed26a 100644
--- a/eeschema/dialogs/dialog_sim_settings_base.fbp
+++ b/eeschema/dialogs/dialog_sim_settings_base.fbp
@@ -1,6820 +1,5020 @@
-
-
-
-
-
+
+
+
+
+
+ C++
+ 1
+ source_name
+ 0
+ 0
+ res
+ UTF-8
+ connect
+ dialog_sim_settings_base
+ 1000
+ none
+
+ 1
+ DIALOG_SIM_SETTINGS_BASE
+
+ .
+
+ 1
+ 1
+ 1
+ 1
+ UI
+ 0
+ 0
+
+ 0
+ wxAUI_MGR_DEFAULT
+
+ wxBOTH
+
+ 1
+ 1
+ impl_virtual
+
+
+
+ 0
+ wxID_ANY
+
+
+ DIALOG_SIM_SETTINGS_BASE
+
+ -1,-1
+ wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
+ DIALOG_SHIM; dialog_shim.h
+ Simulation settings
+
+
+
+
+ onInitDlg
+
+
+ bSizer1
+ wxVERTICAL
+ none
+
+ 5
+ wxEXPAND | wxALL
+ 1
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
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+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Adjust passive symbol values (e.g. M -> Meg; 100 nF -> 100n)
+
+ 0
+
+
+ 0
+
+ 1
+ m_fixPassiveVals
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+ 5
+ wxBOTTOM|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Add full path for .include library directives
+
+ 0
+
+
+ 0
+
+ 1
+ m_fixIncludePaths
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL|wxALIGN_RIGHT
+ 0
+
+ 0
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+
+ m_sdbSizer
+ protected
+
+
+
+
+
+
diff --git a/eeschema/dialogs/dialog_sim_settings_base.h b/eeschema/dialogs/dialog_sim_settings_base.h
index 51f9046e73..79546380bf 100644
--- a/eeschema/dialogs/dialog_sim_settings_base.h
+++ b/eeschema/dialogs/dialog_sim_settings_base.h
@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Dec 30 2017)
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
-#ifndef __DIALOG_SIM_SETTINGS_BASE_H__
-#define __DIALOG_SIM_SETTINGS_BASE_H__
+#pragma once
#include
#include
@@ -42,7 +41,7 @@
class DIALOG_SIM_SETTINGS_BASE : public DIALOG_SHIM
{
private:
-
+
protected:
wxNotebook* m_simPages;
wxPanel* m_pgAC;
@@ -121,17 +120,16 @@ class DIALOG_SIM_SETTINGS_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
-
+
// Virtual event handlers, overide them in your derived class
virtual void onInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void onLoadDirectives( wxCommandEvent& event ) { event.Skip(); }
-
-
+
+
public:
-
- DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Simulation settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+
+ DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Simulation settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_SIM_SETTINGS_BASE();
-
+
};
-#endif //__DIALOG_SIM_SETTINGS_BASE_H__
diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp
index 4115e214ee..6735afeef9 100644
--- a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp
+++ b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp
@@ -443,9 +443,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|| couplingK.Matches( line ) // K## L## L## coupling constant
|| ( directiveStarted && line.StartsWith( '+' ) ) ) // multiline directives
{
- // Pad the directive to ensure we distinguish between short directives
- // and the start of a longer directive
- m_directives.emplace_back( line + " " );
+ m_directives.push_back( line );
}
diff --git a/eeschema/sim/netlist_exporter_pspice_sim.cpp b/eeschema/sim/netlist_exporter_pspice_sim.cpp
index 7be95a31e7..04ca17cf69 100644
--- a/eeschema/sim/netlist_exporter_pspice_sim.cpp
+++ b/eeschema/sim/netlist_exporter_pspice_sim.cpp
@@ -23,10 +23,11 @@
*/
#include "netlist_exporter_pspice_sim.h"
+#include
#include
-wxString NETLIST_EXPORTER_PSPICE_SIM::GetSpiceVector( const wxString& aName, SIM_PLOT_TYPE aType,
- const wxString& aParam ) const
+wxString NETLIST_EXPORTER_PSPICE_SIM::ComponentToVector(
+ const wxString& aName, SIM_PLOT_TYPE aType, const wxString& aParam ) const
{
wxString res;
@@ -68,6 +69,41 @@ wxString NETLIST_EXPORTER_PSPICE_SIM::GetSpiceVector( const wxString& aName, SIM
}
+SIM_PLOT_TYPE NETLIST_EXPORTER_PSPICE_SIM::VectorToSignal(
+ const std::string& aVector, wxString& aSignal ) const
+{
+ using namespace std;
+
+ // See ngspice manual chapt. 31.1 "Accessing internal device parameters"
+ wxRegEx internalDevParameter( "^@(\\w*[\\.\\w+]*)\\[(\\w*)\\]$", wxRE_ADVANCED );
+ wxString vector( aVector );
+
+ if( !internalDevParameter.Matches( vector ) )
+ {
+ // any text is a node name, which returns voltage
+ aSignal = "V(" + aVector + ")";
+ return SPT_VOLTAGE;
+ }
+ else
+ {
+ wxString paramType = internalDevParameter.GetMatch( vector, 2 );
+
+ if( paramType.Lower()[0] == 'i' )
+ {
+ // this is a branch current
+ paramType[0] = 'I';
+ aSignal = paramType + "(";
+ aSignal += internalDevParameter.GetMatch( vector, 1 ).Upper() + ")";
+ return SPT_CURRENT;
+ }
+ else
+ {
+ return SPT_UNKNOWN;
+ }
+ }
+}
+
+
const std::vector& NETLIST_EXPORTER_PSPICE_SIM::GetCurrents( SPICE_PRIMITIVE aPrimitive )
{
static const std::vector passive = { "I" };
@@ -129,16 +165,23 @@ SIM_TYPE NETLIST_EXPORTER_PSPICE_SIM::GetSimType()
SIM_TYPE NETLIST_EXPORTER_PSPICE_SIM::CommandToSimType( const wxString& aCmd )
{
- const std::map simCmds = {
- { ".ac ", ST_AC }, { ".dc ", ST_DC }, { ".disto ", ST_DISTORTION }, { ".noise ", ST_NOISE },
- { ".op ", ST_OP }, { ".pz ", ST_POLE_ZERO }, { ".sens ", ST_SENSITIVITY }, { ".tf ", ST_TRANS_FUNC },
- { ".tran ", ST_TRANSIENT }
- };
- wxString lcaseCmd = aCmd.Lower();
+ const std::vector> simCmds = {
+ { "^.ac\\M.*", ST_AC },
+ { "^.dc\\M.*", ST_DC },
+ { "^.tran\\M.*", ST_TRANSIENT },
+ { "^.op\\M.*", ST_OP },
+ { "^.disto\\M.*", ST_DISTORTION },
+ { "^.noise\\M.*", ST_NOISE },
+ { "^.pz\\M.*", ST_POLE_ZERO },
+ { "^.sens\\M.*", ST_SENSITIVITY },
+ { "^.tf\\M.*", ST_TRANS_FUNC } };
+ wxRegEx simCmd;
for( const auto& c : simCmds )
{
- if( lcaseCmd.StartsWith( c.first ) )
+ simCmd.Compile( c.first, wxRE_ADVANCED | wxRE_NOSUB | wxRE_ICASE );
+
+ if( simCmd.Matches( aCmd ) )
return c.second;
}
@@ -193,7 +236,8 @@ void NETLIST_EXPORTER_PSPICE_SIM::writeDirectives( OUTPUTFORMATTER* aFormatter,
/// @todo is it required to switch to lowercase
aFormatter->Print( 0, ".save %s\n",
- (const char*) GetSpiceVector( item.m_refName, SPT_CURRENT, current ).c_str() );
+ (const char*) ComponentToVector( item.m_refName, SPT_CURRENT, current )
+ .c_str() );
}
}
@@ -202,7 +246,7 @@ void NETLIST_EXPORTER_PSPICE_SIM::writeDirectives( OUTPUTFORMATTER* aFormatter,
{
// the "0" and the "GND" nets are automaticallly saved internally by ngspice.
// Skip them
- wxString netname = GetSpiceVector( netMap.first, SPT_VOLTAGE );
+ wxString netname = ComponentToVector( netMap.first, SPT_VOLTAGE );
if( netname == "V(0)" || netname == "V(GND)" )
continue;
diff --git a/eeschema/sim/netlist_exporter_pspice_sim.h b/eeschema/sim/netlist_exporter_pspice_sim.h
index aeacbb7987..5dc6091de9 100644
--- a/eeschema/sim/netlist_exporter_pspice_sim.h
+++ b/eeschema/sim/netlist_exporter_pspice_sim.h
@@ -60,9 +60,18 @@ public:
* @return Empty string if query is invalid, otherwise a plot name that
* can be requested from the simulator.
*/
- wxString GetSpiceVector( const wxString& aName, SIM_PLOT_TYPE aType,
+ wxString ComponentToVector( const wxString& aName, SIM_PLOT_TYPE aType,
const wxString& aParam = wxEmptyString ) const;
+ /**
+ * @brief Returns name of Spice dataset for a specific plot.
+ * @param aVector is name of the vector produced by ngspice
+ * @param [out] aSignal is output in form: V(R1), Ib(Q2), I(L8)
+ * @return [SPT_VOLTAGE, SPT_CURRENT]. Otherwise SPT_UNKNOWN if vector is
+ * of different, unsupported type.
+ */
+ SIM_PLOT_TYPE VectorToSignal( const std::string& aVector, wxString& aSignal ) const;
+
/**
* @brief Returns a list of currents that can be probed in a Spice primitive.
*/
diff --git a/eeschema/sim/ngspice.cpp b/eeschema/sim/ngspice.cpp
index a61b726615..3f91315546 100644
--- a/eeschema/sim/ngspice.cpp
+++ b/eeschema/sim/ngspice.cpp
@@ -41,15 +41,16 @@ using namespace std;
static const wxChar* const traceNgspice = wxT( "KICAD_NGSPICE" );
-NGSPICE::NGSPICE() :
- m_ngSpice_Init( nullptr ),
- m_ngSpice_Circ( nullptr ),
- m_ngSpice_Command( nullptr ),
- m_ngGet_Vec_Info( nullptr ),
- m_ngSpice_AllPlots( nullptr ),
- m_ngSpice_AllVecs( nullptr ),
- m_ngSpice_Running( nullptr ),
- m_error( false )
+NGSPICE::NGSPICE()
+ : m_ngSpice_Init( nullptr ),
+ m_ngSpice_Circ( nullptr ),
+ m_ngSpice_Command( nullptr ),
+ m_ngGet_Vec_Info( nullptr ),
+ m_ngSpice_CurPlot( nullptr ),
+ m_ngSpice_AllPlots( nullptr ),
+ m_ngSpice_AllVecs( nullptr ),
+ m_ngSpice_Running( nullptr ),
+ m_error( false )
{
init_dll();
}
@@ -66,6 +67,28 @@ void NGSPICE::Init()
}
+vector NGSPICE::AllPlots()
+{
+ LOCALE_IO c_locale; // ngspice works correctly only with C locale
+ char* currentPlot = m_ngSpice_CurPlot();
+ char** allPlots = m_ngSpice_AllVecs( currentPlot );
+ int noOfPlots = 0;
+
+ if( allPlots != nullptr )
+ for( char** plot = allPlots; *plot != nullptr; plot++ )
+ noOfPlots++;
+
+ vector retVal( noOfPlots );
+ for( int i = 0; i < noOfPlots; i++, allPlots++ )
+ {
+ string vec = *allPlots;
+ retVal.at( i ) = vec;
+ }
+
+ return retVal;
+}
+
+
vector NGSPICE::GetPlot( const string& aName, int aMaxLen )
{
LOCALE_IO c_locale; // ngspice works correctly only with C locale
@@ -361,6 +384,7 @@ void NGSPICE::init_dll()
m_ngSpice_Circ = (ngSpice_Circ) m_dll.GetSymbol( "ngSpice_Circ" );
m_ngSpice_Command = (ngSpice_Command) m_dll.GetSymbol( "ngSpice_Command" );
m_ngGet_Vec_Info = (ngGet_Vec_Info) m_dll.GetSymbol( "ngGet_Vec_Info" );
+ m_ngSpice_CurPlot = (ngSpice_CurPlot) m_dll.GetSymbol( "ngSpice_CurPlot" );
m_ngSpice_AllPlots = (ngSpice_AllPlots) m_dll.GetSymbol( "ngSpice_AllPlots" );
m_ngSpice_AllVecs = (ngSpice_AllVecs) m_dll.GetSymbol( "ngSpice_AllVecs" );
m_ngSpice_Running = (ngSpice_Running) m_dll.GetSymbol( "ngSpice_running" ); // it is not a typo
diff --git a/eeschema/sim/ngspice.h b/eeschema/sim/ngspice.h
index 5c4058b592..a1e434a4ba 100644
--- a/eeschema/sim/ngspice.h
+++ b/eeschema/sim/ngspice.h
@@ -59,6 +59,9 @@ public:
///> @copydoc SPICE_SIMULATOR::GetXAxis()
std::string GetXAxis( SIM_TYPE aType ) const override;
+ ///> @copydoc SPICE_SIMULATOR::AllPlots()
+ std::vector AllPlots() override;
+
///> @copydoc SPICE_SIMULATOR::GetPlot()
std::vector GetPlot( const std::string& aName, int aMaxLen = -1 ) override;
@@ -89,6 +92,7 @@ private:
typedef int (*ngSpice_Circ)( char** circarray );
typedef int (*ngSpice_Command)( char* command );
typedef pvector_info (*ngGet_Vec_Info)( char* vecname );
+ typedef char* ( *ngSpice_CurPlot )( void );
typedef char** (*ngSpice_AllPlots)( void );
typedef char** (*ngSpice_AllVecs)( char* plotname );
typedef bool (*ngSpice_Running)( void );
@@ -98,6 +102,7 @@ private:
ngSpice_Circ m_ngSpice_Circ;
ngSpice_Command m_ngSpice_Command;
ngGet_Vec_Info m_ngGet_Vec_Info;
+ ngSpice_CurPlot m_ngSpice_CurPlot;
ngSpice_AllPlots m_ngSpice_AllPlots;
ngSpice_AllVecs m_ngSpice_AllVecs;
ngSpice_Running m_ngSpice_Running;
diff --git a/eeschema/sim/sim_panel_base.cpp b/eeschema/sim/sim_panel_base.cpp
new file mode 100644
index 0000000000..51be9f640b
--- /dev/null
+++ b/eeschema/sim/sim_panel_base.cpp
@@ -0,0 +1,97 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2016 CERN
+ * @author Sylwester Kocjan
+ *
+ * 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, you may find one here:
+ * https://www.gnu.org/licenses/gpl-3.0.html
+ * or you may search the http://www.gnu.org website for the version 3 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "sim_panel_base.h"
+
+#include "sim_plot_frame.h"
+
+#include
+
+
+SIM_PANEL_BASE::SIM_PANEL_BASE() : m_type( ST_UNKNOWN )
+{
+}
+
+
+SIM_PANEL_BASE::SIM_PANEL_BASE( SIM_TYPE aType ) : m_type( aType )
+{
+}
+
+
+SIM_PANEL_BASE::SIM_PANEL_BASE( SIM_TYPE aType, wxWindow* parent, wxWindowID id,
+ const wxPoint& pos, const wxSize& size, long style, const wxString& name )
+ : wxWindow( parent, id, pos, size, style, name ), m_type( aType )
+{
+}
+
+
+SIM_PANEL_BASE::~SIM_PANEL_BASE()
+{
+}
+
+
+bool SIM_PANEL_BASE::IsPlottable( SIM_TYPE aSimType )
+{
+ switch( aSimType )
+ {
+ case ST_AC:
+ case ST_DC:
+ case ST_TRANSIENT:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+
+SIM_NOPLOT_PANEL::SIM_NOPLOT_PANEL( SIM_TYPE aType, wxWindow* parent, wxWindowID id,
+ const wxPoint& pos, const wxSize& size, long style, const wxString& name )
+ : SIM_PANEL_BASE( aType, parent, id, pos, size, style, name )
+{
+ m_sizer = new wxBoxSizer( wxVERTICAL );
+ m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
+
+ m_textInfo = new wxStaticText( dynamic_cast( this ), wxID_ANY, "", wxDefaultPosition,
+ wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
+ m_textInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT,
+ wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
+ m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
+
+ //ST_UNKNOWN serves purpose of a welcome panel
+ m_textInfo->SetLabel(
+ ( aType == ST_UNKNOWN ) ?
+ _( "Start the simulation by clicking the Run Simulation button" ) :
+ _( "This simulation provide no plots. Please refer to console window for results" ) );
+
+ m_sizer->Add( m_textInfo, 1, wxALL | wxEXPAND, 5 );
+ m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
+
+ dynamic_cast( this )->SetSizer( m_sizer );
+}
+
+
+SIM_NOPLOT_PANEL::~SIM_NOPLOT_PANEL()
+{
+}
diff --git a/eeschema/sim/sim_panel_base.h b/eeschema/sim/sim_panel_base.h
new file mode 100644
index 0000000000..2b572559f1
--- /dev/null
+++ b/eeschema/sim/sim_panel_base.h
@@ -0,0 +1,72 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2016 CERN
+ * Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * @author Sylwester Kocjan
+ *
+ * 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, you may find one here:
+ * https://www.gnu.org/licenses/gpl-3.0.html
+ * or you may search the http://www.gnu.org website for the version 3 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __SIM_PLOT_PANEL_BASE_H
+#define __SIM_PLOT_PANEL_BASE_H
+
+#include "sim_types.h"
+#include
+#include
+#include
+
+
+class SIM_PANEL_BASE : public wxWindow
+{
+public:
+ SIM_PANEL_BASE();
+ SIM_PANEL_BASE( SIM_TYPE );
+ SIM_PANEL_BASE( SIM_TYPE aType, wxWindow* parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ long style = 0, const wxString& name = wxPanelNameStr );
+ virtual ~SIM_PANEL_BASE();
+
+ static bool IsPlottable( SIM_TYPE aSimType );
+
+ SIM_TYPE GetType() const
+ {
+ return m_type;
+ }
+
+private:
+ const SIM_TYPE m_type;
+};
+
+
+class SIM_NOPLOT_PANEL : public SIM_PANEL_BASE
+{
+public:
+ SIM_NOPLOT_PANEL( SIM_TYPE aType, wxWindow* parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ long style = 0, const wxString& name = wxPanelNameStr );
+
+ virtual ~SIM_NOPLOT_PANEL();
+
+private:
+ wxSizer* m_sizer;
+ wxStaticText* m_textInfo;
+};
+
+
+#endif
diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp
index 25a89d2ddd..678eb9e040 100644
--- a/eeschema/sim/sim_plot_frame.cpp
+++ b/eeschema/sim/sim_plot_frame.cpp
@@ -118,7 +118,10 @@ TRACE_DESC::TRACE_DESC( const NETLIST_EXPORTER_PSPICE_SIM& aExporter, const wxSt
wxString SIM_PLOT_FRAME::m_savedWorkbooksPath;
SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent )
- : SIM_PLOT_FRAME_BASE( aParent ), m_lastSimPlot( nullptr )
+ : SIM_PLOT_FRAME_BASE( aParent ),
+ m_lastSimPlot( nullptr ),
+ m_welcomePanel( nullptr ),
+ m_plotNumber( 0 )
{
SetKiway( this, aKiway );
m_signalsIconColorList = NULL;
@@ -204,7 +207,9 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent )
Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onSettings, this, m_settings->GetId() );
m_toolBar->Realize();
- m_plotNotebook->SetPageText( 0, _( "Welcome!" ) );
+
+ m_welcomePanel = new SIM_PANEL_BASE( ST_UNKNOWN, m_plotNotebook, wxID_ANY );
+ m_plotNotebook->AddPage( m_welcomePanel, _( "Welcome!" ), 1, true );
// the settings dialog will be created later, on demand.
// if created in the ctor, for some obscure reason, there is an issue
@@ -419,10 +424,9 @@ void SIM_PLOT_FRAME::fillDefaultColorList( bool aWhiteBg )
}
-void SIM_PLOT_FRAME::StartSimulation()
+void SIM_PLOT_FRAME::StartSimulation( const wxString& aSimCommand )
{
STRING_FORMATTER formatter;
- SIM_PLOT_PANEL* plotPanel = CurrentPlot();
if( !m_settingsDlg )
m_settingsDlg = new DIALOG_SIM_SETTINGS( this );
@@ -430,8 +434,16 @@ void SIM_PLOT_FRAME::StartSimulation()
m_simConsole->Clear();
updateNetlistExporter();
- if( plotPanel )
- m_exporter->SetSimCommand( m_plots[plotPanel].m_simCommand );
+ if( aSimCommand.IsEmpty() )
+ {
+ SIM_PANEL_BASE* plotPanel = currentPlotWindow();
+ if( plotPanel )
+ m_exporter->SetSimCommand( m_plots[plotPanel].m_simCommand );
+ }
+ else
+ {
+ m_exporter->SetSimCommand( aSimCommand );
+ }
if( !m_exporter->Format( &formatter, m_settingsDlg->GetNetlistOptions() ) )
{
@@ -464,12 +476,26 @@ bool SIM_PLOT_FRAME::IsSimulationRunning()
}
-SIM_PLOT_PANEL* SIM_PLOT_FRAME::NewPlotPanel( SIM_TYPE aSimType )
+SIM_PANEL_BASE* SIM_PLOT_FRAME::NewPlotPanel( SIM_TYPE aSimType )
{
- SIM_PLOT_PANEL* plotPanel = new SIM_PLOT_PANEL( aSimType, m_plotNotebook, this, wxID_ANY );
+ SIM_PANEL_BASE* plotPanel;
- plotPanel->EnableMouseWheelPan(
- m_schematicFrame->GetCanvas()->GetViewControls()->IsMousewheelPanEnabled() );
+ if( SIM_PANEL_BASE::IsPlottable( aSimType ) )
+ {
+ SIM_PLOT_PANEL* panel;
+ panel = new SIM_PLOT_PANEL( aSimType, m_plotNotebook, this, wxID_ANY );
+
+ panel->GetPlotWin()->EnableMouseWheelPan(
+ m_schematicFrame->GetCanvas()->GetViewControls()->IsMousewheelPanEnabled() );
+
+ plotPanel = dynamic_cast( panel );
+ }
+ else
+ {
+ SIM_NOPLOT_PANEL* panel;
+ panel = new SIM_NOPLOT_PANEL( aSimType, m_plotNotebook, wxID_ANY );
+ plotPanel = dynamic_cast( panel );
+ }
if( m_welcomePanel )
{
@@ -477,9 +503,10 @@ SIM_PLOT_PANEL* SIM_PLOT_FRAME::NewPlotPanel( SIM_TYPE aSimType )
m_welcomePanel = nullptr;
}
- m_plotNotebook->AddPage( plotPanel, wxString::Format( _( "Plot%u" ),
- (unsigned int) m_plotNotebook->GetPageCount() + 1 ), true );
+ wxString pageTitle( m_simulator->TypeToName( aSimType, true ) );
+ pageTitle.Prepend( wxString::Format( _( "Plot%u - " ), (unsigned int) ++m_plotNumber ) );
+ m_plotNotebook->AddPage( dynamic_cast( plotPanel ), pageTitle, true );
m_plots[plotPanel] = PLOT_INFO();
return plotPanel;
@@ -500,9 +527,9 @@ void SIM_PLOT_FRAME::AddCurrentPlot( const wxString& aDeviceName, const wxString
void SIM_PLOT_FRAME::AddTuner( SCH_COMPONENT* aComponent )
{
- SIM_PLOT_PANEL* plotPanel = CurrentPlot();
+ SIM_PANEL_BASE* plotPanel = currentPlotWindow();
- if( !plotPanel )
+ if( !plotPanel || plotPanel == m_welcomePanel )
return;
// For now limit the tuner tool to RLC components
@@ -550,9 +577,11 @@ void SIM_PLOT_FRAME::RemoveTuner( TUNER_SLIDER* aTuner, bool aErase )
SIM_PLOT_PANEL* SIM_PLOT_FRAME::CurrentPlot() const
{
- wxWindow* curPage = m_plotNotebook->GetCurrentPage();
+ SIM_PANEL_BASE* curPage = currentPlotWindow();
- return ( curPage == m_welcomePanel ) ? nullptr : static_cast( curPage );
+ return ( ( !curPage || curPage->GetType() == ST_UNKNOWN ) ?
+ nullptr :
+ dynamic_cast( curPage ) );
}
@@ -572,7 +601,7 @@ void SIM_PLOT_FRAME::addPlot( const wxString& aName, SIM_PLOT_TYPE aType, const
m_simConsole->SetInsertionPointEnd();
return;
}
- else if( !SIM_PLOT_PANEL::IsPlottable( simType ) )
+ else if( !SIM_PANEL_BASE::IsPlottable( simType ) )
{
m_simConsole->AppendText( _( "Error: simulation type doesn't support plotting!\n" ) );
m_simConsole->SetInsertionPointEnd();
@@ -583,7 +612,7 @@ void SIM_PLOT_FRAME::addPlot( const wxString& aName, SIM_PLOT_TYPE aType, const
SIM_PLOT_PANEL* plotPanel = CurrentPlot();
if( !plotPanel || plotPanel->GetType() != simType )
- plotPanel = NewPlotPanel( simType );
+ plotPanel = dynamic_cast( NewPlotPanel( simType ) );
TRACE_DESC descriptor( *m_exporter, aName, aType, aParam );
@@ -630,10 +659,11 @@ void SIM_PLOT_FRAME::removePlot( const wxString& aPlotName, bool aErase )
wxASSERT( plotPanel->TraceShown( aPlotName ) );
plotPanel->DeleteTrace( aPlotName );
- plotPanel->Fit();
+ plotPanel->GetPlotWin()->Fit();
updateSignalList();
- updateCursors();
+ wxCommandEvent dummy;
+ onCursorUpdate( dummy );
}
@@ -646,10 +676,10 @@ void SIM_PLOT_FRAME::updateNetlistExporter()
bool SIM_PLOT_FRAME::updatePlot( const TRACE_DESC& aDescriptor, SIM_PLOT_PANEL* aPanel )
{
SIM_TYPE simType = m_exporter->GetSimType();
- wxString spiceVector = m_exporter->GetSpiceVector( aDescriptor.GetName(),
- aDescriptor.GetType(), aDescriptor.GetParam() );
+ wxString spiceVector = m_exporter->ComponentToVector(
+ aDescriptor.GetName(), aDescriptor.GetType(), aDescriptor.GetParam() );
- if( !SIM_PLOT_PANEL::IsPlottable( simType ) )
+ if( !SIM_PANEL_BASE::IsPlottable( simType ) )
{
// There is no plot to be shown
m_simulator->Command( wxString::Format( "print %s", spiceVector ).ToStdString() );
@@ -760,13 +790,13 @@ bool SIM_PLOT_FRAME::updatePlot( const TRACE_DESC& aDescriptor, SIM_PLOT_PANEL*
void SIM_PLOT_FRAME::updateSignalList()
{
+ m_signals->ClearAll();
+
SIM_PLOT_PANEL* plotPanel = CurrentPlot();
if( !plotPanel )
return;
- m_signals->ClearAll();
-
wxSize size = m_signals->GetClientSize();
m_signals->AppendColumn( _( "Signal" ), wxLIST_FORMAT_LEFT, size.x );
@@ -824,12 +854,6 @@ void SIM_PLOT_FRAME::updateSignalList()
}
-void SIM_PLOT_FRAME::updateCursors()
-{
- wxQueueEvent( this, new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );
-}
-
-
void SIM_PLOT_FRAME::updateTuners()
{
const auto& spiceItems = m_exporter->GetSpiceItems();
@@ -891,9 +915,9 @@ bool SIM_PLOT_FRAME::loadWorkbook( const wxString& aPath )
if( !file.GetNextLine().ToLong( &plotType ) )
return false;
- SIM_PLOT_PANEL* plotPanel = NewPlotPanel( (SIM_TYPE) plotType );
+ SIM_PANEL_BASE* plotPanel = NewPlotPanel( (SIM_TYPE) plotType );
m_plots[plotPanel].m_simCommand = file.GetNextLine();
- StartSimulation();
+ StartSimulation( m_plots[plotPanel].m_simCommand );
// Perform simulation, so plots can be added with values
do
@@ -952,19 +976,22 @@ bool SIM_PLOT_FRAME::saveWorkbook( const wxString& aPath )
file.Create();
}
- file.AddLine( wxString::Format( "%lu", m_plots.size() ) );
+ file.AddLine( wxString::Format( "%llu", m_plots.size() ) );
for( const auto& plot : m_plots )
{
- file.AddLine( wxString::Format( "%d", plot.first->GetType() ) );
- file.AddLine( plot.second.m_simCommand );
- file.AddLine( wxString::Format( "%lu", plot.second.m_traces.size() ) );
-
- for( const auto& trace : plot.second.m_traces )
+ if( plot.first )
{
- file.AddLine( wxString::Format( "%d", trace.second.GetType() ) );
- file.AddLine( trace.second.GetName() );
- file.AddLine( trace.second.GetParam() );
+ file.AddLine( wxString::Format( "%d", plot.first->GetType() ) );
+ file.AddLine( plot.second.m_simCommand );
+ file.AddLine( wxString::Format( "%llu", plot.second.m_traces.size() ) );
+
+ for( const auto& trace : plot.second.m_traces )
+ {
+ file.AddLine( wxString::Format( "%d", trace.second.GetType() ) );
+ file.AddLine( trace.second.GetName() );
+ file.AddLine( trace.second.GetParam() );
+ }
}
}
@@ -1000,10 +1027,10 @@ void SIM_PLOT_FRAME::menuNewPlot( wxCommandEvent& aEvent )
{
SIM_TYPE type = m_exporter->GetSimType();
- if( SIM_PLOT_PANEL::IsPlottable( type ) )
+ if( SIM_PANEL_BASE::IsPlottable( type ) )
{
SIM_PLOT_PANEL* prevPlot = CurrentPlot();
- SIM_PLOT_PANEL* newPlot = NewPlotPanel( type );
+ SIM_PLOT_PANEL* newPlot = dynamic_cast( NewPlotPanel( type ) );
// If the previous plot had the same type, copy the simulation command
if( prevPlot )
@@ -1056,7 +1083,7 @@ void SIM_PLOT_FRAME::menuSaveImage( wxCommandEvent& event )
if( saveDlg.ShowModal() == wxID_CANCEL )
return;
- CurrentPlot()->SaveScreenshot( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
+ CurrentPlot()->GetPlotWin()->SaveScreenshot( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
}
@@ -1106,21 +1133,21 @@ void SIM_PLOT_FRAME::menuSaveCsv( wxCommandEvent& event )
void SIM_PLOT_FRAME::menuZoomIn( wxCommandEvent& event )
{
if( CurrentPlot() )
- CurrentPlot()->ZoomIn();
+ CurrentPlot()->GetPlotWin()->ZoomIn();
}
void SIM_PLOT_FRAME::menuZoomOut( wxCommandEvent& event )
{
if( CurrentPlot() )
- CurrentPlot()->ZoomOut();
+ CurrentPlot()->GetPlotWin()->ZoomOut();
}
void SIM_PLOT_FRAME::menuZoomFit( wxCommandEvent& event )
{
if( CurrentPlot() )
- CurrentPlot()->Fit();
+ CurrentPlot()->GetPlotWin()->Fit();
}
@@ -1201,21 +1228,21 @@ void SIM_PLOT_FRAME::onPlotClose( wxAuiNotebookEvent& event )
if( idx == wxNOT_FOUND )
return;
- SIM_PLOT_PANEL* plotPanel = dynamic_cast( m_plotNotebook->GetPage( idx ) );
-
- if( !plotPanel )
- return;
+ SIM_PANEL_BASE* plotPanel =
+ dynamic_cast( m_plotNotebook->GetPage( idx ) );
m_plots.erase( plotPanel );
updateSignalList();
- updateCursors();
+ wxCommandEvent dummy;
+ onCursorUpdate( dummy );
}
void SIM_PLOT_FRAME::onPlotChanged( wxAuiNotebookEvent& event )
{
updateSignalList();
- updateCursors();
+ wxCommandEvent dummy;
+ onCursorUpdate( dummy );
}
@@ -1258,7 +1285,7 @@ void SIM_PLOT_FRAME::onSimulate( wxCommandEvent& event )
void SIM_PLOT_FRAME::onSettings( wxCommandEvent& event )
{
- SIM_PLOT_PANEL* plotPanel = CurrentPlot();
+ SIM_PANEL_BASE* plotPanelWindow = currentPlotWindow();
// Initial processing is required to e.g. display a list of power sources
updateNetlistExporter();
@@ -1272,8 +1299,8 @@ void SIM_PLOT_FRAME::onSettings( wxCommandEvent& event )
if( !m_settingsDlg )
m_settingsDlg = new DIALOG_SIM_SETTINGS( this );
- if( plotPanel )
- m_settingsDlg->SetSimCommand( m_plots[plotPanel].m_simCommand );
+ if( plotPanelWindow != m_welcomePanel )
+ m_settingsDlg->SetSimCommand( m_plots[plotPanelWindow].m_simCommand );
m_settingsDlg->SetNetlistExporter( m_exporter.get() );
@@ -1283,12 +1310,12 @@ void SIM_PLOT_FRAME::onSettings( wxCommandEvent& event )
SIM_TYPE newSimType = NETLIST_EXPORTER_PSPICE_SIM::CommandToSimType( newCommand );
// If it is a new simulation type, open a new plot
- if( !plotPanel || ( plotPanel && plotPanel->GetType() != newSimType ) )
+ if( !plotPanelWindow || ( plotPanelWindow && plotPanelWindow->GetType() != newSimType ) )
{
- plotPanel = NewPlotPanel( newSimType );
+ plotPanelWindow = NewPlotPanel( newSimType );
}
- m_plots[plotPanel].m_simCommand = newCommand;
+ m_plots[plotPanelWindow].m_simCommand = newCommand;
}
}
@@ -1299,7 +1326,7 @@ void SIM_PLOT_FRAME::onAddSignal( wxCommandEvent& event )
if( !plotPanel || !m_exporter || plotPanel->GetType() != m_exporter->GetSimType() )
{
- DisplayInfoMessage( this, _( "You need to run simulation first." ) );
+ DisplayInfoMessage( this, _( "You need to run plot-providing simulation first." ) );
return;
}
@@ -1455,18 +1482,19 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
if( simType == ST_UNKNOWN )
return;
- SIM_PLOT_PANEL* plotPanel = CurrentPlot();
+ SIM_PANEL_BASE* plotPanelWindow = currentPlotWindow();
- if( !plotPanel || plotPanel->GetType() != simType )
- plotPanel = NewPlotPanel( simType );
+ if( !plotPanelWindow || plotPanelWindow->GetType() != simType )
+ plotPanelWindow = NewPlotPanel( simType );
if( IsSimulationRunning() )
return;
// If there are any signals plotted, update them
- if( SIM_PLOT_PANEL::IsPlottable( simType ) )
+ if( SIM_PANEL_BASE::IsPlottable( simType ) )
{
- TRACE_MAP& traceMap = m_plots[plotPanel].m_traces;
+ TRACE_MAP& traceMap = m_plots[plotPanelWindow].m_traces;
+ SIM_PLOT_PANEL* plotPanel = dynamic_cast( plotPanelWindow );
for( auto it = traceMap.begin(); it != traceMap.end(); /* iteration occurs in the loop */)
{
@@ -1482,18 +1510,33 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
}
updateSignalList();
- plotPanel->UpdateAll();
+ plotPanel->GetPlotWin()->UpdateAll();
plotPanel->ResetScales();
}
- else
+ else if( simType == ST_OP )
{
- /// @todo do not make it hardcoded for ngspice
- for( const auto& net : m_exporter->GetNetIndexMap() )
- {
- int node = net.second;
+ m_simConsole->AppendText( _( "\n\nSimulation results:\n\n" ) );
+ m_simConsole->SetInsertionPointEnd();
- if( node > 0 )
- m_simulator->Command( wxString::Format( "print v(%d)", node ).ToStdString() );
+ for( const auto& vec : m_simulator->AllPlots() )
+ {
+ double val = m_simulator->GetRealPlot( vec, 1 ).at( 0 );
+
+ wxString outLine, signal;
+ SIM_PLOT_TYPE type = m_exporter->VectorToSignal( vec, signal );
+
+ const size_t tab = 25; //characters
+ size_t padding = ( signal.length() < tab ) ? ( tab - signal.length() ) : 1;
+
+ outLine.Printf( wxT( "%s%s" ), ( signal + wxT( ":" ) ).Pad( padding, wxUniChar( ' ' ) ),
+ SPICE_VALUE( val ).ToSpiceString() );
+
+ outLine.Append( type == SPT_CURRENT ? "A\n" : "V\n" );
+
+ m_simConsole->AppendText( outLine );
+ m_simConsole->SetInsertionPointEnd();
+
+ // @todo display calculated values on the schematic
}
}
}
diff --git a/eeschema/sim/sim_plot_frame.h b/eeschema/sim/sim_plot_frame.h
index f8a2146278..65cceef1c9 100644
--- a/eeschema/sim/sim_plot_frame.h
+++ b/eeschema/sim/sim_plot_frame.h
@@ -51,7 +51,10 @@ class SCH_COMPONENT;
class SPICE_SIMULATOR;
class NETLIST_EXPORTER_PSPICE_SIM;
-class SIM_PLOT_PANEL;
+
+#include "sim_plot_panel.h"
+#include "sim_panel_base.h"
+
class SIM_THREAD_REPORTER;
class TUNER_SLIDER;
@@ -117,6 +120,7 @@ private:
wxString m_title;
};
+
/** Implementing SIM_PLOT_FRAME_BASE */
class SIM_PLOT_FRAME : public SIM_PLOT_FRAME_BASE
{
@@ -125,7 +129,7 @@ public:
SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent );
~SIM_PLOT_FRAME();
- void StartSimulation();
+ void StartSimulation( const wxString& aSimCommand = wxEmptyString );
void StopSimulation();
bool IsSimulationRunning();
@@ -135,7 +139,7 @@ public:
* @param aSimType is requested simulation type.
* @return The new plot panel.
*/
- SIM_PLOT_PANEL* NewPlotPanel( SIM_TYPE aSimType );
+ SIM_PANEL_BASE* NewPlotPanel( SIM_TYPE aSimType );
/**
* @brief Adds a voltage plot for a given net name.
@@ -211,6 +215,14 @@ private:
*/
void fillDefaultColorList( bool aWhiteBg );
+ /**
+ * @brief Returns the currently opened plot panel (or NULL if there is none).
+ */
+ SIM_PANEL_BASE* currentPlotWindow() const
+ {
+ return dynamic_cast( m_plotNotebook->GetCurrentPage() );
+ }
+
/**
* @brief Adds a new plot to the current panel.
* @param aName is the device/net name.
@@ -245,11 +257,6 @@ private:
*/
void updateSignalList();
- /**
- * @brief Updates the cursor values list.
- */
- void updateCursors();
-
/**
* @brief Filters out tuners for components that do not exist anymore.
* Decisions are based on the current NETLIST_EXPORTER data.
@@ -359,7 +366,7 @@ private:
};
///> Map of plot panels and associated data
- std::map m_plots;
+ std::map m_plots;
///> List of currently displayed tuners
std::list m_tuners;
@@ -400,12 +407,16 @@ private:
///> A string to store the path of saved workbooks during a session
static wxString m_savedWorkbooksPath;
+ ///> Info panel
+ SIM_PANEL_BASE* m_welcomePanel;
+
// Variables for temporary storage:
int m_splitterLeftRightSashPosition;
int m_splitterPlotAndConsoleSashPosition;
int m_splitterSignalsSashPosition;
int m_splitterTuneValuesSashPosition;
bool m_plotUseWhiteBg;
+ unsigned int m_plotNumber;
///> The color list to draw traces, bg, fg, axis...
std::vector m_colorList;
diff --git a/eeschema/sim/sim_plot_frame_base.cpp b/eeschema/sim/sim_plot_frame_base.cpp
index 747d343211..ee22477dec 100644
--- a/eeschema/sim/sim_plot_frame_base.cpp
+++ b/eeschema/sim/sim_plot_frame_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jul 10 2019)
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -141,39 +141,6 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
m_plotNotebook = new wxAuiNotebook( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT|wxAUI_NB_TOP );
m_plotNotebook->SetMinSize( wxSize( 200,-1 ) );
- m_welcomePanel = new wxPanel( m_plotNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
- m_sizer8 = new wxBoxSizer( wxVERTICAL );
-
-
- m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
-
- wxBoxSizer* bSizer81;
- bSizer81 = new wxBoxSizer( wxHORIZONTAL );
-
-
- bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
-
- m_staticTextInfo = new wxStaticText( m_welcomePanel, wxID_ANY, _("Start the simulation by clicking the Run Simulation button"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticTextInfo->Wrap( -1 );
- m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
- m_staticTextInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
-
- bSizer81->Add( m_staticTextInfo, 0, wxALL|wxEXPAND, 5 );
-
-
- bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
-
-
- m_sizer8->Add( bSizer81, 0, wxEXPAND, 5 );
-
-
- m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
-
-
- m_welcomePanel->SetSizer( m_sizer8 );
- m_welcomePanel->Layout();
- m_sizer8->Fit( m_welcomePanel );
- m_plotNotebook->AddPage( m_welcomePanel, _("a page"), false, wxNullBitmap );
m_sizerPlot->Add( m_plotNotebook, 1, wxEXPAND, 5 );
diff --git a/eeschema/sim/sim_plot_frame_base.fbp b/eeschema/sim/sim_plot_frame_base.fbp
index 62871a9ca9..092c7b7f7f 100644
--- a/eeschema/sim/sim_plot_frame_base.fbp
+++ b/eeschema/sim/sim_plot_frame_base.fbp
@@ -14,7 +14,6 @@
sim_plot_frame_base
1000
none
-
1
SpiceWindow
@@ -26,7 +25,6 @@
1
1
UI
- 0
0
0
@@ -753,181 +751,6 @@
onPlotChanged
onPlotClose
-
-
- a page
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
-
- 1
-
- 0
- 0
- wxID_ANY
-
- 0
-
-
- 0
-
- 1
- m_welcomePanel
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
- 0
-
-
-
- wxTAB_TRAVERSAL
-
-
- m_sizer8
- wxVERTICAL
- protected
-
- 5
- wxEXPAND
- 1
-
- 0
- protected
- 0
-
-
-
- 5
- wxEXPAND
- 0
-
-
- bSizer81
- wxHORIZONTAL
- none
-
- 5
- wxEXPAND
- 1
-
- 0
- protected
- 0
-
-
-
- 5
- wxALL|wxEXPAND
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 1
- wxSYS_COLOUR_GRAYTEXT
- 1
- ,90,92,-1,70,0
- 0
- 0
- wxID_ANY
- Start the simulation by clicking the Run Simulation button
- 0
-
- 0
-
-
- 0
-
- 1
- m_staticTextInfo
- 1
-
-
- protected
- 1
-
- Resizable
- 1
-
-
-
- 0
-
-
-
-
- -1
-
-
-
- 5
- wxEXPAND
- 1
-
- 0
- protected
- 0
-
-
-
-
-
- 5
- wxEXPAND
- 1
-
- 0
- protected
- 0
-
-
-
-
-
diff --git a/eeschema/sim/sim_plot_frame_base.h b/eeschema/sim/sim_plot_frame_base.h
index 238a111ab6..ca64c4ce18 100644
--- a/eeschema/sim/sim_plot_frame_base.h
+++ b/eeschema/sim/sim_plot_frame_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jul 10 2019)
+// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -7,30 +7,28 @@
#pragma once
-#include
-#include
-#include
-class wxListView;
-
#include "kiway_player.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
///////////////////////////////////////////////////////////////////////////
@@ -74,9 +72,6 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
wxPanel* m_plotPanel;
wxBoxSizer* m_sizerPlot;
wxAuiNotebook* m_plotNotebook;
- wxPanel* m_welcomePanel;
- wxBoxSizer* m_sizer8;
- wxStaticText* m_staticTextInfo;
wxPanel* m_panelConsole;
wxBoxSizer* m_sizerConsole;
wxTextCtrl* m_simConsole;
diff --git a/eeschema/sim/sim_plot_panel.cpp b/eeschema/sim/sim_plot_panel.cpp
index 72ab8c4cb2..406148b613 100644
--- a/eeschema/sim/sim_plot_panel.cpp
+++ b/eeschema/sim/sim_plot_panel.cpp
@@ -364,25 +364,25 @@ void CURSOR::UpdateReference()
SIM_PLOT_PANEL::SIM_PLOT_PANEL( SIM_TYPE aType, wxWindow* parent, SIM_PLOT_FRAME* aMainFrame,
- wxWindowID id, const wxPoint& pos,
- const wxSize& size, long style, const wxString& name )
- : mpWindow( parent, id, pos, size, style ),
+ wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name )
+ : SIM_PANEL_BASE( aType, parent, id, pos, size, style, name ),
m_colorIdx( 0 ),
m_axis_x( nullptr ),
m_axis_y1( nullptr ),
m_axis_y2( nullptr ),
m_dotted_cp( false ),
- m_type( aType ),
m_masterFrame( aMainFrame )
{
- LimitView( true );
- SetMargins( 50, 80, 50, 80 );
+ m_sizer = new wxBoxSizer( wxVERTICAL );
+ m_plotWin = new mpWindow( this, wxID_ANY, pos, size, style );
- SetColourTheme( GetPlotColor( SIM_BG_COLOR ),
- GetPlotColor( SIM_FG_COLOR ),
- GetPlotColor( SIM_AXIS_COLOR ) );
+ m_plotWin->LimitView( true );
+ m_plotWin->SetMargins( 50, 80, 50, 80 );
- switch( m_type )
+ m_plotWin->SetColourTheme( GetPlotColor( SIM_BG_COLOR ), GetPlotColor( SIM_FG_COLOR ),
+ GetPlotColor( SIM_AXIS_COLOR ) );
+
+ switch( GetType() )
{
case ST_AC:
m_axis_x = new FREQUENCY_LOG_SCALE( _( "Frequency" ), mpALIGN_BOTTOM );
@@ -419,30 +419,33 @@ SIM_PLOT_PANEL::SIM_PLOT_PANEL( SIM_TYPE aType, wxWindow* parent, SIM_PLOT_FRAME
m_axis_x->SetTicks( false );
m_axis_x->SetNameAlign ( mpALIGN_BOTTOM );
- AddLayer( m_axis_x );
+ m_plotWin->AddLayer( m_axis_x );
}
if( m_axis_y1 )
{
m_axis_y1->SetTicks( false );
m_axis_y1->SetNameAlign ( mpALIGN_LEFT );
- AddLayer( m_axis_y1 );
+ m_plotWin->AddLayer( m_axis_y1 );
}
if( m_axis_y2 )
{
m_axis_y2->SetTicks( false );
m_axis_y2->SetNameAlign ( mpALIGN_RIGHT );
- AddLayer( m_axis_y2 );
+ m_plotWin->AddLayer( m_axis_y2 );
}
// a mpInfoLegend displays le name of traces on the left top panel corner:
m_legend = new mpInfoLegend( wxRect( 0, 40, 200, 40 ), wxTRANSPARENT_BRUSH );
m_legend->SetVisible( false );
- AddLayer( m_legend );
+ m_plotWin->AddLayer( m_legend );
- EnableDoubleBuffer( true );
- UpdateAll();
+ m_plotWin->EnableDoubleBuffer( true );
+ m_plotWin->UpdateAll();
+
+ m_sizer->Add( m_plotWin, 1, wxALL | wxEXPAND, 1 );
+ SetSizer( m_sizer );
}
@@ -455,11 +458,10 @@ SIM_PLOT_PANEL::~SIM_PLOT_PANEL()
void SIM_PLOT_PANEL::UpdatePlotColors()
{
// Update bg and fg colors:
- SetColourTheme( GetPlotColor( SIM_BG_COLOR ),
- GetPlotColor( SIM_FG_COLOR ),
- GetPlotColor( SIM_AXIS_COLOR ) );
+ m_plotWin->SetColourTheme( GetPlotColor( SIM_BG_COLOR ), GetPlotColor( SIM_FG_COLOR ),
+ GetPlotColor( SIM_AXIS_COLOR ) );
- UpdateAll();
+ m_plotWin->UpdateAll();
}
@@ -469,21 +471,6 @@ wxColour SIM_PLOT_PANEL::GetPlotColor( int aIndex )
}
-bool SIM_PLOT_PANEL::IsPlottable( SIM_TYPE aSimType )
-{
- switch( aSimType )
- {
- case ST_AC:
- case ST_DC:
- case ST_TRANSIENT:
- return true;
-
- default:
- return false;
- }
-}
-
-
void SIM_PLOT_PANEL::UpdateTraceStyle( TRACE* trace )
{
int flags = trace->GetFlags();
@@ -505,7 +492,7 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
if( addedNewEntry )
{
- if( m_type == ST_TRANSIENT )
+ if( GetType() == ST_TRANSIENT )
{
bool hasVoltageTraces = false;
@@ -532,12 +519,12 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
// It is a trick to keep legend & coords always on the top
for( mpLayer* l : m_topLevel )
- DelLayer( l );
+ m_plotWin->DelLayer( l );
- AddLayer( (mpLayer*) trace );
+ m_plotWin->AddLayer( (mpLayer*) trace );
for( mpLayer* l : m_topLevel )
- AddLayer( l );
+ m_plotWin->AddLayer( l );
}
else
{
@@ -546,7 +533,7 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
std::vector tmp( aY, aY + aPoints );
- if( m_type == ST_AC )
+ if( GetType() == ST_AC )
{
if( aFlags & SPT_AC_PHASE )
{
@@ -569,7 +556,7 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
trace->SetFlags( aFlags );
- UpdateAll();
+ m_plotWin->UpdateAll();
return addedNewEntry;
}
@@ -585,9 +572,9 @@ bool SIM_PLOT_PANEL::DeleteTrace( const wxString& aName )
m_traces.erase( it );
if( CURSOR* cursor = trace->GetCursor() )
- DelLayer( cursor, true );
+ m_plotWin->DelLayer( cursor, true );
- DelLayer( trace, true, true );
+ m_plotWin->DelLayer( trace, true, true );
ResetScales();
return true;
@@ -627,16 +614,19 @@ void SIM_PLOT_PANEL::EnableCursor( const wxString& aName, bool aEnable )
if( aEnable )
{
CURSOR* c = new CURSOR( t, this );
- int plotCenter = GetMarginLeft() + ( GetXScreen() - GetMarginLeft() - GetMarginRight() ) / 2;
+ int plotCenter = GetPlotWin()->GetMarginLeft()
+ + ( GetPlotWin()->GetXScreen() - GetPlotWin()->GetMarginLeft()
+ - GetPlotWin()->GetMarginRight() )
+ / 2;
c->SetX( plotCenter );
t->SetCursor( c );
- AddLayer( c );
+ m_plotWin->AddLayer( c );
}
else
{
CURSOR* c = t->GetCursor();
t->SetCursor( NULL );
- DelLayer( c, true );
+ m_plotWin->DelLayer( c, true );
}
// Notify the parent window about the changes
diff --git a/eeschema/sim/sim_plot_panel.h b/eeschema/sim/sim_plot_panel.h
index 5c5850d099..526bda7955 100644
--- a/eeschema/sim/sim_plot_panel.h
+++ b/eeschema/sim/sim_plot_panel.h
@@ -27,9 +27,11 @@
#ifndef __SIM_PLOT_PANEL_H
#define __SIM_PLOT_PANEL_H
-#include
-#include