diff --git a/eeschema/dialogs/dialog_sim_settings.cpp b/eeschema/dialogs/dialog_sim_settings.cpp index f41486ca71..6bd970f401 100644 --- a/eeschema/dialogs/dialog_sim_settings.cpp +++ b/eeschema/dialogs/dialog_sim_settings.cpp @@ -100,7 +100,6 @@ DIALOG_SIM_SETTINGS::DIALOG_SIM_SETTINGS( wxWindow* aParent, m_sdbSizerOK->SetDefault(); updateNetlistOpts(); - } wxString DIALOG_SIM_SETTINGS::evaluateDCControls( wxChoice* aDcSource, wxTextCtrl* aDcStart, @@ -298,12 +297,13 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow() } if( previousSimCommand != m_simCommand ) - { m_simCommand.Trim(); - } updateNetlistOpts(); + m_settings->SetFixPassiveVals( m_netlistOpts & NET_ADJUST_PASSIVE_VALS ); + m_settings->SetFixIncludePaths( m_netlistOpts & NET_ADJUST_INCLUDE_PATHS ); + return true; } @@ -314,6 +314,10 @@ bool DIALOG_SIM_SETTINGS::TransferDataToWindow() if( empty( m_customTxt ) ) loadDirectives(); + m_fixPassiveVals->SetValue( m_settings->GetFixPassiveVals() ); + m_fixIncludePaths->SetValue( m_settings->GetFixIncludePaths() ); + updateNetlistOpts(); + NGSPICE_SIMULATOR_SETTINGS* ngspiceSettings = dynamic_cast( m_settings.get() ); diff --git a/eeschema/sim/spice_settings.cpp b/eeschema/sim/spice_settings.cpp index 5f31bc6746..16fc7021b0 100644 --- a/eeschema/sim/spice_settings.cpp +++ b/eeschema/sim/spice_settings.cpp @@ -24,7 +24,6 @@ */ #include "spice_settings.h" - #include @@ -36,12 +35,16 @@ SPICE_SIMULATOR_SETTINGS::SPICE_SIMULATOR_SETTINGS( JSON_SETTINGS* aParent, NESTED_SETTINGS( "simulator", spiceSettingsSchemaVersion, aParent, aPath ) { m_params.emplace_back( new PARAM( "workbook_filename", &m_workbookFilename, "" ) ); + m_params.emplace_back( new PARAM( "fix_passive_vals", &m_fixPassiveVals, false ) ); + m_params.emplace_back( new PARAM( "fix_include_paths", &m_fixIncludePaths, true ) ); } bool SPICE_SIMULATOR_SETTINGS::operator==( const SPICE_SIMULATOR_SETTINGS &aRhs ) const { - return m_workbookFilename == aRhs.m_workbookFilename; + return m_workbookFilename == aRhs.m_workbookFilename + && m_fixPassiveVals == aRhs.m_fixPassiveVals + && m_fixIncludePaths == aRhs.m_fixIncludePaths; } diff --git a/eeschema/sim/spice_settings.h b/eeschema/sim/spice_settings.h index 2b16f0e41a..c7e46e9697 100644 --- a/eeschema/sim/spice_settings.h +++ b/eeschema/sim/spice_settings.h @@ -46,8 +46,22 @@ public: wxString GetWorkbookFilename() const { return m_workbookFilename; } void SetWorkbookFilename( wxString aFilename ) { m_workbookFilename = aFilename; } + bool GetFixPassiveVals() const { return m_fixPassiveVals; } + void SetFixPassiveVals( bool aFixPassiveVals ) + { + m_fixPassiveVals = aFixPassiveVals; + } + + bool GetFixIncludePaths() const { return m_fixIncludePaths; } + void SetFixIncludePaths( bool aFixIncludePaths ) + { + m_fixIncludePaths = aFixIncludePaths; + } + private: wxString m_workbookFilename; + bool m_fixPassiveVals; + bool m_fixIncludePaths; }; /**