From 30c204997770b87435164ae948a0a92ea3110071 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 7 Jul 2023 16:22:29 +0100 Subject: [PATCH] Handle inference of V7 symbol lib DC voltage/current sources. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15127 --- eeschema/sim/sim_model.cpp | 2 +- eeschema/sim/simulator_panel.cpp | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 62e68a1463..a1aceded40 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -1342,7 +1342,7 @@ bool SIM_MODEL::InferSimModel( T_symbol& aSymbol, std::vector* aFields, } if( ( ( *aDeviceType == wxT( "V" ) || *aDeviceType == wxT( "I" ) ) - && aModelType->IsEmpty() ) + && ( aModelType->IsEmpty() || *aModelType == wxT( "DC" ) ) ) || ( aDeviceType->IsEmpty() && aModelType->IsEmpty() diff --git a/eeschema/sim/simulator_panel.cpp b/eeschema/sim/simulator_panel.cpp index caaf73e9cf..639c16511b 100644 --- a/eeschema/sim/simulator_panel.cpp +++ b/eeschema/sim/simulator_panel.cpp @@ -628,15 +628,12 @@ void SIMULATOR_PANEL::rebuildSignalsGrid( wxString aFilter ) m_signalsGrid->ClearRows(); - if( aFilter.IsEmpty() ) - aFilter = wxS( "*" ); + SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ); + + if( !plotPanel ) + return; - EDA_COMBINED_MATCHER matcher( aFilter.Upper(), CTX_SIGNAL ); - SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ); std::vector signals; - int row = 0; - - wxCHECK( plotPanel, /* void */ ); if( plotPanel->GetSimType() == ST_FFT ) { @@ -653,6 +650,12 @@ void SIMULATOR_PANEL::rebuildSignalsGrid( wxString aFilter ) signals.insert( signals.end(), m_signals.begin(), m_signals.end() ); } + if( aFilter.IsEmpty() ) + aFilter = wxS( "*" ); + + EDA_COMBINED_MATCHER matcher( aFilter.Upper(), CTX_SIGNAL ); + int row = 0; + for( const wxString& signal : signals ) { if( matcher.Find( signal.Upper() ) )