Finish implementation of export_current_sheet_as_root.

Fixes https://gitlab.com/kicad/code/kicad/issues/13643
This commit is contained in:
Jeff Young 2023-01-23 22:56:06 +00:00
parent 25783f3b7e
commit 4de64b607a
4 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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();
}

View File

@ -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<wxString>( "net_format_name",
&m_NetFormatName, "" ) );
m_params.emplace_back( new PARAM<bool>( "spice_adjust_passive_values",
&m_SpiceAdjustPassiveValues, false ) );
m_params.emplace_back( new PARAM<bool>( "spice_current_sheet_as_root",
&m_SpiceCurSheetAsRoot, false ) );
m_params.emplace_back( new PARAM<bool>( "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<bool>( "spice_save_all_currents",
&m_SpiceSaveAllCurrents, false ) );
m_params.emplace_back( new PARAM<bool>( "spice_model_current_sheet_as_root",
&m_SpiceModelCurSheetAsRoot, true ) );
m_params.emplace_back( new PARAM<wxString>( "spice_external_command",
&m_SpiceCommandString, "spice \"%I\"" ) );

View File

@ -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;