Create signals from .save directives (as well as .probe directives).
(Also fixes a bug where we only looked for a single token after .probe.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/18057
This commit is contained in:
parent
3944d8abc9
commit
856d03dbe2
|
@ -957,18 +957,24 @@ void SIMULATOR_FRAME_UI::rebuildSignalsList()
|
|||
}
|
||||
}
|
||||
|
||||
// Add .PROBE directives
|
||||
// Add .SAVE and .PROBE directives
|
||||
for( const wxString& directive : circuitModel()->GetDirectives() )
|
||||
{
|
||||
wxStringTokenizer tokenizer( directive, wxT( "\r\n" ), wxTOKEN_STRTOK );
|
||||
wxStringTokenizer directivesTokenizer( directive, wxT( "\r\n" ), wxTOKEN_STRTOK );
|
||||
|
||||
while( tokenizer.HasMoreTokens() )
|
||||
while( directivesTokenizer.HasMoreTokens() )
|
||||
{
|
||||
wxString line = tokenizer.GetNextToken();
|
||||
wxString line = directivesTokenizer.GetNextToken().Upper();
|
||||
wxString directiveParams;
|
||||
|
||||
if( line.Upper().StartsWith( wxS( ".PROBE" ), &directiveParams ) )
|
||||
addSignal( directiveParams.Trim( true ).Trim( false ) );
|
||||
if( line.StartsWith( wxS( ".SAVE" ), &directiveParams )
|
||||
|| line.StartsWith( wxS( ".PROBE" ), &directiveParams ) )
|
||||
{
|
||||
wxStringTokenizer paramsTokenizer( directiveParams, wxT( " \t" ), wxTOKEN_STRTOK );
|
||||
|
||||
while( paramsTokenizer.HasMoreTokens() )
|
||||
addSignal( paramsTokenizer.GetNextToken() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue