eeschema: Export coupling constants to netlist

Patch suggested by Holger Vogt.  Exports text lines following the SPICE
K### <inductor1> <inductor2> format.

Fixes: lp:1815281
* https://bugs.launchpad.net/kicad/+bug/1815281
This commit is contained in:
Seth Hillbrand 2019-02-09 18:54:13 -08:00
parent 8ff764376a
commit 191679676d
1 changed files with 3 additions and 0 deletions

View File

@ -377,6 +377,8 @@ bool NETLIST_EXPORTER_PSPICE::ProcessNetlist( unsigned aCtl )
void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
{
const SCH_SHEET_LIST& sheetList = g_RootSheet;
wxRegEx couplingK( "^[kK][[:digit:]]*[[:space:]]+[[:alnum:]]+[[:space:]]+[[:alnum:]]+",
wxRE_ADVANCED );
m_directives.clear();
bool controlBlock = false;
@ -449,6 +451,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
else if( line.StartsWith( '.' ) // one-line directives
|| controlBlock // .control .. .endc block
|| couplingK.Matches( line ) // K## L## L## coupling constant
|| ( directiveStarted && line.StartsWith( '+' ) ) ) // multiline directives
{
m_directives.push_back( line );