diff --git a/eeschema/dialogs/dialog_export_netlist.cpp b/eeschema/dialogs/dialog_export_netlist.cpp index 7e19d019e0..7f16533121 100644 --- a/eeschema/dialogs/dialog_export_netlist.cpp +++ b/eeschema/dialogs/dialog_export_netlist.cpp @@ -304,6 +304,9 @@ void DIALOG_EXPORT_NETLIST::OnRunExternSpiceCommand( wxCommandEvent& event ) wxFileName fn = m_Parent->Schematic().GetFileName(); fn.SetExt( SpiceFileExtension ); + if( settings.m_SpiceCurSheetAsRoot ) + netlist_opt |= NETLIST_EXPORTER_SPICE::OPTION_CUR_SHEET_AS_ROOT; + if( settings.m_SpiceSaveAllVoltages ) netlist_opt |= NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES; @@ -473,7 +476,7 @@ void DIALOG_EXPORT_NETLIST::NetlistUpdateOpt() settings.m_SpiceSaveAllVoltages = saveAllVoltages; settings.m_SpiceSaveAllCurrents = saveAllCurrents; settings.m_SpiceCommandString = spiceCmdString; - settings.m_SpiceCurSheetAsRoot = curSheetAsRoot; + settings.m_SpiceCurSheetAsRoot = curSheetAsRoot; settings.m_SpiceModelCurSheetAsRoot = spiceModelCurSheetAsRoot; settings.m_NetFormatName = m_PanelNetType[m_NoteBook->GetSelection()]->GetPageNetFmtName(); } diff --git a/eeschema/netlist_exporters/netlist_exporter_spice.cpp b/eeschema/netlist_exporters/netlist_exporter_spice.cpp index 5b456eb190..a854a7ab08 100644 --- a/eeschema/netlist_exporters/netlist_exporter_spice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_spice.cpp @@ -675,7 +675,7 @@ std::string NETLIST_EXPORTER_SPICE::GenerateItemPinNetName( const std::string& a SCH_SHEET_LIST NETLIST_EXPORTER_SPICE::GetSheets( unsigned aNetlistOptions ) const { if( aNetlistOptions & OPTION_CUR_SHEET_AS_ROOT ) - return SCH_SHEET_LIST( m_schematic->CurrentSheet().at( 0 ) ); + return SCH_SHEET_LIST( m_schematic->CurrentSheet().Last() ); else return m_schematic->GetSheets(); } diff --git a/eeschema/schematic_settings.cpp b/eeschema/schematic_settings.cpp index 16c6403d90..b6b63f20fe 100644 --- a/eeschema/schematic_settings.cpp +++ b/eeschema/schematic_settings.cpp @@ -52,7 +52,6 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin m_IntersheetRefsSuffix( DEFAULT_IREF_SUFFIX ), m_DashedLineDashRatio( 12.0 ), m_DashedLineGapRatio( 3.0 ), - m_SpiceAdjustPassiveValues( false ), m_SpiceCurSheetAsRoot( false ), m_SpiceSaveAllVoltages( false ), m_SpiceSaveAllCurrents( false ), @@ -195,8 +194,8 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin m_params.emplace_back( new PARAM( "net_format_name", &m_NetFormatName, "" ) ); - m_params.emplace_back( new PARAM( "spice_adjust_passive_values", - &m_SpiceAdjustPassiveValues, false ) ); + m_params.emplace_back( new PARAM( "spice_current_sheet_as_root", + &m_SpiceCurSheetAsRoot, false ) ); m_params.emplace_back( new PARAM( "spice_save_all_voltages", &m_SpiceSaveAllVoltages, false ) ); @@ -204,6 +203,9 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin m_params.emplace_back( new PARAM( "spice_save_all_currents", &m_SpiceSaveAllCurrents, false ) ); + m_params.emplace_back( new PARAM( "spice_model_current_sheet_as_root", + &m_SpiceModelCurSheetAsRoot, true ) ); + m_params.emplace_back( new PARAM( "spice_external_command", &m_SpiceCommandString, "spice \"%I\"" ) ); diff --git a/eeschema/schematic_settings.h b/eeschema/schematic_settings.h index 1c3882cff4..ef81ad9248 100644 --- a/eeschema/schematic_settings.h +++ b/eeschema/schematic_settings.h @@ -69,7 +69,6 @@ public: wxString m_NetFormatName; ///< @todo These should probably be moved to the "schematic.simulator" path. - bool m_SpiceAdjustPassiveValues; bool m_SpiceCurSheetAsRoot; bool m_SpiceSaveAllVoltages; bool m_SpiceSaveAllCurrents;