Spice netlist exporter: handle .control .. .endc blocks
Spice may include a list of directives that are wrapped with
.control and .endc. Such directives do not have a dot prefix, so
they need to be handled in a special way.
Fixes: lp:1787902
* https://bugs.launchpad.net/kicad/+bug/1787902
(cherry-picked from commit 36f2eb11
)
This commit is contained in:
parent
280573e9af
commit
27b88be61f
|
@ -379,6 +379,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
|||
const SCH_SHEET_LIST& sheetList = g_RootSheet;
|
||||
|
||||
m_directives.clear();
|
||||
bool controlBlock = false;
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
|
@ -419,10 +420,26 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
|||
{
|
||||
m_title = line.AfterFirst( ' ' );
|
||||
}
|
||||
|
||||
else if( line.IsSameAs( ".control" ) && ( !controlBlock ) )
|
||||
{
|
||||
controlBlock = true;
|
||||
}
|
||||
else if( line.IsSameAs( ".endc" ) && controlBlock )
|
||||
{
|
||||
controlBlock = false;
|
||||
m_directives.push_back( line );
|
||||
}
|
||||
|
||||
else if( line.StartsWith( '.' ) )
|
||||
{
|
||||
m_directives.push_back( line );
|
||||
}
|
||||
|
||||
if( controlBlock )
|
||||
{
|
||||
m_directives.push_back( line );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue