From 26ee676278d2e3cd97e2e4711e2660f7b6c84f60 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 7 Oct 2016 16:48:07 +0200 Subject: [PATCH] Handle Spice_Netlist_Enabled attribute in Spice netlist exporter Fixes: lp:1630502 * https://bugs.launchpad.net/kicad/+bug/1630502 --- eeschema/netlist_exporters/netlist_exporter_pspice.cpp | 3 +++ eeschema/sim/netlist_exporter_pspice_sim.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp index 0a731c9f6f..6a4511acb4 100644 --- a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp @@ -89,6 +89,9 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* aFormatter, unsigned aCtl for( const auto& item : m_spiceItems ) { + if( !item.m_enabled ) + continue; + aFormatter->Print( 0, "%c%s ", item.m_primitive, (const char*) item.m_refName.c_str() ); // Pins to node mapping diff --git a/eeschema/sim/netlist_exporter_pspice_sim.cpp b/eeschema/sim/netlist_exporter_pspice_sim.cpp index b36c8f1966..c65e1f5582 100644 --- a/eeschema/sim/netlist_exporter_pspice_sim.cpp +++ b/eeschema/sim/netlist_exporter_pspice_sim.cpp @@ -151,6 +151,9 @@ void NETLIST_EXPORTER_PSPICE_SIM::writeDirectives( OUTPUTFORMATTER* aFormatter, for( const auto& current : NETLIST_EXPORTER_PSPICE_SIM::GetCurrents( (SPICE_PRIMITIVE) item.m_primitive ) ) { + if( !item.m_enabled ) + continue; + /// @todo is it required to switch to lowercase aFormatter->Print( 0, ".save %s\n", (const char*) GetSpiceVector( item.m_refName, SPT_CURRENT, current ).c_str() );