eeschema: two fixes for simulation tuners

- fix irrelevant warning message box when tuners moved
  too quickly and simulation was slow
- fix for rerun simulation when tuning and result tab was changed
This commit is contained in:
Sylwester Kocjan 2022-03-29 23:51:09 +02:00 committed by Mikolaj Wielgus
parent f7cdc7af75
commit 05fbe47a1b
2 changed files with 12 additions and 2 deletions

View File

@ -1778,16 +1778,25 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
}
}
m_lastSimPlot = plotPanelWindow;
m_simFinished = true;
}
void SIM_PLOT_FRAME::onSimUpdate( wxCommandEvent& aEvent )
{
static bool updateInProgress = false;
// skip update when events are triggered too often and previous call didn't end yet
if( updateInProgress )
return;
updateInProgress = true;
if( m_simulator->IsRunning() )
m_simulator->Stop();
if( GetCurrentPlot() != m_lastSimPlot )
if( getCurrentPlotWindow() != m_lastSimPlot )
{
// We need to rerun simulation, as the simulator currently stores
// results for another plot
@ -1810,6 +1819,7 @@ void SIM_PLOT_FRAME::onSimUpdate( wxCommandEvent& aEvent )
else
DisplayErrorMessage( this, _( "Another simulation is already running." ) );
}
updateInProgress = false;
}

View File

@ -367,7 +367,7 @@ private:
};
///< Panel that was used as the most recent one for simulations
SIM_PLOT_PANEL* m_lastSimPlot;
SIM_PANEL_BASE* m_lastSimPlot;
///< imagelists used to add a small colored icon to signal names
///< and cursors name, the same color as the corresponding signal traces