sim: display labels on current scale when only currents are added to transient plot
This commit is contained in:
committed by
Maciej Suminski
parent
e452992a6c
commit
1930cd4d66
@@ -455,6 +455,25 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
|
||||
|
||||
if( addedNewEntry )
|
||||
{
|
||||
if ( m_type == ST_TRANSIENT )
|
||||
{
|
||||
bool hasVoltageTraces = false;
|
||||
|
||||
for( auto t : m_traces )
|
||||
{
|
||||
if ( ! (t.second->GetFlags() & SPT_CURRENT ) )
|
||||
{
|
||||
hasVoltageTraces = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !hasVoltageTraces )
|
||||
m_axis_y2->SetMasterScale( nullptr );
|
||||
else
|
||||
m_axis_y2->SetMasterScale( m_axis_y1 );
|
||||
}
|
||||
|
||||
// New entry
|
||||
t = new TRACE( aName );
|
||||
t->SetPen( wxPen( generateColor(), 2, wxSOLID ) );
|
||||
@@ -497,6 +516,8 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
|
||||
else
|
||||
t->SetScale( m_axis_x, m_axis_y1 );
|
||||
|
||||
t->SetFlags( aFlags );
|
||||
|
||||
UpdateAll();
|
||||
|
||||
return addedNewEntry;
|
||||
|
||||
Reference in New Issue
Block a user