diff --git a/eeschema/sim/toolbars_simulator_frame.cpp b/eeschema/sim/toolbars_simulator_frame.cpp index 187120d3b0..cd1efc615b 100644 --- a/eeschema/sim/toolbars_simulator_frame.cpp +++ b/eeschema/sim/toolbars_simulator_frame.cpp @@ -127,6 +127,7 @@ void SIMULATOR_FRAME::doReCreateMenuBar() // ACTION_MENU* simulationMenu = new ACTION_MENU( false, tool ); + simulationMenu->Add( EE_ACTIONS::newPlot ); simulationMenu->Add( EE_ACTIONS::simCommand ); simulationMenu->Add( EE_ACTIONS::runSimulation ); diff --git a/eeschema/tools/ee_actions.cpp b/eeschema/tools/ee_actions.cpp index a10e34e65d..fb99b6979c 100644 --- a/eeschema/tools/ee_actions.cpp +++ b/eeschema/tools/ee_actions.cpp @@ -1168,7 +1168,7 @@ TOOL_ACTION EE_ACTIONS::toggleDarkModePlots( "eeschema.Simulator.toggleDarkModeP TOOL_ACTION EE_ACTIONS::simCommand( "eeschema.Simulation.simCommand", AS_GLOBAL, 0, "", - _( "Simulation Command..." ), + _( "Edit Simulation Command..." ), _( "Edit the simulation command for the current plot tab" ), BITMAPS::sim_command ); diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index 91058b0ac6..4516a2e104 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -154,7 +154,7 @@ int SIMULATOR_CONTROL::SaveWorkbook( const TOOL_EVENT& aEvent ) int SIMULATOR_CONTROL::ExportPlotAsPNG( const TOOL_EVENT& aEvent ) { - if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() ) + if( SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ) ) { wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "", PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); @@ -169,15 +169,15 @@ int SIMULATOR_CONTROL::ExportPlotAsPNG( const TOOL_EVENT& aEvent ) } -SIM_PLOT_PANEL* SIMULATOR_CONTROL::GetCurrentPlotPanel() +SIM_PLOT_PANEL_BASE* SIMULATOR_CONTROL::GetCurrentPlotPanel() { - return dynamic_cast( m_simulatorFrame->GetCurrentPlotPanel() ); + return m_simulatorFrame->GetCurrentPlotPanel(); } int SIMULATOR_CONTROL::ExportPlotAsCSV( const TOOL_EVENT& aEvent ) { - if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() ) + if( SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ) ) { const wxChar SEPARATOR = ';'; @@ -238,7 +238,7 @@ int SIMULATOR_CONTROL::Close( const TOOL_EVENT& aEvent ) int SIMULATOR_CONTROL::Zoom( const TOOL_EVENT& aEvent ) { - if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() ) + if( SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ) ) { if( aEvent.IsAction( &ACTIONS::zoomInCenter ) ) plotPanel->GetPlotWin()->ZoomIn(); else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) ) plotPanel->GetPlotWin()->ZoomOut(); @@ -251,7 +251,7 @@ int SIMULATOR_CONTROL::Zoom( const TOOL_EVENT& aEvent ) int SIMULATOR_CONTROL::ToggleGrid( const TOOL_EVENT& aEvent ) { - if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() ) + if( SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ) ) { plotPanel->ShowGrid( !plotPanel->IsGridShown() ); m_simulatorFrame->OnModify(); @@ -263,7 +263,7 @@ int SIMULATOR_CONTROL::ToggleGrid( const TOOL_EVENT& aEvent ) int SIMULATOR_CONTROL::ToggleLegend( const TOOL_EVENT& aEvent ) { - if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() ) + if( SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ) ) { plotPanel->ShowLegend( !plotPanel->IsLegendShown() ); m_simulatorFrame->OnModify(); @@ -275,7 +275,7 @@ int SIMULATOR_CONTROL::ToggleLegend( const TOOL_EVENT& aEvent ) int SIMULATOR_CONTROL::ToggleDottedSecondary( const TOOL_EVENT& aEvent ) { - if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() ) + if( SIM_PLOT_PANEL* plotPanel = dynamic_cast( GetCurrentPlotPanel() ) ) { plotPanel->SetDottedSecondary( !plotPanel->GetDottedSecondary() ); m_simulatorFrame->OnModify(); diff --git a/eeschema/tools/simulator_control.h b/eeschema/tools/simulator_control.h index 5de83e3feb..533c730784 100644 --- a/eeschema/tools/simulator_control.h +++ b/eeschema/tools/simulator_control.h @@ -30,7 +30,7 @@ class SIMULATOR_FRAME; class NGSPICE_CIRCUIT_MODEL; class SPICE_SIMULATOR; -class SIM_PLOT_PANEL; +class SIM_PLOT_PANEL_BASE; /** @@ -85,7 +85,7 @@ private: */ wxString getDefaultPath(); - SIM_PLOT_PANEL* GetCurrentPlotPanel(); + SIM_PLOT_PANEL_BASE* GetCurrentPlotPanel(); ///< Set up handlers for various events. void setTransitions() override;