Compare commits

...

10 Commits

Author SHA1 Message Date
aris-kimi
94cb4e6a80
Merge branch 'Simulation_AbstractPlotWindowFromPlotTab' into 'master'
Simulation: Added simple multiplot support

See merge request kicad/code/kicad!2267
2025-09-05 16:00:15 +03:00
aris-kimi
8f01a6f94a Some code comments and fix an assert when creating a new sim tab on sim command 2025-08-18 14:09:00 +03:00
aris-kimi
675998ce19 ADDED: context menu for m_signalsGrid to show to a plot diagrams 2025-08-18 14:09:00 +03:00
aris-kimi
6053d2ed67 Fix first cleanup 2025-08-18 14:09:00 +03:00
aris-kimi
fda2ea7d6a ADDED: Dynamic clone plot diagrams.
Need a bit further cleanup. Nothing gets saved to the workbook.

TODO update settings for descriptions and nicknames.

Signals need a way to map to a plot, and also CURSORS
will probably have to move into SIM_PLOT_DIAGRAM.

TODO Rebase-reword-squash
2025-08-18 14:09:00 +03:00
aris-kimi
9aeaa181dd Add an indexed m_plotsVector getter to SIM_PLOT_TAB and make use of some variables to tidy up a bit more. 2025-08-18 14:09:00 +03:00
aris-kimi
5007db9b74 Fix a bad side effect shown with many sim tabs and with dynamic cursors applied for each, while closing/switching sim tabs. 2025-08-18 14:09:00 +03:00
aris-kimi
5b84d63a9b Cleanup a bit 2025-08-18 14:09:00 +03:00
aris-kimi
1d7053ea62 Fix a mem leak i caused 2025-08-18 14:09:00 +03:00
aris-kimi
77c7cf7cc4 Simulation: Move SIM_PLOT_TAB::m_plotWin to its own SIM_PLOT_DIAGRAM class,
while in the same file for now it only paves a way to a multiplot simtab
and maybe also to some future (soon to be named as Plotframes) non modal dialogs,
(to be used as a history view for example).
2025-08-18 14:09:00 +03:00
14 changed files with 1784 additions and 718 deletions

View File

@ -1381,6 +1381,14 @@ EVT_MENU( mpID_ZOOM_IN, mpWindow::onZoomIn )
EVT_MENU( mpID_ZOOM_OUT, mpWindow::onZoomOut )
EVT_MENU( mpID_ZOOM_UNDO, mpWindow::onZoomUndo )
EVT_MENU( mpID_ZOOM_REDO, mpWindow::onZoomRedo )
// Queue events for these back at sim_plot_tab
EVT_MENU( mpID_PLOT_PROP, mpWindow::onPlotProperties )
EVT_MENU( mpID_NEW_PLOTDIAGRAM, mpWindow::onNewPlotdiagram )
EVT_MENU( mpID_DELETE_THIS_PLOTDIAGRAM, mpWindow::onDeleteThisPlotdiagram )
EVT_MENU( mpID_DELETE_ALL_PLOTDIAGRAMS, mpWindow::onDeleteAllPlotdiagrams )
END_EVENT_TABLE()
@ -1430,6 +1438,36 @@ mpWindow::~mpWindow()
}
void mpWindow::onPlotProperties( wxCommandEvent& WXUNUSED( event ) )
{
wxCommandEvent* dummy = new wxCommandEvent( EVT_SIM_PLOT_PROPERTIES, GetId() );
dummy->SetEventObject( this );
wxQueueEvent( GetEventHandler(), dummy );
}
void mpWindow::onNewPlotdiagram( wxCommandEvent& WXUNUSED( event ) )
{
wxQueueEvent( GetEventHandler(), new wxCommandEvent( EVT_SIM_NEW_PLOTDIAGRAM ) );
}
void mpWindow::onDeleteThisPlotdiagram( wxCommandEvent& WXUNUSED( event ) )
{
wxCommandEvent* dummy = new wxCommandEvent( EVT_SIM_DELETE_THIS_PLOTDIAGRAM, GetId() );
dummy->SetEventObject( this );
wxQueueEvent( GetEventHandler(), dummy );
}
void mpWindow::onDeleteAllPlotdiagrams( wxCommandEvent& WXUNUSED( event ) )
{
wxQueueEvent( GetEventHandler(), new wxCommandEvent( EVT_SIM_DELETE_ALL_PLOTDIAGRAMS ) );
}
// Mouse handler, for detecting when the user drag with the right button or just "clicks" for
// the menu.
// JLB

View File

@ -59,6 +59,7 @@ static wxString getStringSelection( const wxChoice* aCtrl )
}
// clang-format off
DIALOG_SIM_COMMAND::DIALOG_SIM_COMMAND( SIMULATOR_FRAME* aParent,
std::shared_ptr<SPICE_CIRCUIT_MODEL> aCircuitModel,
std::shared_ptr<SPICE_SETTINGS>& aSettings ) :
@ -66,10 +67,22 @@ DIALOG_SIM_COMMAND::DIALOG_SIM_COMMAND( SIMULATOR_FRAME* aParent,
m_simulatorFrame( aParent ),
m_circuitModel( aCircuitModel ),
m_settings( aSettings ),
m_spiceEmptyValidator( true )
m_spiceEmptyValidator( true ),
m_infoBar( new WX_INFOBAR( this ) )
{
// clang-format on
m_simPages->Hide();
// Hide by default, Show when needed.
m_sizerPlotDiagram->Show( false );
bSizer1->Prepend( m_infoBar );
m_infoBar->RemoveAllButtons();
m_infoBar->Hide();
GetNotebook()->GetPage( 1 )->Disable(); // Hide from here, show when there will be a plotable sim type
m_posIntValidator.SetMin( 1 );
m_acPointsNumber->SetValidator( m_posIntValidator );
@ -170,6 +183,39 @@ bool DIALOG_SIM_COMMAND::TransferDataToWindow()
return true;
}
void DIALOG_SIM_COMMAND::onChoicePlotDiagramChange( wxCommandEvent& event )
{
wxString msg = _( "Changing plot selection, clears previous' properties edits." );
m_infoBar->ShowMessageFor( msg, 3000, wxICON_INFORMATION );
SIMULATOR_FRAME* simFrame = dynamic_cast<SIMULATOR_FRAME*>( m_parent );
if( !simFrame )
return;
SIM_TAB* simTab = dynamic_cast<SIM_TAB*>( simFrame->GetCurrentSimTab() );
if( !simTab )
return;
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( simTab ) )
{
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
if( plotDiagram->GetNickName() == m_choicePlotDiagram->GetString( m_choicePlotDiagram->GetSelection() ) )
{
SetPlotSettingsFor( simTab, plotDiagram );
Layout();
Refresh();
break;
}
}
}
}
void DIALOG_SIM_COMMAND::OnUpdateUILockY1( wxUpdateUIEvent& event )
{
@ -189,18 +235,20 @@ void DIALOG_SIM_COMMAND::OnUpdateUILockY3( wxUpdateUIEvent& event )
}
void DIALOG_SIM_COMMAND::SetPlotSettings( const SIM_TAB* aSimTab )
void DIALOG_SIM_COMMAND::SetPlotSettingsFor( const SIM_TAB* aSimTab, SIM_PLOT_DIAGRAM* plotDiagram )
{
if( const SIM_PLOT_TAB* plotTab = dynamic_cast<const SIM_PLOT_TAB*>( aSimTab ) )
{
if( !plotTab->GetLabelY1().IsEmpty() )
//SIM_PLOT_DIAGRAM* plotDiagram = plotTab->GetPlotDiagram( 0 );
if( !plotDiagram->GetLabelY1().IsEmpty() )
{
m_bSizerY1->Show( true );
m_lockY1->SetLabel( wxString::Format( m_lockY1->GetLabel(), plotTab->GetLabelY1() ) );
m_y1Units->SetLabel( plotTab->GetUnitsY1() );
m_lockY1->SetLabel( wxString::Format( m_lockY1->GetLabel(), plotDiagram->GetLabelY1() ) );
m_y1Units->SetLabel( plotDiagram->GetUnitsY1() );
double min = 0.0, max = 0.0;
bool locked = plotTab->GetY1Scale( &min, &max );
bool locked = plotDiagram->GetY1Scale( &min, &max );
m_lockY1->SetValue( locked );
if( !std::isnan( min ) )
@ -210,14 +258,14 @@ void DIALOG_SIM_COMMAND::SetPlotSettings( const SIM_TAB* aSimTab )
m_y1Max->SetValue( SIM_VALUE::Normalize( max ) );
}
if( !plotTab->GetLabelY2().IsEmpty() )
if( !plotDiagram->GetLabelY2().IsEmpty() )
{
m_bSizerY2->Show( true );
m_lockY2->SetLabel( wxString::Format( m_lockY2->GetLabel(), plotTab->GetLabelY2() ) );
m_y2Units->SetLabel( plotTab->GetUnitsY2() );
m_lockY2->SetLabel( wxString::Format( m_lockY2->GetLabel(), plotDiagram->GetLabelY2() ) );
m_y2Units->SetLabel( plotDiagram->GetUnitsY2() );
double min = 0.0, max = 0.0;
bool locked = plotTab->GetY2Scale( &min, &max );
bool locked = plotDiagram->GetY2Scale( &min, &max );
m_lockY2->SetValue( locked );
if( !std::isnan( min ) )
@ -227,14 +275,14 @@ void DIALOG_SIM_COMMAND::SetPlotSettings( const SIM_TAB* aSimTab )
m_y2Max->SetValue( SIM_VALUE::Normalize( max ) );
}
if( !plotTab->GetLabelY3().IsEmpty() )
if( !plotDiagram->GetLabelY3().IsEmpty() )
{
m_bSizerY3->Show( true );
m_lockY3->SetLabel( wxString::Format( m_lockY3->GetLabel(), plotTab->GetLabelY3() ) );
m_y3Units->SetLabel( plotTab->GetUnitsY3() );
m_lockY3->SetLabel( wxString::Format( m_lockY3->GetLabel(), plotDiagram->GetLabelY3() ) );
m_y3Units->SetLabel( plotDiagram->GetUnitsY3() );
double min = 0.0, max = 0.0;
bool locked = plotTab->GetY3Scale( &min, &max );
bool locked = plotDiagram->GetY3Scale( &min, &max );
m_lockY3->SetValue( locked );
if( !std::isnan( min ) )
@ -244,9 +292,9 @@ void DIALOG_SIM_COMMAND::SetPlotSettings( const SIM_TAB* aSimTab )
m_y3Max->SetValue( SIM_VALUE::Normalize( max ) );
}
m_grid->SetValue( plotTab->IsGridShown() );
m_legend->SetValue( plotTab->IsLegendShown() );
m_dottedSecondary->SetValue( plotTab->GetDottedSecondary() );
m_grid->SetValue( plotDiagram->IsGridShown() );
m_legend->SetValue( plotDiagram->IsLegendShown() );
m_dottedSecondary->SetValue( plotDiagram->GetDottedSecondary() );
#define GET_STR( val ) EDA_UNIT_UTILS::UI::MessageTextFromValue( unityScale, EDA_UNITS::UNSCALED, \
val, false /* no units */ )
@ -262,7 +310,7 @@ void DIALOG_SIM_COMMAND::SetPlotSettings( const SIM_TAB* aSimTab )
wxString DIALOG_SIM_COMMAND::evaluateDCControls( wxChoice* aDcSource, wxTextCtrl* aDcStart,
wxTextCtrl* aDcStop, wxTextCtrl* aDcIncr )
{
wxString dcSource;
wxString dcSource = wxEmptyString;
wxWindow* ctrlWithError = nullptr;
if( aDcSource->GetSelection() >= 0 )
@ -526,23 +574,50 @@ void DIALOG_SIM_COMMAND::ApplySettings( SIM_TAB* aTab )
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( aTab ) )
{
if( !plotTab->GetLabelY1().IsEmpty() )
SIM_PLOT_DIAGRAM* tmpDiagram = nullptr;
if( static_cast<int>( m_choicePlotDiagram->GetStrings().GetCount() ) <= m_choicePlotDiagram->GetSelection()
|| ( static_cast<int>( m_choicePlotDiagram->GetStrings().GetCount() ) > m_choicePlotDiagram->GetSelection()
&& m_choicePlotDiagram->GetSelection() == -1 ) )
{
plotTab->SetY1Scale( m_lockY1->GetValue(),
// to avoid a (non crashing) wxWidgets assert since, choice selection is not set at this point,
// we cannot get a valid string index in the following "for" loop.
// So we can return here only when creating a new sim tab ( based on the "-1" )
return;
}
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
if( plotDiagram->GetNickName() == m_choicePlotDiagram->GetString( m_choicePlotDiagram->GetSelection() ) )
{
tmpDiagram = plotDiagram;
break;
}
}
SIM_PLOT_DIAGRAM* plotDiagram = tmpDiagram;
//for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
if( plotDiagram )
{
// clang-format off
if( !plotDiagram->GetLabelY1().IsEmpty() )
{
plotDiagram->SetY1Scale( m_lockY1->GetValue(),
SIM_VALUE::ToDouble( m_y1Min->GetValue().ToStdString() ),
SIM_VALUE::ToDouble( m_y1Max->GetValue().ToStdString() ) );
}
if( !plotTab->GetLabelY2().IsEmpty() )
if( !plotDiagram->GetLabelY2().IsEmpty() )
{
plotTab->SetY2Scale( m_lockY2->GetValue(),
plotDiagram->SetY2Scale( m_lockY2->GetValue(),
SIM_VALUE::ToDouble( m_y2Min->GetValue().ToStdString() ),
SIM_VALUE::ToDouble( m_y2Max->GetValue().ToStdString() ) );
}
if( !plotTab->GetLabelY3().IsEmpty() )
if( !plotDiagram->GetLabelY3().IsEmpty() )
{
plotTab->SetY3Scale( m_lockY3->GetValue(),
plotDiagram->SetY3Scale( m_lockY3->GetValue(),
SIM_VALUE::ToDouble( m_y3Min->GetValue().ToStdString() ),
SIM_VALUE::ToDouble( m_y3Max->GetValue().ToStdString() ) );
}
@ -550,18 +625,20 @@ void DIALOG_SIM_COMMAND::ApplySettings( SIM_TAB* aTab )
plotTab->GetPlotWin()->LockY( m_lockY1->GetValue()
|| m_lockY2->GetValue()
|| m_lockY3->GetValue() );
// clang-format on
plotTab->ShowGrid( m_grid->GetValue() );
plotTab->ShowLegend( m_legend->GetValue() );
plotTab->SetDottedSecondary( m_dottedSecondary->GetValue() );
plotDiagram->ShowGrid( m_grid->GetValue() );
plotDiagram->ShowLegend( m_legend->GetValue() );
plotDiagram->SetDottedSecondary( m_dottedSecondary->GetValue() );
plotTab->GetPlotWin()->SetMarginLeft( TO_INT( m_marginLeft ) );
plotTab->GetPlotWin()->SetMarginRight( TO_INT( m_marginRight ) );
plotTab->GetPlotWin()->SetMarginTop( TO_INT( m_marginTop ) );
plotTab->GetPlotWin()->SetMarginBottom( TO_INT( m_marginBottom ) );
plotDiagram->GetPrivatePlotWin()->SetMarginLeft( TO_INT( m_marginLeft ) );
plotDiagram->GetPrivatePlotWin()->SetMarginRight( TO_INT( m_marginRight ) );
plotDiagram->GetPrivatePlotWin()->SetMarginTop( TO_INT( m_marginTop ) );
plotDiagram->GetPrivatePlotWin()->SetMarginBottom( TO_INT( m_marginBottom ) );
plotTab->GetPlotWin()->AdjustLimitedView();
plotTab->GetPlotWin()->UpdateAll();
plotDiagram->GetPrivatePlotWin()->AdjustLimitedView();
plotDiagram->GetPrivatePlotWin()->UpdateAll();
}
}
}
@ -1017,5 +1094,3 @@ void DIALOG_SIM_COMMAND::OnFilterMouseMoved( wxMouseEvent& aEvent )
SetCursor( wxCURSOR_IBEAM );
#endif
}

View File

@ -37,7 +37,9 @@ class SPICE_CIRCUIT_MODEL;
class SPICE_SETTINGS;
class SIMULATOR_FRAME;
class SIM_TAB;
class SIM_PLOT_DIAGRAM;
// clang-format off
class DIALOG_SIM_COMMAND : public DIALOG_SIM_COMMAND_BASE
{
@ -46,6 +48,8 @@ public:
std::shared_ptr<SPICE_CIRCUIT_MODEL> aCircuitModel,
std::shared_ptr<SPICE_SETTINGS>& aSettings );
// clang-format on
const wxString& GetSimCommand() const
{
return m_simCommand;
@ -69,7 +73,7 @@ public:
m_saveAllEvents->SetValue( aOptions & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_EVENTS );
}
void SetPlotSettings( const SIM_TAB* aSimTab );
void SetPlotSettingsFor( const SIM_TAB* aSimTab, SIM_PLOT_DIAGRAM* aPlotDiagram );
bool TransferDataFromWindow() override;
bool TransferDataToWindow() override;
@ -85,6 +89,30 @@ public:
void ApplySettings( SIM_TAB* aTab );
const wxNotebook* GetNotebook() { return m_notebook1; }
void SetPlotConfigTab( int anIndex ) { m_notebook1->SetSelection( anIndex ); }
void ShowPage( int anIndex )
{
m_notebook1->GetPage( anIndex )->Enable();
m_notebook1->GetPage( anIndex )->Show();
}
void HidePage( int anIndex )
{
m_notebook1->GetPage( anIndex )->Enable( false );
//m_notebook1->GetPage( anIndex )->Show();
}
const wxChoice* GetPlotDiagramChoice() { return m_choicePlotDiagram; }
void ClearPlotDiagramChoice() { m_choicePlotDiagram->Clear(); }
void AppendStrToPlotDiagramChoice( wxString aString ) { m_choicePlotDiagram->AppendString( aString ); }
void SetSelToPlotDiagramChoice( int aSelection ) { m_choicePlotDiagram->SetSelection( aSelection ); }
private:
enum SCALE_TYPE
{
@ -142,6 +170,7 @@ private:
loadDirectives();
}
void onChoicePlotDiagramChange( wxCommandEvent& event ) override;
void onDCEnableSecondSource( wxCommandEvent& event ) override;
void onSwapDCSources( wxCommandEvent& event ) override;
void onDCSource1Selected( wxCommandEvent& event ) override;
@ -177,6 +206,7 @@ private:
SPICE_VALIDATOR m_spiceEmptyValidator;
wxIntegerValidator<int> m_posIntValidator;
std::set<wxString> m_fftInputSignals;
WX_INFOBAR* m_infoBar; // Infobar to notify when settings have been discarded
};
#endif /* DIALOG_SIM_COMMAND_H */

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 4.2.1-43-gf15ce330)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -13,7 +13,6 @@ DIALOG_SIM_COMMAND_BASE::DIALOG_SIM_COMMAND_BASE( wxWindow* parent, wxWindowID i
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
m_commandTypeSizer = new wxBoxSizer( wxHORIZONTAL );
@ -684,6 +683,23 @@ DIALOG_SIM_COMMAND_BASE::DIALOG_SIM_COMMAND_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* bPlotSetupSizer;
bPlotSetupSizer = new wxBoxSizer( wxVERTICAL );
m_sizerPlotDiagram = new wxBoxSizer( wxHORIZONTAL );
m_staticTextPlotDIagram = new wxStaticText( m_panelPlotSetup, wxID_ANY, _("Plot diagram:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPlotDIagram->Wrap( -1 );
m_sizerPlotDiagram->Add( m_staticTextPlotDIagram, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxArrayString m_choicePlotDiagramChoices;
m_choicePlotDiagram = new wxChoice( m_panelPlotSetup, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePlotDiagramChoices, 0 );
m_choicePlotDiagram->SetSelection( 0 );
m_sizerPlotDiagram->Add( m_choicePlotDiagram, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bPlotSetupSizer->Add( m_sizerPlotDiagram, 0, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( m_panelPlotSetup, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bPlotSetupSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_bSizerY1 = new wxBoxSizer( wxVERTICAL );
m_lockY1 = new wxCheckBox( m_panelPlotSetup, wxID_ANY, _("Fixed %s scale"), wxDefaultPosition, wxDefaultSize, 0 );
@ -920,6 +936,7 @@ DIALOG_SIM_COMMAND_BASE::DIALOG_SIM_COMMAND_BASE( wxWindow* parent, wxWindowID i
m_inputSignalsFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::OnFilterText ), NULL, this );
m_loadDirectives->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::onLoadDirectives ), NULL, this );
m_pzFunctionType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::onDCSource1Selected ), NULL, this );
m_choicePlotDiagram->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::onChoicePlotDiagramChange ), NULL, this );
m_y1MinLabel->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_COMMAND_BASE::OnUpdateUILockY1 ), NULL, this );
m_y1Min->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_COMMAND_BASE::OnUpdateUILockY1 ), NULL, this );
m_y1MaxLabel->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_COMMAND_BASE::OnUpdateUILockY1 ), NULL, this );
@ -950,6 +967,7 @@ DIALOG_SIM_COMMAND_BASE::~DIALOG_SIM_COMMAND_BASE()
m_inputSignalsFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::OnFilterText ), NULL, this );
m_loadDirectives->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::onLoadDirectives ), NULL, this );
m_pzFunctionType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::onDCSource1Selected ), NULL, this );
m_choicePlotDiagram->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SIM_COMMAND_BASE::onChoicePlotDiagramChange ), NULL, this );
m_y1MinLabel->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_COMMAND_BASE::OnUpdateUILockY1 ), NULL, this );
m_y1Min->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_COMMAND_BASE::OnUpdateUILockY1 ), NULL, this );
m_y1MaxLabel->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_COMMAND_BASE::OnUpdateUILockY1 ), NULL, this );

View File

@ -64,7 +64,7 @@
<property name="minimum_size"></property>
<property name="name">bSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
@ -272,11 +272,11 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="notebookpage" expanded="true">
<object class="notebookpage" expanded="false">
<property name="bitmap"></property>
<property name="label">SPICE Command</property>
<property name="select">1</property>
<object class="wxPanel" expanded="true">
<object class="wxPanel" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -328,16 +328,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bCommandSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property>
<object class="wxSimplebook" expanded="true">
<object class="wxSimplebook" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -389,7 +389,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="simplebookpage" expanded="true">
<object class="simplebookpage" expanded="false">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="false">
@ -5434,7 +5434,7 @@
</object>
</object>
</object>
<object class="simplebookpage" expanded="true">
<object class="simplebookpage" expanded="false">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="false">
@ -6162,7 +6162,7 @@
</object>
</object>
</object>
<object class="simplebookpage" expanded="true">
<object class="simplebookpage" expanded="false">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="false">
@ -6427,7 +6427,7 @@
</object>
</object>
</object>
<object class="simplebookpage" expanded="true">
<object class="simplebookpage" expanded="false">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="false">
@ -7323,11 +7323,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizer88</property>
<property name="orient">wxVERTICAL</property>
@ -7397,11 +7397,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7462,11 +7462,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7527,11 +7527,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7592,11 +7592,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7657,20 +7657,20 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">m_compatibilityModeSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">8</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7728,11 +7728,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="true">
<object class="wxChoice" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7862,19 +7862,217 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">m_sizerPlotDiagram</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">public</property>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Plot diagram:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextPlotDIagram</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choicePlotDiagram</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChoice">onChoicePlotDiagramChange</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">m_bSizerY1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7935,21 +8133,21 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="true">
<object class="spacer" expanded="false">
<property name="height">2</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">8</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="true">
<object class="wxFlexGridSizer" expanded="false">
<property name="cols">5</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
@ -7961,11 +8159,11 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">30</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8024,11 +8222,11 @@
<event name="OnUpdateUI">OnUpdateUILockY1</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8090,11 +8288,11 @@
<event name="OnUpdateUI">OnUpdateUILockY1</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">18</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8153,11 +8351,11 @@
<event name="OnUpdateUI">OnUpdateUILockY1</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8219,11 +8417,11 @@
<event name="OnUpdateUI">OnUpdateUILockY1</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8286,20 +8484,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">m_bSizerY2</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8360,21 +8558,21 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="true">
<object class="spacer" expanded="false">
<property name="height">2</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">8</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="true">
<object class="wxFlexGridSizer" expanded="false">
<property name="cols">5</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
@ -8386,11 +8584,11 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">30</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8449,11 +8647,11 @@
<event name="OnUpdateUI">OnUpdateUILockY2</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8515,11 +8713,11 @@
<event name="OnUpdateUI">OnUpdateUILockY2</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">18</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8578,11 +8776,11 @@
<event name="OnUpdateUI">OnUpdateUILockY2</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8644,11 +8842,11 @@
<event name="OnUpdateUI">OnUpdateUILockY2</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8711,20 +8909,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">m_bSizerY3</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8785,21 +8983,21 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="true">
<object class="spacer" expanded="false">
<property name="height">2</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">8</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="true">
<object class="wxFlexGridSizer" expanded="false">
<property name="cols">5</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
@ -8811,11 +9009,11 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">30</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8874,11 +9072,11 @@
<event name="OnUpdateUI">OnUpdateUILockY3</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -8940,11 +9138,11 @@
<event name="OnUpdateUI">OnUpdateUILockY3</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">18</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9003,11 +9201,11 @@
<event name="OnUpdateUI">OnUpdateUILockY3</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9069,11 +9267,11 @@
<event name="OnUpdateUI">OnUpdateUILockY3</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9136,20 +9334,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizerCheckboxes</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9210,11 +9408,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9275,11 +9473,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9342,21 +9540,21 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="true">
<object class="spacer" expanded="false">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">10</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9414,29 +9612,29 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizerMargins</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizerLeft</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">20</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9494,11 +9692,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9561,11 +9759,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="true">
<object class="wxFlexGridSizer" expanded="false">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
@ -9577,11 +9775,11 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">4</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">15</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9639,11 +9837,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9704,11 +9902,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">15</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9766,11 +9964,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9833,20 +10031,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizerRight</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">15</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -9904,11 +10102,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 4.2.1-43-gf15ce330)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -32,6 +32,7 @@
#include <wx/srchctrl.h>
#include <wx/checklst.h>
#include <wx/simplebook.h>
#include <wx/statline.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
@ -45,6 +46,7 @@ class DIALOG_SIM_COMMAND_BASE : public DIALOG_SHIM
private:
protected:
wxBoxSizer* bSizer1;
wxBoxSizer* m_commandTypeSizer;
wxStaticText* m_commandTypeLabel;
wxChoice* m_commandType;
@ -162,6 +164,9 @@ class DIALOG_SIM_COMMAND_BASE : public DIALOG_SHIM
wxBoxSizer* m_compatibilityModeSizer;
wxChoice* m_compatibilityMode;
wxPanel* m_panelPlotSetup;
wxStaticText* m_staticTextPlotDIagram;
wxChoice* m_choicePlotDiagram;
wxStaticLine* m_staticline1;
wxBoxSizer* m_bSizerY1;
wxCheckBox* m_lockY1;
wxStaticText* m_y1MinLabel;
@ -209,12 +214,14 @@ class DIALOG_SIM_COMMAND_BASE : public DIALOG_SHIM
virtual void OnFilterMouseMoved( wxMouseEvent& event ) { event.Skip(); }
virtual void OnFilterText( wxCommandEvent& event ) { event.Skip(); }
virtual void onLoadDirectives( wxCommandEvent& event ) { event.Skip(); }
virtual void onChoicePlotDiagramChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUpdateUILockY1( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnUpdateUILockY2( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnUpdateUILockY3( wxUpdateUIEvent& event ) { event.Skip(); }
public:
wxBoxSizer* m_sizerPlotDiagram;
DIALOG_SIM_COMMAND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Simulation Analysis"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );

View File

@ -59,7 +59,7 @@ void SIMULATOR_FRAME_UI::parseTraceParams( SIM_PLOT_TAB* aPlotTab, TRACE* aTrace
wxColour color;
color.Set( item );
aTrace->SetTraceColour( color );
aPlotTab->UpdateTraceStyle( aTrace );
aPlotTab->GetPlotDiagram( 0 )->UpdateTraceStyle( aTrace );
}
else if( item.StartsWith( wxS( "cursor1" ) ) )
{
@ -99,11 +99,11 @@ void SIMULATOR_FRAME_UI::parseTraceParams( SIM_PLOT_TAB* aPlotTab, TRACE* aTrace
}
else if( item == wxS( "dottedSecondary" ) )
{
aPlotTab->SetDottedSecondary( true );
aPlotTab->GetPlotDiagram( 0 )->SetDottedSecondary( true );
}
else if( item == wxS( "hideGrid" ) )
{
aPlotTab->ShowGrid( false );
aPlotTab->GetPlotDiagram( 0 )->ShowGrid( false );
}
}
}
@ -315,22 +315,22 @@ bool SIMULATOR_FRAME_UI::loadLegacyWorkbook( const wxString& aPath )
coords[0].ToLong( &x );
coords[1].ToLong( &y );
plotTab->SetLegendPosition( wxPoint( (int) x, (int) y ) );
plotTab->GetPlotDiagram( 0 )->SetLegendPosition( wxPoint( (int) x, (int) y ) );
}
plotTab->ShowLegend( true );
plotTab->GetPlotDiagram( 0 )->ShowLegend( true );
}
else
{
wxString vectorName = vectorNameFromSignalName( plotTab, signalName, nullptr );
TRACE* trace = plotTab->GetOrAddTrace( vectorName, (int) traceType );
TRACE* trace = plotTab->GetOrAddTrace( vectorName, (int) traceType, plotTab->GetPlotDiagram( 0 ) );
if( version >= 4 && trace )
parseTraceParams( plotTab, trace, signalName, param );
}
}
plotTab->UpdatePlotColors();
plotTab->UpdatePlotColorsFor( plotTab->GetPlotDiagram( 0 )->GetPrivatePlotWin() );
}
if( SIM_TAB* simTab = GetCurrentSimTab() )
@ -349,5 +349,3 @@ bool SIMULATOR_FRAME_UI::loadLegacyWorkbook( const wxString& aPath )
file.Close();
return true;
}

File diff suppressed because it is too large Load Diff

View File

@ -188,23 +188,45 @@ protected:
};
class SIM_PLOT_TAB : public SIM_TAB
class SIM_PLOT_DIAGRAM
{
public:
SIM_PLOT_TAB( const wxString& aSimCommand, wxWindow* parent );
SIM_PLOT_DIAGRAM( wxWindow* aParent );
~SIM_PLOT_DIAGRAM();
virtual ~SIM_PLOT_TAB();
void EnsureThirdYAxisExists();
void ApplyPreferences( const SIM_PREFERENCES& aPrefs ) override
{
m_plotWin->SetMouseWheelActions( convertMouseWheelActions( aPrefs.mouse_wheel_actions ) );
}
wxString GetUnitsX() const;
wxString GetLabelX() const
{
return m_axis_x ? m_axis_x->GetName() : wxString( wxS( "" ) );
}
mpScaleXBase* GetAxisX() const { return m_axis_x; }
mpScaleY* GetAxisY1() const { return m_axis_y1; }
mpScaleY* GetAxisY2() const { return m_axis_y2; }
mpScaleY* GetAxisY3() const { return m_axis_y3; }
void SetAxisX( mpScaleXBase* aAxisX ) { m_axis_x = aAxisX; }
void SetAxisY1( mpScaleY* aAxisY1 ) { m_axis_y1 = aAxisY1; }
void SetAxisY2( mpScaleY* aAxisY2 ) { m_axis_y2 = aAxisY2; }
void SetAxisY3( mpScaleY* aAxisY3 ) { m_axis_y3 = aAxisY3; }
void SetY1Scale( bool aLock, double aMin, double aMax );
void SetY2Scale( bool aLock, double aMin, double aMax );
void SetY3Scale( bool aLock, double aMin, double aMax );
wxString GetUnitsY1() const;
wxString GetUnitsY2() const;
wxString GetUnitsY3() const;
wxString GetLabelY1() const
{
return m_axis_y1 ? m_axis_y1->GetName() : wxString( wxS( "" ) );
@ -244,25 +266,12 @@ public:
return false;
}
void SetY1Scale( bool aLock, double aMin, double aMax );
void SetY2Scale( bool aLock, double aMin, double aMax );
void SetY3Scale( bool aLock, double aMin, double aMax );
wxString GetUnitsX() const;
wxString GetUnitsY1() const;
wxString GetUnitsY2() const;
wxString GetUnitsY3() const;
const std::map<wxString, TRACE*>& GetTraces() const
bool IsGridShown() const
{
return m_traces;
}
if( !m_axis_x || !m_axis_y1 )
return false;
TRACE* GetTrace( const wxString& aVecName, int aType ) const
{
auto trace = m_traces.find( getTraceId( aVecName, aType ) );
return trace == m_traces.end() ? nullptr : trace->second;
return !m_axis_x->GetTicks();
}
void ShowGrid( bool aEnable )
@ -282,14 +291,24 @@ public:
m_plotWin->UpdateAll();
}
bool IsGridShown() const
{
if( !m_axis_x || !m_axis_y1 )
return false;
return !m_axis_x->GetTicks();
/**
* Draw secondary signal traces (current or phase) with dotted lines
*/
void SetDottedSecondary( bool aEnable )
{
m_dotted_cp = aEnable;
for( const auto& [name, trace] : m_traces )
UpdateTraceStyle( trace );
m_plotWin->UpdateAll();
}
bool GetDottedSecondary() const { return m_dotted_cp; }
mpInfoLegend* GetLegend() { return m_legend; }
void ShowLegend( bool aEnable )
{
m_legend->SetVisible( aEnable );
@ -313,22 +332,86 @@ public:
m_LastLegendPosition = aPosition;
}
/**
* Draw secondary signal traces (current or phase) with dotted lines
void SetNickname( wxString aNickname ) { m_nickname = aNickname; }
void SetDescription( wxString aDescription ) { m_description = aDescription; }
void SetId( int aId ) { m_id = aId; }
wxString GetNickName() { return m_nickname; }
wxString GetDescription() const { return m_description; }
int GetId() { return m_id; }
wxBoxSizer* GetPlotDiaSizer() { return m_sizerBox; }
mpWindow* GetPrivatePlotWin() const { return m_plotWin; }
///< Update trace line style
void UpdateTraceStyle( TRACE* trace );
const std::map<wxString, TRACE*>& GetTraces() const { return m_traces; }
std::map<wxString, TRACE*>& GetTracesToChange() { return m_traces; }
void ClearTraces() { m_traces.clear(); }
void ResetScales( bool aIncludeX, SIM_PLOT_DIAGRAM* aPlotDiagram );
public:
wxPoint m_LastLegendPosition;
private:
wxWindow* m_parent;
// The plot window
mpWindow* m_plotWin;
/*
// A to be used plot's sizer
wxStaticBoxSizer* m_sizerBox;
*/
void SetDottedSecondary( bool aEnable )
// A temp plot sizer for now
wxBoxSizer* m_sizerBox;
// Traces to be plotted
std::map<wxString, TRACE*> m_traces;
mpScaleXBase* m_axis_x;
mpScaleY* m_axis_y1;
mpScaleY* m_axis_y2;
mpScaleY* m_axis_y3;
bool m_dotted_cp;
mpInfoLegend* m_legend;
wxString m_nickname;
wxString m_description;
int m_id;
};
class SIM_PLOT_TAB : public SIM_TAB
{
public:
SIM_PLOT_TAB( const wxString& aSimCommand, wxWindow* parent );
virtual ~SIM_PLOT_TAB();
void ApplyPreferences( const SIM_PREFERENCES& aPrefs ) override
{
m_dotted_cp = aEnable;
for( const auto& [ name, trace ] : m_traces )
UpdateTraceStyle( trace );
m_plotWin->UpdateAll();
for( const auto& plotDiagram : GetPlotDiagramVect() )
{
// clang-format off
plotDiagram->GetPrivatePlotWin()->SetMouseWheelActions( convertMouseWheelActions( aPrefs.mouse_wheel_actions ) );
// clang-format on
}
}
bool GetDottedSecondary() const
const std::map<wxString, TRACE*>& GetTraces() const { return GetPlotDiagram( 0 )->GetTraces(); }
TRACE* GetTrace( const wxString& aVecName, int aType, SIM_PLOT_DIAGRAM* aPlotDiagram ) const
{
return m_dotted_cp;
auto trace = aPlotDiagram->GetTraces().find( getTraceId( aVecName, aType ) );
return trace == aPlotDiagram->GetTraces().end() ? nullptr : trace->second;
}
///< Turn on/off the cursor for a particular trace.
@ -338,31 +421,36 @@ public:
///< Reset scale ranges to fit the current traces.
void ResetScales( bool aIncludeX );
///< Update trace line style
void UpdateTraceStyle( TRACE* trace );
///< Update plot colors
void UpdatePlotColors();
void UpdatePlotColorsFor( mpWindow* aPlotWindow );
void OnLanguageChanged() override;
///< Getter for math plot window
mpWindow* GetPlotWin() const { return m_plotWin; }
mpWindow* GetPlotWin() const { return GetPlotDiagram( 0 )->GetPrivatePlotWin(); }
TRACE* GetOrAddTrace( const wxString& aVectorName, int aType );
TRACE* GetOrAddTrace( const wxString& aVectorName, int aType, SIM_PLOT_DIAGRAM* aPlotDiagram );
void SetTraceData( TRACE* aTrace, std::vector<double>& aX, std::vector<double>& aY,
int aSweepCount, size_t aSweepSize );
void SetTraceData( TRACE* aTrace, std::vector<double>& aX, std::vector<double>& aY, int aSweepCount,
size_t aSweepSize, SIM_PLOT_DIAGRAM* aPlotDiagram );
bool DeleteTrace( const wxString& aVectorName, int aTraceType );
void DeleteTrace( TRACE* aTrace );
bool DeleteTrace( const wxString& aVectorName, int aTraceType, SIM_PLOT_DIAGRAM* aPlotDiagram );
void DeleteTrace( TRACE* aTrace, SIM_PLOT_DIAGRAM* aPlotDiagram );
std::vector<std::pair<wxString, wxString>>& Measurements() { return m_measurements; }
void EnsureThirdYAxisExists();
///< Getter for SIM_PLOT_DIAGRAM vector
std::vector<SIM_PLOT_DIAGRAM*> GetPlotDiagramVect() const { return m_plotsVector; };
public:
wxPoint m_LastLegendPosition;
///< Indexed getter for SIM_PLOT_DIAGRAM vector
SIM_PLOT_DIAGRAM* GetPlotDiagram( size_t aIndex ) const;
size_t GetPlotDiagramSize() const;
void SetSessionColors( const wxString& aString, const wxColour& aColor ) { m_sessionTraceColors[aString] = aColor; }
///< Public caller to update a mpWindow's contex menu entries.
void UpdateContextMenuEntriesTo( mpWindow* aPlotWin ) { updateContextMenuEntriesTo( aPlotWin ); }
private:
static mpWindow::MouseWheelActionSet
@ -389,29 +477,30 @@ private:
}
///< @brief Construct the plot axes for DC simulation plot.
void prepareDCAxes( int aNewTraceType );
void prepareDCAxes( int aNewTraceType, SIM_PLOT_DIAGRAM* aPlotDiagram );
///< Create/Ensure axes are available for plotting
void updateAxes( int aNewTraceType = SIM_TRACE_TYPE::SPT_UNKNOWN );
void updateAxesFor( int aNewTraceType = SIM_TRACE_TYPE::SPT_UNKNOWN, SIM_PLOT_DIAGRAM* aPlotDiagram = nullptr );
void makeNewPlotDiagram();
void initContextMenuEntriesTo( mpWindow* aPlotWin );
///< Private caller to update a mpWindow's contex menu entries.
void updateContextMenuEntriesTo( mpWindow* aPlotWin );
void onNewPlotdiagram( wxCommandEvent& aEvent );
void onDeletThisPlotdiagram( wxCommandEvent& aEvent );
void onDeleteAllPlotdiagrams( wxCommandEvent& aEvent );
private:
SIM_PLOT_COLORS m_colors;
std::map<wxString, wxColour> m_sessionTraceColors;
// Top-level plot window
mpWindow* m_plotWin;
wxBoxSizer* m_sizer;
// Top-level sizer
wxBoxSizer* m_sizerTop;
// Traces to be plotted
std::map<wxString, TRACE*> m_traces;
mpScaleXBase* m_axis_x;
mpScaleY* m_axis_y1;
mpScaleY* m_axis_y2;
mpScaleY* m_axis_y3;
mpInfoLegend* m_legend;
bool m_dotted_cp;
std::vector<SIM_PLOT_DIAGRAM*> m_plotsVector;
// Measurements (and their format strings)
std::vector<std::pair<wxString, wxString>> m_measurements;

View File

@ -507,7 +507,6 @@ const std::map<int, wxString>& SIMULATOR_FRAME::UserDefinedSignals()
return m_ui->UserDefinedSignals();
}
void SIMULATOR_FRAME::SetUserDefinedSignals( const std::map<int, wxString>& aSignals )
{
m_ui->SetUserDefinedSignals( aSignals );
@ -608,7 +607,28 @@ bool SIMULATOR_FRAME::EditAnalysis()
dlg.SetSimCommand( simTab->GetSimCommand() );
dlg.SetSimOptions( simTab->GetSimOptions() );
dlg.SetPlotSettings( simTab );
if( simTab->IsPlottable( simTab->GetSimType() ) )
{
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() );
// Append available plots,
for( const auto& aPlotDiagramm : plotTab->GetPlotDiagramVect() )
{
dlg.AppendStrToPlotDiagramChoice( aPlotDiagramm->GetNickName() );
}
dlg.m_sizerPlotDiagram->Show( true );
dlg.GetNotebook()->GetPage( 1 )->Enable();
// and set selection to the first entry.
dlg.SetSelToPlotDiagramChoice( 0 );
for( size_t i = 0; i < plotTab->GetPlotDiagramSize(); i++ )
{
dlg.SetPlotSettingsFor( simTab, plotTab->GetPlotDiagram( i ) );
}
}
if( dlg.ShowModal() == wxID_OK )
{
@ -678,21 +698,21 @@ void SIMULATOR_FRAME::setupUIConditions()
[this]( const SELECTION& aSel )
{
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() );
return plotTab && plotTab->IsGridShown();
return plotTab && plotTab->GetPlotDiagram( 0 )->IsGridShown();
};
auto showLegendCondition =
[this]( const SELECTION& aSel )
{
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() );
return plotTab && plotTab->IsLegendShown();
return plotTab && plotTab->GetPlotDiagram( 0 )->IsLegendShown();
};
auto showDottedCondition =
[this]( const SELECTION& aSel )
{
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() );
return plotTab && plotTab->GetDottedSecondary();
return plotTab && plotTab->GetPlotDiagram( 0 )->GetDottedSecondary();
};
auto darkModePlotCondition =

View File

@ -24,6 +24,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wx/msgdlg.h"
#include <memory>
#include <type_traits>
@ -104,7 +105,9 @@ enum
MYID_FOURIER,
MYID_FORMAT_VALUE,
MYID_DELETE_MEASUREMENT
MYID_DELETE_MEASUREMENT,
MYID_LAST // m_signalsGrid dynamic events for SIM_PLOT_TAB plotDiagrams add to that
};
@ -121,6 +124,7 @@ public:
protected:
void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
void doPopupSelection( wxCommandEvent& event ) override;
bool addPlotDiagramSubMenu( wxMenu* aSubMenu );
protected:
SIMULATOR_FRAME_UI* m_parent;
@ -180,6 +184,16 @@ void SIGNALS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
menu.AppendSeparator();
menu.Append( GRIDTRICKS_ID_SELECT, _( "Create new cursor..." ) );
menu.AppendSeparator();
wxMenu* subMenu = new wxMenu();
bool flag = addPlotDiagramSubMenu( subMenu );
menu.AppendSubMenu( subMenu, _( "Show Signal To:" ) );
menu.Enable( menu.FindItem( _( "Show Signal To:" ) ), flag );
m_grid->PopupMenu( &menu );
}
}
@ -205,6 +219,35 @@ void SIGNALS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
}
bool SIGNALS_GRID_TRICKS::addPlotDiagramSubMenu( wxMenu* aSubMenu )
{
SIM_TAB* simTab = m_parent->GetCurrentSimTab();
if( !simTab )
return false;
if( m_parent->GetSimulator()->IsRunning() )
return false;
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( simTab );
if( !plotTab )
return false;
int i = 0; // Starting from 0 allows plotting signals to the main plot
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
aSubMenu->Append( static_cast<int>( MYID_LAST ) + i, plotDiagram->GetNickName(),
_( "Shows the signal to " ) + wxString( "" ) << plotDiagram->GetNickName() );
i += 1;
}
return plotTab->GetPlotDiagramVect().size() > 1;
}
void SIGNALS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
{
std::vector<wxString> signals;
@ -340,6 +383,12 @@ void SIGNALS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
{
m_parent->DeleteCursor();
}
else if( event.GetId() >= static_cast<int>( MYID_LAST )
&& static_cast<int>( MYID_LAST ) < static_cast<int>( GRID_TRICKS_LAST_CLIENT_ID ) )
{
m_parent->ShowSignalToPlot( wxString( "" ) << m_grid->GetCellValue( m_menuRow, COL_SIGNAL_NAME ), wxString( "" ) << event.GetId() );
m_parent->UpdateSignalsGrid();
}
}
@ -601,6 +650,7 @@ SIMULATOR_FRAME_UI::SIMULATOR_FRAME_UI( SIMULATOR_FRAME* aSimulatorFrame,
},
m_refreshTimer.GetId() );
Bind( EVT_SIM_PLOT_PROPERTIES, &SIMULATOR_FRAME_UI::PlotProperties, this );
#ifndef wxHAS_NATIVE_TABART
// Default non-native tab art has ugly gradients we don't want
m_plotNotebook->SetArtProvider( new wxAuiSimpleTabArt() );
@ -610,6 +660,8 @@ SIMULATOR_FRAME_UI::SIMULATOR_FRAME_UI( SIMULATOR_FRAME* aSimulatorFrame,
SIMULATOR_FRAME_UI::~SIMULATOR_FRAME_UI()
{
Unbind( EVT_SIM_PLOT_PROPERTIES, &SIMULATOR_FRAME_UI::PlotProperties, this );
// Delete the GRID_TRICKS.
m_signalsGrid->PopEventHandler( true );
m_cursorsGrid->PopEventHandler( true );
@ -919,7 +971,7 @@ void SIMULATOR_FRAME_UI::rebuildSignalsGrid( wxString aFilter )
{
int traceType = SPT_UNKNOWN;
wxString vectorName = vectorNameFromSignalName( plotPanel, signal, &traceType );
TRACE* trace = plotPanel->GetTrace( vectorName, traceType );
TRACE* trace = plotPanel->GetTrace( vectorName, traceType, plotPanel->GetPlotDiagram( 0 ) );
m_signalsGrid->AppendRows( 1 );
m_signalsGrid->SetCellValue( row, COL_SIGNAL_NAME, signal );
@ -1265,13 +1317,16 @@ void SIMULATOR_FRAME_UI::onSignalsGridCellChanged( wxGridEvent& aEvent )
wxString vectorName = vectorNameFromSignalName( plotTab, signalName, &traceType );
if( col == COL_SIGNAL_SHOW )
{
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
if( text == wxS( "1" ) )
updateTrace( vectorName, traceType, plotTab );
else
plotTab->DeleteTrace( vectorName, traceType );
plotTab->DeleteTrace( vectorName, traceType, plotDiagram );
plotTab->GetPlotWin()->UpdateAll();
plotDiagram->GetPrivatePlotWin()->UpdateAll();
}
// Update enabled/visible states of other controls
updateSignalsGrid();
@ -1279,21 +1334,23 @@ void SIMULATOR_FRAME_UI::onSignalsGridCellChanged( wxGridEvent& aEvent )
OnModify();
}
else if( col == COL_SIGNAL_COLOR )
{
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
KIGFX::COLOR4D color( m_signalsGrid->GetCellValue( row, COL_SIGNAL_COLOR ) );
TRACE* trace = plotTab->GetTrace( vectorName, traceType );
TRACE* trace = plotTab->GetTrace( vectorName, traceType, plotDiagram );
if( trace )
{
trace->SetTraceColour( color.ToColour() );
plotTab->UpdateTraceStyle( trace );
plotTab->UpdatePlotColors();
plotDiagram->UpdateTraceStyle( trace );
plotTab->UpdatePlotColorsFor( plotDiagram->GetPrivatePlotWin() );
OnModify();
}
}
}
else if( col == COL_CURSOR_1 || col == COL_CURSOR_2
|| ( ( std::size( m_cursorFormatsDyn ) > std::size( m_cursorFormats ) )
&& col > COL_CURSOR_2 ) )
|| ( ( std::size( m_cursorFormatsDyn ) > std::size( m_cursorFormats ) ) && col > COL_CURSOR_2 ) )
{
int id = col == COL_CURSOR_1 ? 1 : 2;
@ -1308,7 +1365,7 @@ void SIMULATOR_FRAME_UI::onSignalsGridCellChanged( wxGridEvent& aEvent )
{
signalName = m_signalsGrid->GetCellValue( row, COL_SIGNAL_NAME );
vectorName = vectorNameFromSignalName( plotTab, signalName, &traceType );
activeTrace = plotTab->GetTrace( vectorName, traceType );
activeTrace = plotTab->GetTrace( vectorName, traceType, plotTab->GetPlotDiagram( 0 ) );
if( activeTrace )
plotTab->EnableCursor( activeTrace, id, signalName );
@ -1474,12 +1531,15 @@ void SIMULATOR_FRAME_UI::OnUpdateUI( wxUpdateUIEvent& event )
{
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() ) )
{
if( plotTab->GetLegendPosition() != plotTab->m_LastLegendPosition )
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
plotTab->m_LastLegendPosition = plotTab->GetLegendPosition();
if( plotDiagram->GetLegendPosition() != plotDiagram->m_LastLegendPosition )
{
plotDiagram->m_LastLegendPosition = plotDiagram->GetLegendPosition();
OnModify();
}
}
}
}
@ -1784,12 +1844,7 @@ void SIMULATOR_FRAME_UI::AddTrace( const wxString& aName, SIM_TRACE_TYPE aType )
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() ) )
{
if( simType == ST_AC )
{
updateTrace( aName, aType | SPT_AC_GAIN, plotTab );
updateTrace( aName, aType | SPT_AC_PHASE, plotTab );
}
else if( simType == ST_SP )
if( simType == ST_AC || simType == ST_SP )
{
updateTrace( aName, aType | SPT_AC_GAIN, plotTab );
updateTrace( aName, aType | SPT_AC_PHASE, plotTab );
@ -1799,7 +1854,10 @@ void SIMULATOR_FRAME_UI::AddTrace( const wxString& aName, SIM_TRACE_TYPE aType )
updateTrace( aName, aType, plotTab );
}
plotTab->GetPlotWin()->UpdateAll();
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
plotDiagram->GetPrivatePlotWin()->UpdateAll();
}
}
updateSignalsGrid();
@ -1807,6 +1865,47 @@ void SIMULATOR_FRAME_UI::AddTrace( const wxString& aName, SIM_TRACE_TYPE aType )
}
void SIMULATOR_FRAME_UI::ShowSignalToPlot( wxString& aSignalName, wxString& anEventID )
{
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() );
if( !plotTab )
return;
size_t i = static_cast<size_t>( 0 ) + MYID_LAST;
size_t maxEventId = MYID_LAST + plotTab->GetPlotDiagramSize();
unsigned int event = 0;
anEventID.ToUInt( &event );
if( event >= maxEventId )
return;
for( SIM_PLOT_DIAGRAM* plotDiagram : plotTab->GetPlotDiagramVect() )
{
if( !plotDiagram )
return;
if( event == i )
{
wxString signalName = aSignalName;
int traceType = SPT_UNKNOWN;
wxString vectorName = vectorNameFromSignalName( plotTab, signalName, &traceType );
updateTrace( vectorName, traceType, plotTab, nullptr, false, plotDiagram );
plotDiagram->GetPrivatePlotWin()->Fit();
plotDiagram->GetPrivatePlotWin()->UpdateAll();
return;
}
i += 1;
}
}
void SIMULATOR_FRAME_UI::SetUserDefinedSignals( const std::map<int, wxString>& aNewSignals )
{
for( size_t ii = 0; ii < m_plotNotebook->GetPageCount(); ++ii )
@ -1816,7 +1915,9 @@ void SIMULATOR_FRAME_UI::SetUserDefinedSignals( const std::map<int, wxString>& a
if( !plotTab )
continue;
for( const auto& [ id, existingSignal ] : m_userDefinedSignals )
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
for( const auto& [id, existingSignal] : m_userDefinedSignals )
{
int traceType = SPT_UNKNOWN;
wxString vectorName = vectorNameFromSignalName( plotTab, existingSignal, &traceType );
@ -1826,16 +1927,16 @@ void SIMULATOR_FRAME_UI::SetUserDefinedSignals( const std::map<int, wxString>& a
if( plotTab->GetSimType() == ST_AC )
{
for( int subType : { SPT_AC_GAIN, SPT_AC_PHASE } )
plotTab->DeleteTrace( vectorName, traceType | subType );
plotTab->DeleteTrace( vectorName, traceType | subType, plotDiagram );
}
else if( plotTab->GetSimType() == ST_SP )
{
for( int subType : { SPT_SP_AMP, SPT_AC_PHASE } )
plotTab->DeleteTrace( vectorName, traceType | subType );
plotTab->DeleteTrace( vectorName, traceType | subType, plotDiagram );
}
else
{
plotTab->DeleteTrace( vectorName, traceType );
plotTab->DeleteTrace( vectorName, traceType, plotDiagram );
}
}
else
@ -1844,7 +1945,7 @@ void SIMULATOR_FRAME_UI::SetUserDefinedSignals( const std::map<int, wxString>& a
{
for( int subType : { SPT_AC_GAIN, SPT_AC_PHASE } )
{
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType | subType ) )
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType | subType, plotDiagram ) )
trace->SetName( aNewSignals.at( id ) );
}
}
@ -1852,18 +1953,19 @@ void SIMULATOR_FRAME_UI::SetUserDefinedSignals( const std::map<int, wxString>& a
{
for( int subType : { SPT_SP_AMP, SPT_AC_PHASE } )
{
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType | subType ) )
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType | subType, plotDiagram ) )
trace->SetName( aNewSignals.at( id ) );
}
}
else
{
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType ) )
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType, plotDiagram ) )
trace->SetName( aNewSignals.at( id ) );
}
}
}
}
}
m_userDefinedSignals = aNewSignals;
@ -1880,11 +1982,22 @@ void SIMULATOR_FRAME_UI::SetUserDefinedSignals( const std::map<int, wxString>& a
void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceType,
SIM_PLOT_TAB* aPlotTab, std::vector<double>* aDataX,
bool aClearData )
bool aClearData, SIM_PLOT_DIAGRAM* aPlotDiagram )
{
if( !m_simulatorFrame->SimFinished() && !simulator()->IsRunning())
for( const auto& plotDia : aPlotTab->GetPlotDiagramVect() )
{
aPlotTab->GetOrAddTrace( aVectorName, aTraceType );
SIM_PLOT_DIAGRAM* plotDiagram = nullptr;
if( aPlotDiagram )
plotDiagram = aPlotDiagram;
else
plotDiagram = plotDia;
if( !m_simulatorFrame->SimFinished() && !simulator()->IsRunning() )
{
aPlotTab->GetOrAddTrace( aVectorName, aTraceType, plotDiagram );
return;
}
@ -1925,6 +2038,7 @@ void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceTyp
unsigned int size = aDataX->size();
// clang-format off
switch( simType )
{
case ST_AC:
@ -1974,16 +2088,22 @@ void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceTyp
sweepSize = aDataX->size() / sweepCount;
}
if( TRACE* trace = aPlotTab->GetOrAddTrace( aVectorName, aTraceType ) )
if( TRACE* trace = aPlotTab->GetOrAddTrace( aVectorName, aTraceType, plotDiagram ) )
{
if( data_y.size() >= size )
aPlotTab->SetTraceData( trace, *aDataX, data_y, sweepCount, sweepSize );
aPlotTab->SetTraceData( trace, *aDataX, data_y, sweepCount, sweepSize, plotDiagram );
}
// clang-format on
if( aPlotDiagram )
break;
}
}
// TODO make sure where to instantiate and how to style correct
// Better ask someone..
// Currently Plot checkboxes are getting updated from the main plot only,
// in case there is a tri-state checkbox this will be a nice place to apply.
template void SIMULATOR_FRAME_UI::signalsGridCursorUpdate<SIGNALS_GRID_COLUMNS, int, int>(
SIGNALS_GRID_COLUMNS, int, int );
@ -1998,7 +2118,7 @@ void SIMULATOR_FRAME_UI::signalsGridCursorUpdate( T t, U u, R r ) // t=cursor ty
wxGridCellAttrPtr attr = m_signalsGrid->GetOrCreateCellAttrPtr( r, static_cast<int>( t ) );
if( TRACE* trace = plotTab ? plotTab->GetTrace( vectorName, traceType ) : nullptr )
if( TRACE* trace = plotTab ? plotTab->GetTrace( vectorName, traceType, plotTab->GetPlotDiagram( 0 ) ) : nullptr )
{
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
@ -2007,7 +2127,7 @@ void SIMULATOR_FRAME_UI::signalsGridCursorUpdate( T t, U u, R r ) // t=cursor ty
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
}
if constexpr ( std::is_enum<T>::value )
if constexpr( std::is_enum<T>::value )
{
if( t == SIGNALS_GRID_COLUMNS::COL_SIGNAL_SHOW )
{
@ -2269,6 +2389,9 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath )
if( plotTab )
{
SIM_PLOT_DIAGRAM* plotDiagram = plotTab->GetPlotDiagram( 0 );
mpWindow* plotWin = plotTab->GetPlotWin();
if( tab_js.contains( "traces" ) )
traceInfo[plotTab] = tab_js[ "traces" ];
@ -2278,45 +2401,47 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath )
plotTab->Measurements().emplace_back( m_js[ "expr" ], m_js[ "format" ] );
}
plotTab->SetDottedSecondary( tab_js[ "dottedSecondary" ] );
plotTab->ShowGrid( tab_js[ "showGrid" ] );
plotDiagram->SetDottedSecondary( tab_js["dottedSecondary"] );
plotDiagram->ShowGrid( tab_js["showGrid"] );
if( tab_js.contains( "fixedY1scale" ) )
{
const nlohmann::json& scale_js = tab_js[ "fixedY1scale" ];
plotTab->SetY1Scale( true, scale_js[ "min" ], scale_js[ "max" ] );
plotTab->GetPlotWin()->LockY( true );
plotDiagram->SetY1Scale( true, scale_js["min"], scale_js["max"] );
plotWin->LockY( true );
}
if( tab_js.contains( "fixedY2scale" ) )
{
const nlohmann::json& scale_js = tab_js[ "fixedY2scale" ];
plotTab->SetY2Scale( true, scale_js[ "min" ], scale_js[ "max" ] );
plotTab->GetPlotWin()->LockY( true );
plotDiagram->SetY2Scale( true, scale_js["min"], scale_js["max"] );
plotWin->LockY( true );
}
if( tab_js.contains( "fixedY3scale" ) )
{
plotTab->EnsureThirdYAxisExists();
plotDiagram->EnsureThirdYAxisExists();
const nlohmann::json& scale_js = tab_js[ "fixedY3scale" ];
plotTab->SetY3Scale( true, scale_js[ "min" ], scale_js[ "max" ] );
plotTab->GetPlotWin()->LockY( true );
plotDiagram->SetY3Scale( true, scale_js["min"], scale_js["max"] );
plotWin->LockY( true );
}
if( tab_js.contains( "legend" ) )
{
const nlohmann::json& legend_js = tab_js[ "legend" ];
plotTab->SetLegendPosition( wxPoint( legend_js[ "x" ], legend_js[ "y" ] ) );
plotTab->ShowLegend( true );
plotDiagram->SetLegendPosition( wxPoint( legend_js["x"], legend_js["y"] ) );
plotDiagram->ShowLegend( true );
}
if( tab_js.contains( "margins" ) )
{
// clang-format off
const nlohmann::json& margins_js = tab_js[ "margins" ];
plotTab->GetPlotWin()->SetMargins( margins_js[ "top" ],
plotWin->SetMargins( margins_js[ "top" ],
margins_js[ "right" ],
margins_js[ "bottom" ],
margins_js[ "left" ] );
// clang-format on
}
}
}
@ -2389,17 +2514,19 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath )
};
for( const auto& [ plotTab, traces_js ] : traceInfo )
{
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
for( const nlohmann::json& trace_js : traces_js )
{
wxString signalName = trace_js[ "signal" ];
wxString signalName = trace_js["signal"];
wxString vectorName = vectorNameFromSignalName( plotTab, signalName, nullptr );
TRACE* trace = plotTab->GetOrAddTrace( vectorName, trace_js[ "trace_type" ] );
TRACE* trace = plotTab->GetOrAddTrace( vectorName, trace_js["trace_type"], plotDiagram );
if( trace )
{
if( trace_js.contains( "cursorD" ) )
addCursor( plotTab, trace, signalName, -1, trace_js[ "cursorD" ] );
addCursor( plotTab, trace, signalName, -1, trace_js["cursorD"] );
std::vector<const char*> aVec;
aVec.clear();
@ -2418,12 +2545,13 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath )
wxColour color;
color.Set( wxString( trace_js["color"].get<wxString>() ) );
trace->SetTraceColour( color );
plotTab->UpdateTraceStyle( trace );
plotDiagram->UpdateTraceStyle( trace );
}
}
}
plotTab->UpdatePlotColors();
plotTab->UpdatePlotColorsFor( plotDiagram->GetPrivatePlotWin() );
}
}
}
catch( nlohmann::json::parse_error& error )
@ -2588,27 +2716,32 @@ bool SIMULATOR_FRAME_UI::SaveWorkbook( const wxString& aPath )
{ "format", format } } ) );
}
SIM_PLOT_DIAGRAM* plotDiagram = plotTab->GetPlotDiagram( 0 );
// clang-format off
tab_js[ "traces" ] = traces_js;
tab_js[ "measurements" ] = measurements_js;
tab_js[ "dottedSecondary" ] = plotTab->GetDottedSecondary();
tab_js[ "showGrid" ] = plotTab->IsGridShown();
tab_js[ "dottedSecondary" ] = plotDiagram->GetDottedSecondary();
tab_js[ "showGrid" ] = plotDiagram->IsGridShown();
// clang-format on
double min, max;
if( plotTab->GetY1Scale( &min, &max ) )
if( plotDiagram->GetY1Scale( &min, &max ) )
tab_js[ "fixedY1scale" ] = nlohmann::json( { { "min", min }, { "max", max } } );
if( plotTab->GetY2Scale( &min, &max ) )
if( plotDiagram->GetY2Scale( &min, &max ) )
tab_js[ "fixedY2scale" ] = nlohmann::json( { { "min", min }, { "max", max } } );
if( plotTab->GetY3Scale( &min, &max ) )
if( plotDiagram->GetY3Scale( &min, &max ) )
tab_js[ "fixedY3scale" ] = nlohmann::json( { { "min", min }, { "max", max } } );
if( plotTab->IsLegendShown() )
// clang-format off
if( plotDiagram->IsLegendShown() )
{
tab_js[ "legend" ] = nlohmann::json( { { "x", plotTab->GetLegendPosition().x },
{ "y", plotTab->GetLegendPosition().y } } );
tab_js[ "legend" ] = nlohmann::json( { { "x", plotDiagram->GetLegendPosition().x },
{ "y", plotDiagram->GetLegendPosition().y } } );
}
// clang-format on
mpWindow* plotWin = plotTab->GetPlotWin();
@ -2759,7 +2892,12 @@ void SIMULATOR_FRAME_UI::ToggleDarkModePlots()
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( curPage );
if( plotTab )
plotTab->UpdatePlotColors();
{
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
plotTab->UpdatePlotColorsFor( plotDiagram->GetPrivatePlotWin() );
}
}
}
}
@ -2778,6 +2916,9 @@ void SIMULATOR_FRAME_UI::onPlotClosed( wxAuiNotebookEvent& event )
rebuildSignalsGrid( m_filter->GetValue() );
updatePlotCursors();
//To avoid a current side effect in dynamic cursors while closing one out of many sim tabs
updateSignalsGrid();
SIM_TAB* panel = GetCurrentSimTab();
if( !panel || panel->GetSimType() != ST_OP )
@ -2839,6 +2980,9 @@ void SIMULATOR_FRAME_UI::onPlotChanged( wxAuiNotebookEvent& event )
OnPlotSettingsChanged();
//To avoid a current side effect in dynamic cursors while switching sim tabs
updateSignalsGrid();
event.Skip();
}
@ -2894,6 +3038,8 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
if( !plotTab )
return;
SIM_PLOT_DIAGRAM* plotDiagram = plotTab->GetPlotDiagram( 0 );
// Update cursor values
CURSOR* cursor1 = nullptr;
wxString cursor1Name;
@ -2908,18 +3054,18 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
if( plotTab->GetSimType() == ST_AC )
{
if( aTrace->GetType() & SPT_AC_PHASE )
return plotTab->GetUnitsY2();
return plotDiagram->GetUnitsY2();
else
return plotTab->GetUnitsY1();
return plotDiagram->GetUnitsY1();
}
else
{
if( aTrace->GetType() & SPT_POWER )
return plotTab->GetUnitsY3();
return plotDiagram->GetUnitsY3();
else if( aTrace->GetType() & SPT_CURRENT )
return plotTab->GetUnitsY2();
return plotDiagram->GetUnitsY2();
else
return plotTab->GetUnitsY1();
return plotDiagram->GetUnitsY1();
}
};
@ -2929,18 +3075,18 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
if( plotTab->GetSimType() == ST_AC )
{
if( aTrace->GetType() & SPT_AC_PHASE )
return plotTab->GetLabelY2();
return plotDiagram->GetLabelY2();
else
return plotTab->GetLabelY1();
return plotDiagram->GetLabelY1();
}
else
{
if( aTrace->GetType() & SPT_POWER )
return plotTab->GetLabelY3();
return plotDiagram->GetLabelY3();
else if( aTrace->GetType() & SPT_CURRENT )
return plotTab->GetLabelY2();
return plotDiagram->GetLabelY2();
else
return plotTab->GetLabelY1();
return plotDiagram->GetLabelY1();
}
};
@ -2964,7 +3110,7 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
wxRealPoint coords = cursor->GetCoords();
int row = m_cursorsGrid->GetNumberRows();
m_cursorFormatsDyn[0][0].UpdateUnits( plotTab->GetUnitsX() );
m_cursorFormatsDyn[0][0].UpdateUnits( plotDiagram->GetUnitsX() );
m_cursorFormatsDyn[0][1].UpdateUnits( cursor1Units );
m_cursorsGrid->AppendRows( 1 );
@ -2987,7 +3133,7 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
wxRealPoint coords = cursor->GetCoords();
int row = m_cursorsGrid->GetNumberRows();
m_cursorFormatsDyn[1][0].UpdateUnits( plotTab->GetUnitsX() );
m_cursorFormatsDyn[1][0].UpdateUnits( plotDiagram->GetUnitsX() );
m_cursorFormatsDyn[1][1].UpdateUnits( cursor2Units );
m_cursorsGrid->AppendRows( 1 );
@ -3004,7 +3150,7 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
wxRealPoint coords = cursor2->GetCoords() - cursor1->GetCoords();
wxString signal;
m_cursorFormatsDyn[2][0].UpdateUnits( plotTab->GetUnitsX() );
m_cursorFormatsDyn[2][0].UpdateUnits( plotDiagram->GetUnitsX() );
m_cursorFormatsDyn[2][1].UpdateUnits( cursor1Units );
if( cursor1->GetName() == cursor2->GetName() )
@ -3019,7 +3165,7 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
m_cursorsGrid->SetCellValue( 2, COL_CURSOR_Y, formatValue( coords.y, 2, 1 ) );
}
// Set up the labels
m_cursorsGrid->SetColLabelValue( COL_CURSOR_X, plotTab->GetLabelX() );
m_cursorsGrid->SetColLabelValue( COL_CURSOR_X, plotDiagram->GetLabelX() );
wxString valColName = _( "Value" );
@ -3050,7 +3196,7 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
wxRealPoint coords = cursor->GetCoords();
int row = m_cursorsGrid->GetNumberRows();
m_cursorFormatsDyn[i][0].UpdateUnits( plotTab->GetUnitsX() );
m_cursorFormatsDyn[i][0].UpdateUnits( plotDiagram->GetUnitsX() );
m_cursorFormatsDyn[i][1].UpdateUnits( cursUnits );
m_cursorsGrid->AppendRows( 1 );
@ -3060,7 +3206,7 @@ void SIMULATOR_FRAME_UI::updatePlotCursors()
m_cursorsGrid->SetCellValue( row, COL_CURSOR_Y, formatValue( coords.y, i, 1 ) );
// Set up the labels
m_cursorsGrid->SetColLabelValue( COL_CURSOR_X, plotTab->GetLabelX() );
m_cursorsGrid->SetColLabelValue( COL_CURSOR_X, plotDiagram->GetLabelX() );
valColName = _( "Value" );
@ -3197,21 +3343,23 @@ void SIMULATOR_FRAME_UI::OnSimRefresh( bool aFinal )
std::map<TRACE*, TRACE_INFO> traceMap;
for( const auto& [ name, trace ] : plotTab->GetTraces() )
traceMap[ trace ] = { wxEmptyString, SPT_UNKNOWN, false };
traceMap[trace] = { wxEmptyString, SPT_UNKNOWN, false };
// NB: m_signals are already broken out into gain/phase, but m_userDefinedSignals are
// as the user typed them
for( const auto& plotDiagram : plotTab->GetPlotDiagramVect() )
{
for( const wxString& signal : m_signals )
{
int traceType = SPT_UNKNOWN;
wxString vectorName = vectorNameFromSignalName( plotTab, signal, &traceType );
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType ) )
traceMap[ trace ] = { vectorName, traceType, false };
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType, plotDiagram ) )
traceMap[trace] = { vectorName, traceType, false };
}
for( const auto& [ id, signal ] : m_userDefinedSignals )
for( const auto& [id, signal] : m_userDefinedSignals )
{
int traceType = SPT_UNKNOWN;
wxString vectorName = vectorNameFromSignalName( plotTab, signal, &traceType );
@ -3222,8 +3370,8 @@ void SIMULATOR_FRAME_UI::OnSimRefresh( bool aFinal )
for( int subType : { baseType | SPT_AC_GAIN, baseType | SPT_AC_PHASE } )
{
if( TRACE* trace = plotTab->GetTrace( vectorName, subType ) )
traceMap[ trace ] = { vectorName, subType, !aFinal };
if( TRACE* trace = plotTab->GetTrace( vectorName, subType, plotDiagram ) )
traceMap[trace] = { vectorName, subType, !aFinal };
}
}
else if( simType == ST_SP )
@ -3232,26 +3380,28 @@ void SIMULATOR_FRAME_UI::OnSimRefresh( bool aFinal )
for( int subType : { baseType | SPT_SP_AMP, baseType | SPT_AC_PHASE } )
{
if( TRACE* trace = plotTab->GetTrace( vectorName, subType ) )
if( TRACE* trace = plotTab->GetTrace( vectorName, subType, plotDiagram ) )
traceMap[trace] = { vectorName, subType, !aFinal };
}
}
else
{
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType ) )
traceMap[ trace ] = { vectorName, traceType, !aFinal };
if( TRACE* trace = plotTab->GetTrace( vectorName, traceType, plotDiagram ) )
traceMap[trace] = { vectorName, traceType, !aFinal };
}
}
// Two passes so that DC-sweep sub-traces get deleted and re-created:
for( const auto& [ trace, traceInfo ] : traceMap )
for( const auto& [trace, traceInfo] : traceMap )
{
if( traceInfo.Vector.IsEmpty() )
plotTab->DeleteTrace( trace );
plotTab->DeleteTrace( trace, plotDiagram );
}
}
for( const auto& [ trace, info ] : traceMap )
for( const auto& [trace, info] : traceMap )
{
std::vector<double> data_x;
@ -3259,7 +3409,10 @@ void SIMULATOR_FRAME_UI::OnSimRefresh( bool aFinal )
updateTrace( info.Vector, info.TraceType, plotTab, &data_x, info.ClearData );
}
plotTab->GetPlotWin()->UpdateAll();
for( const auto& aV : plotTab->GetPlotDiagramVect() )
{
aV->GetPrivatePlotWin()->UpdateAll();
}
if( aFinal )
{
@ -3269,7 +3422,10 @@ void SIMULATOR_FRAME_UI::OnSimRefresh( bool aFinal )
plotTab->ResetScales( true );
}
plotTab->GetPlotWin()->Fit();
for( const auto& aV : plotTab->GetPlotDiagramVect() )
{
aV->GetPrivatePlotWin()->Fit();
}
updatePlotCursors();
}
@ -3324,8 +3480,70 @@ void SIMULATOR_FRAME_UI::OnSimRefresh( bool aFinal )
}
}
void SIMULATOR_FRAME_UI::PlotProperties( wxCommandEvent& aEvent )
{
SIM_TAB* simTab = GetCurrentSimTab();
if( simTab && simTab->IsPlottable( simTab->GetSimType() ) )
{
SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( GetCurrentSimTab() );
if( !plotTab )
return;
DIALOG_SIM_COMMAND dlg( m_simulatorFrame, m_simulatorFrame->GetCircuitModel(),
m_simulatorFrame->GetSimulator()->Settings() );
dlg.SetSimCommand( GetCurrentSimTab()->GetSimCommand() );
dlg.SetSimOptions( GetCurrentSimTab()->GetSimOptions() );
// Only focus on plot diagram properties, maybe offer the other tab
dlg.GetNotebook()->GetPage( 0 )->Disable();
dlg.m_sizerPlotDiagram->Show( true );
// to open the tab of interest
dlg.GetNotebook()->GetPage( 1 )->Enable();
dlg.GetNotebook()->GetPage( 1 )->Show();
dlg.SetPlotConfigTab( 1 );
dlg.GetNotebook()->GetPage( 1 )->Refresh();
dlg.ClearPlotDiagramChoice();
for( const auto& aPlotDiagram : plotTab->GetPlotDiagramVect() )
{
dlg.AppendStrToPlotDiagramChoice( aPlotDiagram->GetNickName() );
}
mpWindow* eventObj = dynamic_cast<mpWindow*>( aEvent.GetEventObject() );
//int eventWindowId = aEvent.GetId();
for( const auto& aPlotDiagram : plotTab->GetPlotDiagramVect() )
{
//if( eventWindowId == aPlotDiagram->GetId() )
if( aPlotDiagram->GetPrivatePlotWin() == eventObj )
{
dlg.SetSelToPlotDiagramChoice( dlg.GetPlotDiagramChoice()->FindString( aPlotDiagram->GetNickName() ) );
//dlg.GetPlotDiagramChoice()->SetSelection( aPlotDiagram->GetId() );
dlg.SetPlotSettingsFor( GetCurrentSimTab(), aPlotDiagram );
}
}
if( dlg.ShowModal() == wxID_OK )
{
GetCurrentSimTab()->SetSimCommand( dlg.GetSimCommand() );
dlg.ApplySettings( GetCurrentSimTab() );
OnPlotSettingsChanged();
OnModify();
}
}
}
void SIMULATOR_FRAME_UI::OnModify()
{
m_simulatorFrame->OnModify();
}
wxDEFINE_EVENT( EVT_SIM_PLOT_PROPERTIES, wxCommandEvent );

View File

@ -30,6 +30,7 @@
#include <sim/simulator_frame_ui_base.h>
#include "widgets/wx_grid.h"
#include <sim/sim_types.h>
#include <sim/sim_plot_tab.h>
#include <sim/sim_preferences.h>
@ -47,16 +48,18 @@ class SPICE_CIRCUIT_MODEL;
class SIM_THREAD_REPORTER;
class TUNER_SLIDER;
/**
*
* The SIMULATOR_FRAME_UI holds the main user-interface for running simulations.
*
* It contains a workbook with multiple tabs, each tab holding a SIM_PLOT_TAB, a specific
* simulation command (.TRAN, .AC, etc.), and simulation settings (save all currents, etc.).
* It contains a workbook with multiple tabs, each tab holding a SIM_PLOT_TAB
* that in its turn holds a SIM_PLOT_DIAGRAM std::vector to allow multiple/dynamic plots,
* a specific simulation command (.TRAN, .AC, etc.), and simulation settings (save all currents, etc.).
*
* Each plot can have multiple TRACEs. While internally each TRACE can have multiple cursors,
* the GUI supports only two cursors (and a differential cursor) for each plot.
* the GUI supports only two hardcoded cursors 1 & 2 for each plot
* (and a differential cursor when both 1 & 2 are enabled ),
* plus some dynamically created cursors that do not offer a differential one.
*
* TRACEs are identified by a signal (V(OUT), I(R2), etc.) and a type (SPT_VOLTAGE, SPT_AC_PHASE,
* etc.).
@ -85,6 +88,9 @@ public:
std::vector<wxString> Signals() const;
const std::map<int, wxString>& UserDefinedSignals() { return m_userDefinedSignals; }
wxAuiNotebook* GetPlotTabNotebook() { return m_plotNotebook; }
void SetUserDefinedSignals( const std::map<int, wxString>& aSignals );
/**
@ -102,6 +108,18 @@ public:
*/
void DeleteCursor();
/**
* Shows a signal from m_signalsGrid to an aux plot
* Called from grids context menu.
*/
void ShowSignalToPlot( wxString& aSignalName, wxString& anEventID );
/**
* Public member to fire after ShowSignalToPlot
* from m_signalsGrid context menu
*/
void UpdateSignalsGrid() { updateSignalsGrid(); }
/**
* Add a new trace to the current plot.
*
@ -253,6 +271,11 @@ public:
void OnModify();
const WX_GRID* GetSignalsGrid() { return m_signalsGrid; }
wxString GetSignalsGridCellValue( int aRow, int aCol ) { return GetSignalsGrid()->GetCellValue( aRow, aCol ); }
std::shared_ptr<SPICE_SIMULATOR> GetSimulator() const { return simulator(); }
private:
/**
* Get the simulator output vector name for a given signal name and type.
@ -267,9 +290,12 @@ private:
* @param aVectorName is the SPICE vector name, such as "I(Net-C1-Pad1)".
* @param aTraceType describes the type of plot.
* @param aPlotTab is the tab that should receive the update.
* @param aPlotDiagram is a single plot diagram to update.
* if nullptr then iterate through the vector and update all existing plots.
*/
void updateTrace( const wxString& aVectorName, int aTraceType, SIM_PLOT_TAB* aPlotTab,
std::vector<double>* aDataX = nullptr, bool aClearData = false );
std::vector<double>* aDataX = nullptr, bool aClearData = false,
SIM_PLOT_DIAGRAM* aPlotDiagram = nullptr );
/**
* A common toggler for the two main wxSplitterWindow s
@ -368,6 +394,8 @@ private:
void onPlotCursorUpdate( wxCommandEvent& aEvent );
void PlotProperties( wxCommandEvent& aEvent );
public:
int m_SuppressGridEvents;

View File

@ -93,6 +93,8 @@ int SIMULATOR_CONTROL::NewAnalysisTab( const TOOL_EVENT& aEvent )
dlg.SetSimCommand( wxS( "*" ) );
dlg.SetSimOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS );
dlg.ShowPage( 0 );
if( dlg.ShowModal() == wxID_OK )
{
SIM_TAB* tab = m_simulatorFrame->NewSimTab( dlg.GetSimCommand() );
@ -421,7 +423,7 @@ int SIMULATOR_CONTROL::ToggleGrid( const TOOL_EVENT& aEvent )
{
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
{
plotTab->ShowGrid( !plotTab->IsGridShown() );
plotTab->GetPlotDiagram( 0 )->ShowGrid( !plotTab->GetPlotDiagram( 0 )->IsGridShown() );
m_simulatorFrame->OnModify();
}
@ -433,7 +435,7 @@ int SIMULATOR_CONTROL::ToggleLegend( const TOOL_EVENT& aEvent )
{
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
{
plotTab->ShowLegend( !plotTab->IsLegendShown() );
plotTab->GetPlotDiagram( 0 )->ShowLegend( !plotTab->GetPlotDiagram( 0 )->IsLegendShown() );
m_simulatorFrame->OnModify();
}
@ -445,7 +447,7 @@ int SIMULATOR_CONTROL::ToggleDottedSecondary( const TOOL_EVENT& aEvent )
{
if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
{
plotTab->SetDottedSecondary( !plotTab->GetDottedSecondary() );
plotTab->GetPlotDiagram( 0 )->SetDottedSecondary( !plotTab->GetPlotDiagram( 0 )->GetDottedSecondary() );
m_simulatorFrame->OnModify();
}

View File

@ -112,12 +112,22 @@ class WXDLLIMPEXP_MATHPLOT mpPrintout;
/** Command IDs used by mpWindow */
enum
{
// clang-format off
mpID_FIT = 2000, // !< Fit view to match bounding box of all layers
mpID_ZOOM_UNDO,
mpID_ZOOM_REDO,
mpID_ZOOM_IN, // !< Zoom into view at clickposition / window center
mpID_ZOOM_OUT, // !< Zoom out
mpID_CENTER, // !< Center view on click position
// Not handled directly by mpWindow, here we just queue an event
mpID_PLOT_PROP, // !< Opens plot's properties
mpID_NEW_PLOTDIAGRAM, // !< Create a new plot into current sim tab,
mpID_DELETE_THIS_PLOTDIAGRAM, // !< Closes selected plot from current sim tab,
mpID_DELETE_ALL_PLOTDIAGRAMS, // !< Closes all but the main plot from current sim tab,
// clang-format on
};
// -----------------------------------------------------------------------------
@ -1290,6 +1300,13 @@ protected:
void onZoomOut( wxCommandEvent& event ); // !< Context menu handler
void onZoomUndo( wxCommandEvent& event ); // !< Context menu handler
void onZoomRedo( wxCommandEvent& event ); // !< Context menu handler
void onPlotProperties( wxCommandEvent& event ); // !< Context menu handler to open plot properties
void onNewPlotdiagram( wxCommandEvent& event ); // !< Context menu handler to make a new plot
void onDeleteThisPlotdiagram( wxCommandEvent& event ); // !< Context menu handler to delete selected plot
void onDeleteAllPlotdiagrams( wxCommandEvent& event ); // !< Context menu handler to delete all plots
void onMouseWheel( wxMouseEvent& event ); // !< Mouse handler for the wheel
void onMagnify( wxMouseEvent& event ); // !< Pinch zoom handler
void onMouseMove( wxMouseEvent& event ); // !< Mouse handler for mouse motion (for pan)
@ -1482,4 +1499,10 @@ protected:
};
wxDECLARE_EVENT( EVT_SIM_PLOT_PROPERTIES, wxCommandEvent );
wxDECLARE_EVENT( EVT_SIM_NEW_PLOTDIAGRAM, wxCommandEvent );
wxDECLARE_EVENT( EVT_SIM_DELETE_THIS_PLOTDIAGRAM, wxCommandEvent );
wxDECLARE_EVENT( EVT_SIM_DELETE_ALL_PLOTDIAGRAMS, wxCommandEvent );
#endif // _MP_MATHPLOT_H_