Browse Source

Fix ngspice netlisting when net names contain '/'

Fixes: lp:1821502
* https://bugs.launchpad.net/kicad/+bug/1821502
pull/14/head
Jon Evans 7 years ago
parent
commit
216573bf48
  1. 9
      eeschema/netlist_exporters/netlist_exporter_pspice.cpp

9
eeschema/netlist_exporters/netlist_exporter_pspice.cpp

@ -150,6 +150,15 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* aFormatter, unsigned aCtl
// Replace parenthesis with underscore to prevent parse issues with simulators // Replace parenthesis with underscore to prevent parse issues with simulators
ReplaceForbiddenChars( netName ); ReplaceForbiddenChars( netName );
// Add quotes to nets containing slashes. This isn't added to ReplaceForbidenChars
// because this is only necessary for file writing; nets with slashes can be
// handled by ngspice after loading.
if( netName.Contains( "/" ) )
{
netName.Prepend( '"' );
netName.Append( '"' );
}
// Borrow LTSpice's nomenclature for unconnected nets // Borrow LTSpice's nomenclature for unconnected nets
if( netName.IsEmpty() ) if( netName.IsEmpty() )
netName = wxString::Format( wxT( "NC_%.2u" ), NC_counter++ ); netName = wxString::Format( wxT( "NC_%.2u" ), NC_counter++ );

Loading…
Cancel
Save