Spice netlist exporter: make directives case insensitive, extra comments
(cherry-picked from commit 4a57541b
)
This commit is contained in:
parent
27b88be61f
commit
e9b1552b16
|
@ -400,6 +400,12 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
||||||
{
|
{
|
||||||
wxString line( tokenizer.GetNextToken() );
|
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" ) )
|
if( line.StartsWith( ".inc" ) )
|
||||||
{
|
{
|
||||||
wxString lib = line.AfterFirst( ' ' );
|
wxString lib = line.AfterFirst( ' ' );
|
||||||
|
@ -416,11 +422,15 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
||||||
|
|
||||||
m_libraries.insert( lib );
|
m_libraries.insert( lib );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store the title to be sure it appears
|
||||||
|
// in the first line of output
|
||||||
else if( line.StartsWith( ".title " ) )
|
else if( line.StartsWith( ".title " ) )
|
||||||
{
|
{
|
||||||
m_title = line.AfterFirst( ' ' );
|
m_title = line.AfterFirst( ' ' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle .control .. .endc blocks
|
||||||
else if( line.IsSameAs( ".control" ) && ( !controlBlock ) )
|
else if( line.IsSameAs( ".control" ) && ( !controlBlock ) )
|
||||||
{
|
{
|
||||||
controlBlock = true;
|
controlBlock = true;
|
||||||
|
@ -431,6 +441,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
||||||
m_directives.push_back( line );
|
m_directives.push_back( line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Usual one-line directives
|
||||||
else if( line.StartsWith( '.' ) )
|
else if( line.StartsWith( '.' ) )
|
||||||
{
|
{
|
||||||
m_directives.push_back( line );
|
m_directives.push_back( line );
|
||||||
|
|
Loading…
Reference in New Issue