diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp index f7e689ed63..cd1d4a32bb 100644 --- a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp @@ -400,6 +400,12 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl ) { wxString line( tokenizer.GetNextToken() ); + // Convert to lower-case and remove preceding + // and trailing white-space characters + line.MakeLower().Trim( true ).Trim( false ); + + // 'Include' directive stores the library file name, so it + // can be later resolved using a list of paths if( line.StartsWith( ".inc" ) ) { wxString lib = line.AfterFirst( ' ' ); @@ -416,11 +422,15 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl ) m_libraries.insert( lib ); } + + // Store the title to be sure it appears + // in the first line of output else if( line.StartsWith( ".title " ) ) { m_title = line.AfterFirst( ' ' ); } + // Handle .control .. .endc blocks else if( line.IsSameAs( ".control" ) && ( !controlBlock ) ) { controlBlock = true; @@ -431,6 +441,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl ) m_directives.push_back( line ); } + // Usual one-line directives else if( line.StartsWith( '.' ) ) { m_directives.push_back( line );