2021-03-19 13:04:28 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 CERN
|
|
|
|
*
|
|
|
|
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
|
|
|
*
|
|
|
|
* 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 "spice_settings.h"
|
|
|
|
#include <settings/parameters.h>
|
|
|
|
|
|
|
|
|
|
|
|
const int spiceSettingsSchemaVersion = 0;
|
|
|
|
|
|
|
|
|
|
|
|
SPICE_SIMULATOR_SETTINGS::SPICE_SIMULATOR_SETTINGS( JSON_SETTINGS* aParent,
|
|
|
|
const std::string& aPath ) :
|
2021-07-08 12:33:08 +00:00
|
|
|
NESTED_SETTINGS( "simulator", spiceSettingsSchemaVersion, aParent, aPath ),
|
|
|
|
m_fixPassiveVals( false ),
|
|
|
|
m_fixIncludePaths( true )
|
2021-03-19 13:04:28 +00:00
|
|
|
{
|
2021-05-09 23:32:49 +00:00
|
|
|
m_params.emplace_back( new PARAM<wxString>( "workbook_filename", &m_workbookFilename, "" ) );
|
2021-07-05 22:17:11 +00:00
|
|
|
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 ) );
|
2021-05-04 22:35:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool SPICE_SIMULATOR_SETTINGS::operator==( const SPICE_SIMULATOR_SETTINGS &aRhs ) const
|
|
|
|
{
|
2021-07-05 22:17:11 +00:00
|
|
|
return m_workbookFilename == aRhs.m_workbookFilename
|
|
|
|
&& m_fixPassiveVals == aRhs.m_fixPassiveVals
|
|
|
|
&& m_fixIncludePaths == aRhs.m_fixIncludePaths;
|
2021-03-19 13:04:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NGSPICE_SIMULATOR_SETTINGS::NGSPICE_SIMULATOR_SETTINGS(
|
|
|
|
JSON_SETTINGS* aParent, const std::string& aPath ) :
|
|
|
|
SPICE_SIMULATOR_SETTINGS( aParent, aPath ),
|
|
|
|
m_modelMode( NGSPICE_MODEL_MODE::USER_CONFIG )
|
|
|
|
{
|
|
|
|
m_params.emplace_back( new PARAM_ENUM<NGSPICE_MODEL_MODE>( "model_mode", &m_modelMode,
|
|
|
|
NGSPICE_MODEL_MODE::USER_CONFIG,
|
|
|
|
NGSPICE_MODEL_MODE::USER_CONFIG,
|
|
|
|
NGSPICE_MODEL_MODE::HSPICE ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool NGSPICE_SIMULATOR_SETTINGS::operator==( const SPICE_SIMULATOR_SETTINGS& aRhs ) const
|
|
|
|
{
|
|
|
|
const NGSPICE_SIMULATOR_SETTINGS* settings =
|
|
|
|
dynamic_cast<const NGSPICE_SIMULATOR_SETTINGS*>( &aRhs );
|
|
|
|
|
|
|
|
wxCHECK( settings, false );
|
|
|
|
|
2021-05-04 22:35:04 +00:00
|
|
|
return ( *static_cast<const SPICE_SIMULATOR_SETTINGS*>( this ) ) == aRhs
|
|
|
|
&& m_modelMode == settings->m_modelMode;
|
2021-03-19 13:04:28 +00:00
|
|
|
}
|