Add a signal on double click
This commit is contained in:
parent
0d764741f9
commit
cb463f48b1
|
@ -212,14 +212,11 @@ void SIM_PLOT_FRAME::AddVoltagePlot( const wxString& aNetName )
|
||||||
wxString spiceName( wxString::Format( "V(%d)", netMapping.at( aNetName ) ) );
|
wxString spiceName( wxString::Format( "V(%d)", netMapping.at( aNetName ) ) );
|
||||||
auto data_y = m_simulator->GetPlot( (const char*) spiceName.c_str() );
|
auto data_y = m_simulator->GetPlot( (const char*) spiceName.c_str() );
|
||||||
|
|
||||||
wxLogDebug( "probe %s", spiceName );
|
|
||||||
|
|
||||||
if( data_y.empty() )
|
if( data_y.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto data_t = m_simulator->GetPlot( "time" );
|
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() );
|
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 );
|
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 )
|
void SIM_PLOT_FRAME::onSimulate( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( isSimulationRunning() )
|
if( isSimulationRunning() )
|
||||||
|
|
|
@ -70,6 +70,7 @@ class SIM_PLOT_FRAME : public SIM_PLOT_FRAME_BASE
|
||||||
NewPlot();
|
NewPlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onSignalDblClick( wxCommandEvent& event ) override;
|
||||||
void onSimulate( wxCommandEvent& event ) override;
|
void onSimulate( wxCommandEvent& event ) override;
|
||||||
void onPlaceProbe( wxCommandEvent& event ) override;
|
void onPlaceProbe( wxCommandEvent& event ) override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue