Reset scales upon simulation relaunch
This commit is contained in:
parent
9d8b40b93d
commit
7d268d2608
|
@ -759,6 +759,7 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
|
|||
updatePlot( trace.second, plotPanel );
|
||||
|
||||
plotPanel->UpdateAll();
|
||||
plotPanel->ResetScales();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -218,6 +218,8 @@ public:
|
|||
|
||||
void EnableCursor( const wxString& aName, bool aEnable );
|
||||
|
||||
void ResetScales();
|
||||
|
||||
private:
|
||||
wxColour generateColor();
|
||||
|
||||
|
|
Loading…
Reference in New Issue