Fixed-y-scale bug fixes.

Default dialog to SPICE command.
Any of the three axis locks must lock the plotWindow Y axis (otherwise
locking Y2 but not Y1 doesn't preclude zooming).
This commit is contained in:
Jeff Young 2023-07-20 17:41:23 +01:00
parent 06f19aa761
commit e4b262d6e1
5 changed files with 12 additions and 14 deletions

View File

@ -534,6 +534,10 @@ void DIALOG_SIM_COMMAND::ApplySettings( SIM_TAB* aTab )
SIM_VALUE::ToDouble( m_y3Max->GetValue().ToStdString() ) ); SIM_VALUE::ToDouble( m_y3Max->GetValue().ToStdString() ) );
} }
plotTab->GetPlotWin()->LockY( m_lockY1->GetValue()
|| m_lockY2->GetValue()
|| m_lockY3->GetValue() );
plotTab->ShowGrid( m_grid->GetValue() ); plotTab->ShowGrid( m_grid->GetValue() );
plotTab->ShowLegend( m_legend->GetValue() ); plotTab->ShowLegend( m_legend->GetValue() );
plotTab->SetDottedSecondary( m_dottedSecondary->GetValue() ); plotTab->SetDottedSecondary( m_dottedSecondary->GetValue() );
@ -543,6 +547,7 @@ void DIALOG_SIM_COMMAND::ApplySettings( SIM_TAB* aTab )
plotTab->GetPlotWin()->SetMarginTop( TO_INT( m_marginTop ) ); plotTab->GetPlotWin()->SetMarginTop( TO_INT( m_marginTop ) );
plotTab->GetPlotWin()->SetMarginBottom( TO_INT( m_marginBottom ) ); plotTab->GetPlotWin()->SetMarginBottom( TO_INT( m_marginBottom ) );
plotTab->GetPlotWin()->AdjustLimitedView();
plotTab->GetPlotWin()->UpdateAll(); plotTab->GetPlotWin()->UpdateAll();
} }
} }

View File

@ -669,7 +669,7 @@ DIALOG_SIM_COMMAND_BASE::DIALOG_SIM_COMMAND_BASE( wxWindow* parent, wxWindowID i
m_panelCommand->SetSizer( bCommandSizer ); m_panelCommand->SetSizer( bCommandSizer );
m_panelCommand->Layout(); m_panelCommand->Layout();
bCommandSizer->Fit( m_panelCommand ); bCommandSizer->Fit( m_panelCommand );
m_notebook1->AddPage( m_panelCommand, _("SPICE Command"), false ); m_notebook1->AddPage( m_panelCommand, _("SPICE Command"), true );
m_panelPlotSetup = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelPlotSetup = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bPlotSetupSizer; wxBoxSizer* bPlotSetupSizer;
bPlotSetupSizer = new wxBoxSizer( wxVERTICAL ); bPlotSetupSizer = new wxBoxSizer( wxVERTICAL );
@ -879,7 +879,7 @@ DIALOG_SIM_COMMAND_BASE::DIALOG_SIM_COMMAND_BASE( wxWindow* parent, wxWindowID i
m_panelPlotSetup->SetSizer( bPlotSetupSizer ); m_panelPlotSetup->SetSizer( bPlotSetupSizer );
m_panelPlotSetup->Layout(); m_panelPlotSetup->Layout();
bPlotSetupSizer->Fit( m_panelPlotSetup ); bPlotSetupSizer->Fit( m_panelPlotSetup );
m_notebook1->AddPage( m_panelPlotSetup, _("Plot Setup"), true ); m_notebook1->AddPage( m_panelPlotSetup, _("Plot Setup"), false );
bSizer1->Add( m_notebook1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); bSizer1->Add( m_notebook1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );

View File

@ -269,7 +269,7 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">SPICE Command</property> <property name="label">SPICE Command</property>
<property name="select">0</property> <property name="select">1</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
@ -7611,7 +7611,7 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Plot Setup</property> <property name="label">Plot Setup</property>
<property name="select">1</property> <property name="select">0</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>

View File

@ -441,16 +441,6 @@ SIM_PLOT_TAB::~SIM_PLOT_TAB()
void SIM_PLOT_TAB::SetY1Scale( bool aLock, double aMin, double aMax ) void SIM_PLOT_TAB::SetY1Scale( bool aLock, double aMin, double aMax )
{ {
m_axis_y1->SetAxisMinMax( aLock, aMin, aMax ); m_axis_y1->SetAxisMinMax( aLock, aMin, aMax );
if( aLock )
{
m_plotWin->LockY( true );
m_plotWin->AdjustLimitedView();
}
else
{
m_plotWin->LockY( false );
}
} }

View File

@ -1869,18 +1869,21 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath )
{ {
const nlohmann::json& scale_js = tab_js[ "fixedY1scale" ]; const nlohmann::json& scale_js = tab_js[ "fixedY1scale" ];
plotTab->SetY1Scale( true, scale_js[ "min" ], scale_js[ "max" ] ); plotTab->SetY1Scale( true, scale_js[ "min" ], scale_js[ "max" ] );
plotTab->GetPlotWin()->LockY( true );
} }
if( tab_js.contains( "fixedY2scale" ) ) if( tab_js.contains( "fixedY2scale" ) )
{ {
const nlohmann::json& scale_js = tab_js[ "fixedY2scale" ]; const nlohmann::json& scale_js = tab_js[ "fixedY2scale" ];
plotTab->SetY2Scale( true, scale_js[ "min" ], scale_js[ "max" ] ); plotTab->SetY2Scale( true, scale_js[ "min" ], scale_js[ "max" ] );
plotTab->GetPlotWin()->LockY( true );
} }
if( tab_js.contains( "fixedY3scale" ) ) if( tab_js.contains( "fixedY3scale" ) )
{ {
const nlohmann::json& scale_js = tab_js[ "fixedY3scale" ]; const nlohmann::json& scale_js = tab_js[ "fixedY3scale" ];
plotTab->SetY3Scale( true, scale_js[ "min" ], scale_js[ "max" ] ); plotTab->SetY3Scale( true, scale_js[ "min" ], scale_js[ "max" ] );
plotTab->GetPlotWin()->LockY( true );
} }
if( tab_js.contains( "legend" ) ) if( tab_js.contains( "legend" ) )