Ngspice: Preload a basically empty circuit to avoid error messages
Fixes https://gitlab.com/kicad/code/kicad/issues/12481
(cherry picked from commit 6e874f4c1e
)
This commit is contained in:
parent
b004d7a1cb
commit
ceaf3fc72d
|
@ -559,6 +559,19 @@ void NGSPICE::init_dll()
|
||||||
Command( "set noaskquit" );
|
Command( "set noaskquit" );
|
||||||
Command( "set nomoremode" );
|
Command( "set nomoremode" );
|
||||||
|
|
||||||
|
// reset and remcirc give an error if no circuit is loaded, so load an empty circuit at the
|
||||||
|
// start.
|
||||||
|
|
||||||
|
vector<char*> lines;
|
||||||
|
lines.push_back( strdup( "*" ) );
|
||||||
|
lines.push_back( strdup( ".end" ) );
|
||||||
|
lines.push_back( nullptr ); // Sentinel.
|
||||||
|
|
||||||
|
m_ngSpice_Circ( lines.data() );
|
||||||
|
|
||||||
|
for( auto line : lines )
|
||||||
|
free( line );
|
||||||
|
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue