Spice netlist exporter: make directives case insensitive, extra comments

This commit is contained in:
Maciej Suminski 2018-09-10 10:09:23 +02:00
parent 36f2eb1116
commit 4a57541b76
1 changed files with 11 additions and 0 deletions

View File

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