Reset scales upon simulation relaunch

This commit is contained in:
Maciej Suminski 2016-08-11 14:42:04 +02:00
parent 9d8b40b93d
commit 7d268d2608
3 changed files with 20 additions and 13 deletions

View File

@ -759,6 +759,7 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
updatePlot( trace.second, plotPanel );
plotPanel->UpdateAll();
plotPanel->ResetScales();
}
else
{

View File

@ -452,19 +452,7 @@ bool SIM_PLOT_PANEL::DeleteTrace( const wxString& aName )
DelLayer( cursor, true );
DelLayer( trace, true, true );
// Reset scales
if( m_axis_x )
m_axis_x->ResetDataRange();
if( m_axis_y1 )
m_axis_y1->ResetDataRange();
if( m_axis_y2 )
m_axis_y2->ResetDataRange();
for( auto t : m_traces )
t.second->UpdateScales();
ResetScales();
return true;
}
@ -517,6 +505,22 @@ void SIM_PLOT_PANEL::EnableCursor( const wxString& aName, bool aEnable )
}
void SIM_PLOT_PANEL::ResetScales()
{
if( m_axis_x )
m_axis_x->ResetDataRange();
if( m_axis_y1 )
m_axis_y1->ResetDataRange();
if( m_axis_y2 )
m_axis_y2->ResetDataRange();
for( auto t : m_traces )
t.second->UpdateScales();
}
wxColour SIM_PLOT_PANEL::generateColor()
{
/// @todo have a look at:

View File

@ -218,6 +218,8 @@ public:
void EnableCursor( const wxString& aName, bool aEnable );
void ResetScales();
private:
wxColour generateColor();