From 1c746f0134f1f635145ac88802a5e09473401fd8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 4 Nov 2023 15:19:05 +0000 Subject: [PATCH] Correctly parse fft commands with linearize in them. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16011 --- eeschema/sim/simulator_frame.cpp | 3 ++- eeschema/sim/spice_circuit_model.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/sim/simulator_frame.cpp b/eeschema/sim/simulator_frame.cpp index f0c7a6b76d..9aea5f4cd5 100644 --- a/eeschema/sim/simulator_frame.cpp +++ b/eeschema/sim/simulator_frame.cpp @@ -365,7 +365,8 @@ void SIMULATOR_FRAME::StartSimulation() if( !simTab ) return; - if( simTab->GetSimCommand().Upper().StartsWith( wxT( "FFT" ) ) ) + if( simTab->GetSimCommand().Upper().StartsWith( wxT( "FFT" ) ) + || simTab->GetSimCommand().Upper().Contains( wxT( "\nFFT" ) ) ) { wxString tranSpicePlot; diff --git a/eeschema/sim/spice_circuit_model.cpp b/eeschema/sim/spice_circuit_model.cpp index ce288eb130..bbd5497dc6 100644 --- a/eeschema/sim/spice_circuit_model.cpp +++ b/eeschema/sim/spice_circuit_model.cpp @@ -109,8 +109,11 @@ SIM_TYPE SPICE_CIRCUIT_MODEL::CommandToSimType( const wxString& aCmd ) else if( cmd.StartsWith( wxT( ".sens" ) ) ) return ST_SENS; else if( cmd.StartsWith( wxT( ".sp" ) ) ) return ST_SP; else if( cmd.StartsWith( wxT( ".tf" ) ) ) return ST_TF; - else if( cmd.StartsWith( wxT( "fft" ) ) ) return ST_FFT; - else return ST_UNKNOWN; + + else if( cmd.StartsWith( wxT( "fft" ) ) || cmd.Contains( wxT( "\nfft" ) ) ) + return ST_FFT; + else + return ST_UNKNOWN; }