Add a signal on double click

This commit is contained in:
Maciej Suminski 2016-08-11 14:41:16 +02:00
parent 0d764741f9
commit cb463f48b1
2 changed files with 10 additions and 3 deletions

View File

@ -212,14 +212,11 @@ void SIM_PLOT_FRAME::AddVoltagePlot( const wxString& aNetName )
wxString spiceName( wxString::Format( "V(%d)", netMapping.at( aNetName ) ) );
auto data_y = m_simulator->GetPlot( (const char*) spiceName.c_str() );
wxLogDebug( "probe %s", spiceName );
if( data_y.empty() )
return;
auto data_t = m_simulator->GetPlot( "time" );
wxLogDebug( "%lu - %lu data points", data_t.size(), data_y.size() );
SIM_PLOT_PANEL* plotPanel = static_cast<SIM_PLOT_PANEL*>( m_plotNotebook->GetCurrentPage() );
plotPanel->AddTrace( aNetName, data_t.size(), data_t.data(), data_y.data(), 0 );
}
@ -234,6 +231,15 @@ bool SIM_PLOT_FRAME::isSimulationRunning()
}
void SIM_PLOT_FRAME::onSignalDblClick( wxCommandEvent& event )
{
int idx = m_signals->GetSelection();
if( idx != wxNOT_FOUND )
AddVoltagePlot( m_signals->GetString( idx ) );
}
void SIM_PLOT_FRAME::onSimulate( wxCommandEvent& event )
{
if( isSimulationRunning() )

View File

@ -70,6 +70,7 @@ class SIM_PLOT_FRAME : public SIM_PLOT_FRAME_BASE
NewPlot();
}
void onSignalDblClick( wxCommandEvent& event ) override;
void onSimulate( wxCommandEvent& event ) override;
void onPlaceProbe( wxCommandEvent& event ) override;