Iron out NewPlot vs EditSimCommand.
Also don't confuse SIM_PLOT_PANEL_BASE with SIM_PLOT_PANEL. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15157
This commit is contained in:
parent
db61fe03b3
commit
7608350bdc
|
@ -127,6 +127,7 @@ void SIMULATOR_FRAME::doReCreateMenuBar()
|
||||||
//
|
//
|
||||||
ACTION_MENU* simulationMenu = new ACTION_MENU( false, tool );
|
ACTION_MENU* simulationMenu = new ACTION_MENU( false, tool );
|
||||||
|
|
||||||
|
simulationMenu->Add( EE_ACTIONS::newPlot );
|
||||||
simulationMenu->Add( EE_ACTIONS::simCommand );
|
simulationMenu->Add( EE_ACTIONS::simCommand );
|
||||||
simulationMenu->Add( EE_ACTIONS::runSimulation );
|
simulationMenu->Add( EE_ACTIONS::runSimulation );
|
||||||
|
|
||||||
|
|
|
@ -1168,7 +1168,7 @@ TOOL_ACTION EE_ACTIONS::toggleDarkModePlots( "eeschema.Simulator.toggleDarkModeP
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::simCommand( "eeschema.Simulation.simCommand",
|
TOOL_ACTION EE_ACTIONS::simCommand( "eeschema.Simulation.simCommand",
|
||||||
AS_GLOBAL, 0, "",
|
AS_GLOBAL, 0, "",
|
||||||
_( "Simulation Command..." ),
|
_( "Edit Simulation Command..." ),
|
||||||
_( "Edit the simulation command for the current plot tab" ),
|
_( "Edit the simulation command for the current plot tab" ),
|
||||||
BITMAPS::sim_command );
|
BITMAPS::sim_command );
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ int SIMULATOR_CONTROL::SaveWorkbook( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int SIMULATOR_CONTROL::ExportPlotAsPNG( 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<SIM_PLOT_PANEL*>( GetCurrentPlotPanel() ) )
|
||||||
{
|
{
|
||||||
wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "",
|
wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "",
|
||||||
PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
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<SIM_PLOT_PANEL*>( m_simulatorFrame->GetCurrentPlotPanel() );
|
return m_simulatorFrame->GetCurrentPlotPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SIMULATOR_CONTROL::ExportPlotAsCSV( const TOOL_EVENT& aEvent )
|
int SIMULATOR_CONTROL::ExportPlotAsCSV( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() )
|
if( SIM_PLOT_PANEL* plotPanel = dynamic_cast<SIM_PLOT_PANEL*>( GetCurrentPlotPanel() ) )
|
||||||
{
|
{
|
||||||
const wxChar SEPARATOR = ';';
|
const wxChar SEPARATOR = ';';
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ int SIMULATOR_CONTROL::Close( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int SIMULATOR_CONTROL::Zoom( 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<SIM_PLOT_PANEL*>( GetCurrentPlotPanel() ) )
|
||||||
{
|
{
|
||||||
if( aEvent.IsAction( &ACTIONS::zoomInCenter ) ) plotPanel->GetPlotWin()->ZoomIn();
|
if( aEvent.IsAction( &ACTIONS::zoomInCenter ) ) plotPanel->GetPlotWin()->ZoomIn();
|
||||||
else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) ) plotPanel->GetPlotWin()->ZoomOut();
|
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 )
|
int SIMULATOR_CONTROL::ToggleGrid( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( SIM_PLOT_PANEL* plotPanel = GetCurrentPlotPanel() )
|
if( SIM_PLOT_PANEL* plotPanel = dynamic_cast<SIM_PLOT_PANEL*>( GetCurrentPlotPanel() ) )
|
||||||
{
|
{
|
||||||
plotPanel->ShowGrid( !plotPanel->IsGridShown() );
|
plotPanel->ShowGrid( !plotPanel->IsGridShown() );
|
||||||
m_simulatorFrame->OnModify();
|
m_simulatorFrame->OnModify();
|
||||||
|
@ -263,7 +263,7 @@ int SIMULATOR_CONTROL::ToggleGrid( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int SIMULATOR_CONTROL::ToggleLegend( 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<SIM_PLOT_PANEL*>( GetCurrentPlotPanel() ) )
|
||||||
{
|
{
|
||||||
plotPanel->ShowLegend( !plotPanel->IsLegendShown() );
|
plotPanel->ShowLegend( !plotPanel->IsLegendShown() );
|
||||||
m_simulatorFrame->OnModify();
|
m_simulatorFrame->OnModify();
|
||||||
|
@ -275,7 +275,7 @@ int SIMULATOR_CONTROL::ToggleLegend( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int SIMULATOR_CONTROL::ToggleDottedSecondary( 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<SIM_PLOT_PANEL*>( GetCurrentPlotPanel() ) )
|
||||||
{
|
{
|
||||||
plotPanel->SetDottedSecondary( !plotPanel->GetDottedSecondary() );
|
plotPanel->SetDottedSecondary( !plotPanel->GetDottedSecondary() );
|
||||||
m_simulatorFrame->OnModify();
|
m_simulatorFrame->OnModify();
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
class SIMULATOR_FRAME;
|
class SIMULATOR_FRAME;
|
||||||
class NGSPICE_CIRCUIT_MODEL;
|
class NGSPICE_CIRCUIT_MODEL;
|
||||||
class SPICE_SIMULATOR;
|
class SPICE_SIMULATOR;
|
||||||
class SIM_PLOT_PANEL;
|
class SIM_PLOT_PANEL_BASE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +85,7 @@ private:
|
||||||
*/
|
*/
|
||||||
wxString getDefaultPath();
|
wxString getDefaultPath();
|
||||||
|
|
||||||
SIM_PLOT_PANEL* GetCurrentPlotPanel();
|
SIM_PLOT_PANEL_BASE* GetCurrentPlotPanel();
|
||||||
|
|
||||||
///< Set up handlers for various events.
|
///< Set up handlers for various events.
|
||||||
void setTransitions() override;
|
void setTransitions() override;
|
||||||
|
|
Loading…
Reference in New Issue