Save simulator checkbox settings in project file

Fixes https://gitlab.com/kicad/code/kicad/issues/8450
This commit is contained in:
Mikolaj Wielgus 2021-07-06 00:17:11 +02:00 committed by Jeff Young
parent 1a23502e98
commit 6dfd655a7f
3 changed files with 26 additions and 5 deletions

View File

@ -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<NGSPICE_SIMULATOR_SETTINGS*>( m_settings.get() );

View File

@ -24,7 +24,6 @@
*/
#include "spice_settings.h"
#include <settings/parameters.h>
@ -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<wxString>( "workbook_filename", &m_workbookFilename, "" ) );
m_params.emplace_back( new PARAM<bool>( "fix_passive_vals", &m_fixPassiveVals, false ) );
m_params.emplace_back( new PARAM<bool>( "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;
}

View File

@ -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;
};
/**