diff --git a/eeschema/dialogs/dialog_sim_settings.cpp b/eeschema/dialogs/dialog_sim_settings.cpp index 1ae97442fb..97b43daa36 100644 --- a/eeschema/dialogs/dialog_sim_settings.cpp +++ b/eeschema/dialogs/dialog_sim_settings.cpp @@ -95,8 +95,8 @@ DIALOG_SIM_SETTINGS::DIALOG_SIM_SETTINGS( wxWindow* aParent, m_simPages->RemovePage( m_simPages->FindPage( m_pgSensitivity ) ); m_simPages->RemovePage( m_simPages->FindPage( m_pgTransferFunction ) ); - if( dynamic_cast( aSettings.get() ) == nullptr ) - m_simPages->RemovePage( m_simPages->FindPage( m_pgNgspice ) ); + if( !dynamic_cast( aSettings.get() ) ) + m_compatibilityMode->Show( false ); m_sdbSizerOK->SetDefault(); updateNetlistOpts(); @@ -168,18 +168,15 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow() if( ngspiceSettings ) { - if( m_rbNgspiceDefaultModelMode->GetValue() ) - ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::USER_CONFIG ); - else if( m_rbNgspiceSpiceModelMode->GetValue() ) - ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::NGSPICE ); - else if( m_rbNgspicePSpiceModelMode->GetValue() ) - ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::PSPICE ); - else if( m_rbNgspiceLTSpiceModelMode->GetValue() ) - ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::LTSPICE ); - else if( m_rbNgspicePLTSpiceModelMode->GetValue() ) - ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::LT_PSPICE ); - else if( m_rbNgspiceHSpiceModelMode->GetValue() ) - ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::HSPICE ); + switch( m_compatibilityModeChoice->GetSelection() ) + { + case 0: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::USER_CONFIG ); break; + case 1: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::NGSPICE ); break; + case 2: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::PSPICE ); break; + case 3: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::LTSPICE ); break; + case 4: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::LT_PSPICE ); break; + case 5: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::HSPICE ); break; + } } wxString previousSimCommand = m_simCommand; @@ -323,30 +320,12 @@ bool DIALOG_SIM_SETTINGS::TransferDataToWindow() { switch( ngspiceSettings->GetModelMode() ) { - case NGSPICE_MODEL_MODE::USER_CONFIG: - m_rbNgspiceDefaultModelMode->SetValue( true ); - break; - - case NGSPICE_MODEL_MODE::NGSPICE: - m_rbNgspiceSpiceModelMode->SetValue( true ); - break; - - case NGSPICE_MODEL_MODE::PSPICE: - m_rbNgspicePSpiceModelMode->SetValue( true ); - break; - - case NGSPICE_MODEL_MODE::LTSPICE: - m_rbNgspiceLTSpiceModelMode->SetValue( true ); - break; - - case NGSPICE_MODEL_MODE::LT_PSPICE: - m_rbNgspicePLTSpiceModelMode->SetValue( true ); - break; - - case NGSPICE_MODEL_MODE::HSPICE: - m_rbNgspiceHSpiceModelMode->SetValue( true ); - break; - + case NGSPICE_MODEL_MODE::USER_CONFIG: m_compatibilityModeChoice->SetSelection( 0 ); break; + case NGSPICE_MODEL_MODE::NGSPICE: m_compatibilityModeChoice->SetSelection( 1 ); break; + case NGSPICE_MODEL_MODE::PSPICE: m_compatibilityModeChoice->SetSelection( 2 ); break; + case NGSPICE_MODEL_MODE::LTSPICE: m_compatibilityModeChoice->SetSelection( 3 ); break; + case NGSPICE_MODEL_MODE::LT_PSPICE: m_compatibilityModeChoice->SetSelection( 4 ); break; + case NGSPICE_MODEL_MODE::HSPICE: m_compatibilityModeChoice->SetSelection( 5 ); break; default: wxFAIL_MSG( wxString::Format( "Unknown NGSPICE_MODEL_MODE %d.", ngspiceSettings->GetModelMode() ) ); diff --git a/eeschema/dialogs/dialog_sim_settings_base.cpp b/eeschema/dialogs/dialog_sim_settings_base.cpp index fa925800c8..0bb8e71f4d 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 3.9.0 Jun 18 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -415,51 +415,6 @@ DIALOG_SIM_SETTINGS_BASE::DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID m_pgCustom->Layout(); bSizer2->Fit( m_pgCustom ); m_simPages->AddPage( m_pgCustom, _("Custom"), false ); - m_pgNgspice = new wxPanel( m_simPages, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer21; - bSizer21 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_pgNgspice, wxID_ANY, _("Model Mode") ), wxVERTICAL ); - - m_rbNgspiceDefaultModelMode = new wxRadioButton( sbSizer4->GetStaticBox(), wxID_ANY, _("User configuration"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_rbNgspiceDefaultModelMode->SetToolTip( _("Use the settings in the Ngspice configuration file or any settings defined in the schematic") ); - - sbSizer4->Add( m_rbNgspiceDefaultModelMode, 0, wxLEFT|wxRIGHT, 5 ); - - m_rbNgspiceSpiceModelMode = new wxRadioButton( sbSizer4->GetStaticBox(), wxID_ANY, _("Spice"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbNgspiceSpiceModelMode->SetToolTip( _("Enable default spice model simulation") ); - - sbSizer4->Add( m_rbNgspiceSpiceModelMode, 0, wxALL, 5 ); - - m_rbNgspicePSpiceModelMode = new wxRadioButton( sbSizer4->GetStaticBox(), wxID_ANY, _("PSpice"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbNgspicePSpiceModelMode->SetToolTip( _("Enable PSpice model simulation") ); - - sbSizer4->Add( m_rbNgspicePSpiceModelMode, 0, wxALL, 5 ); - - m_rbNgspiceLTSpiceModelMode = new wxRadioButton( sbSizer4->GetStaticBox(), wxID_ANY, _("LTSpice"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbNgspiceLTSpiceModelMode->SetToolTip( _("Enable LTSpice model simulation") ); - - sbSizer4->Add( m_rbNgspiceLTSpiceModelMode, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_rbNgspicePLTSpiceModelMode = new wxRadioButton( sbSizer4->GetStaticBox(), wxID_ANY, _("PSpice and LTSpice"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbNgspicePLTSpiceModelMode->SetToolTip( _("Enable PSpice and LTSpice model simulation") ); - - sbSizer4->Add( m_rbNgspicePLTSpiceModelMode, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_rbNgspiceHSpiceModelMode = new wxRadioButton( sbSizer4->GetStaticBox(), wxID_ANY, _("HSpice"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbNgspiceHSpiceModelMode->SetToolTip( _("Enable HSpice model simulation") ); - - sbSizer4->Add( m_rbNgspiceHSpiceModelMode, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bSizer21->Add( sbSizer4, 0, wxALL, 5 ); - - - m_pgNgspice->SetSizer( bSizer21 ); - m_pgNgspice->Layout(); - bSizer21->Fit( m_pgNgspice ); - m_simPages->AddPage( m_pgNgspice, _("Ngspice"), true ); bSizer1->Add( m_simPages, 1, wxEXPAND | wxALL, 5 ); @@ -467,14 +422,33 @@ DIALOG_SIM_SETTINGS_BASE::DIALOG_SIM_SETTINGS_BASE( wxWindow* parent, wxWindowID 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 ); + bSizer88->Add( m_fixPassiveVals, 0, wxBOTTOM|wxRIGHT|wxLEFT, 10 ); m_fixIncludePaths = new wxCheckBox( this, wxID_ANY, _("Add full path for .include library directives"), wxDefaultPosition, wxDefaultSize, 0 ); m_fixIncludePaths->SetValue(true); - bSizer88->Add( m_fixIncludePaths, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer88->Add( m_fixIncludePaths, 0, wxBOTTOM|wxRIGHT|wxLEFT, 10 ); + + m_compatibilityMode = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticText* compatibilityLabel; + compatibilityLabel = new wxStaticText( this, wxID_ANY, _("Compatibility mode:"), wxDefaultPosition, wxDefaultSize, 0 ); + compatibilityLabel->Wrap( -1 ); + m_compatibilityMode->Add( compatibilityLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 ); + + wxString m_compatibilityModeChoiceChoices[] = { _("User configuration"), _("Spice"), _("PSpice"), _("LTSpice"), _("PSpice and LTSpice"), _("HSpice") }; + int m_compatibilityModeChoiceNChoices = sizeof( m_compatibilityModeChoiceChoices ) / sizeof( wxString ); + m_compatibilityModeChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_compatibilityModeChoiceNChoices, m_compatibilityModeChoiceChoices, 0 ); + m_compatibilityModeChoice->SetSelection( 0 ); + m_compatibilityMode->Add( m_compatibilityModeChoice, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer1->Add( bSizer88, 0, wxEXPAND|wxALL, 5 ); + bSizer88->Add( m_compatibilityMode, 1, wxEXPAND|wxBOTTOM, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer88->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + bSizer1->Add( bSizer88, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); diff --git a/eeschema/dialogs/dialog_sim_settings_base.fbp b/eeschema/dialogs/dialog_sim_settings_base.fbp index b67f6c3c23..05ae2ada2f 100644 --- a/eeschema/dialogs/dialog_sim_settings_base.fbp +++ b/eeschema/dialogs/dialog_sim_settings_base.fbp @@ -14,7 +14,6 @@ dialog_sim_settings_base 1000 none - 1 DIALOG_SIM_SETTINGS_BASE @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -2296,7 +2294,6 @@ - 0 @@ -4723,7 +4720,6 @@ - 0 @@ -4787,472 +4783,11 @@ - - - Ngspice - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_pgNgspice - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - bSizer21 - wxVERTICAL - none - - 5 - wxALL - 0 - - wxID_ANY - Model Mode - - sbSizer4 - wxVERTICAL - 1 - none - - 5 - wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - User configuration - - 0 - - - 0 - - 1 - m_rbNgspiceDefaultModelMode - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - Use the settings in the Ngspice configuration file or any settings defined in the schematic - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Spice - - 0 - - - 0 - - 1 - m_rbNgspiceSpiceModelMode - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Enable default spice model simulation - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - PSpice - - 0 - - - 0 - - 1 - m_rbNgspicePSpiceModelMode - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Enable PSpice model simulation - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - LTSpice - - 0 - - - 0 - - 1 - m_rbNgspiceLTSpiceModelMode - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Enable LTSpice model simulation - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - PSpice and LTSpice - - 0 - - - 0 - - 1 - m_rbNgspicePLTSpiceModelMode - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Enable PSpice and LTSpice model simulation - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - HSpice - - 0 - - - 0 - - 1 - m_rbNgspiceHSpiceModelMode - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Enable HSpice model simulation - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - - 5 - wxEXPAND|wxALL + wxEXPAND|wxRIGHT|wxLEFT 0 @@ -5260,8 +4795,8 @@ wxVERTICAL none - 5 - wxALL + 10 + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -5324,7 +4859,7 @@ - 5 + 10 wxBOTTOM|wxRIGHT|wxLEFT 0 @@ -5387,6 +4922,200 @@ + + 5 + wxEXPAND|wxBOTTOM + 1 + + + m_compatibilityMode + wxHORIZONTAL + protected + + 8 + wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Compatibility mode: + 0 + + 0 + + + 0 + + 1 + compatibilityLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "User configuration" "Spice" "PSpice" "LTSpice" "PSpice and LTSpice" "HSpice" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_compatibilityModeChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + diff --git a/eeschema/dialogs/dialog_sim_settings_base.h b/eeschema/dialogs/dialog_sim_settings_base.h index 9c2b941e16..39949a2587 100644 --- a/eeschema/dialogs/dialog_sim_settings_base.h +++ b/eeschema/dialogs/dialog_sim_settings_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 18 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -30,9 +30,8 @@ #include #include #include -#include -#include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -116,15 +115,11 @@ class DIALOG_SIM_SETTINGS_BASE : public DIALOG_SHIM wxStaticText* m_staticText18; wxTextCtrl* m_customTxt; wxButton* m_loadDirectives; - wxPanel* m_pgNgspice; - wxRadioButton* m_rbNgspiceDefaultModelMode; - wxRadioButton* m_rbNgspiceSpiceModelMode; - wxRadioButton* m_rbNgspicePSpiceModelMode; - wxRadioButton* m_rbNgspiceLTSpiceModelMode; - wxRadioButton* m_rbNgspicePLTSpiceModelMode; - wxRadioButton* m_rbNgspiceHSpiceModelMode; wxCheckBox* m_fixPassiveVals; wxCheckBox* m_fixIncludePaths; + wxBoxSizer* m_compatibilityMode; + wxChoice* m_compatibilityModeChoice; + wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel;