From 1fc3068de67e7bc50ae15e313c8da08af7907891 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 12 Jan 2025 16:13:48 -0800 Subject: [PATCH] Don't ask for data before running If the sim hasn't run, we don't have data and ngspice will complain. It's a harmless message but new users don't know this and it sounds problematic. Fixes https://gitlab.com/kicad/code/kicad/-/issues/19600 --- eeschema/sim/simulator_frame_ui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index 9dcce0c5d4..5264be848f 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -1690,6 +1690,12 @@ void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceTyp SIM_PLOT_TAB* aPlotTab, std::vector* aDataX, bool aClearData ) { + if( !m_simulatorFrame->SimFinished() ) + { + aPlotTab->GetOrAddTrace( aVectorName, aTraceType ); + return; + } + SIM_TYPE simType = SPICE_CIRCUIT_MODEL::CommandToSimType( aPlotTab->GetSimCommand() ); aTraceType &= aTraceType & SPT_Y_AXIS_MASK; @@ -1715,7 +1721,7 @@ void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceTyp aDataX = &data_x; // First, handle the x axis - if( aDataX->empty() && !aClearData ) + if( aDataX->empty() && !aClearData && m_simulatorFrame->SimFinished() ) { wxString xAxisName( simulator()->GetXAxis( simType ) );