2016-08-11 12:41:07 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2023-01-01 23:37:24 +00:00
|
|
|
* Copyright (C) 2016-2023 CERN
|
|
|
|
* Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-06-13 23:47:05 +00:00
|
|
|
*
|
2016-08-11 12:41:07 +00:00
|
|
|
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
|
|
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2016-08-11 12:41:43 +00:00
|
|
|
* as published by the Free Software Foundation; either version 3
|
2016-08-11 12:41:07 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
2016-08-11 12:41:43 +00:00
|
|
|
* https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 3 license,
|
2016-08-11 12:41:07 +00:00
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2018-03-21 16:20:35 +00:00
|
|
|
#ifndef __SIM_PLOT_FRAME__
|
|
|
|
#define __SIM_PLOT_FRAME__
|
2016-08-11 12:41:01 +00:00
|
|
|
|
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
#include <sim/sim_plot_frame_base.h>
|
|
|
|
#include <sim/sim_types.h>
|
2016-08-11 12:41:41 +00:00
|
|
|
|
|
|
|
#include <kiway_player.h>
|
2022-12-11 15:49:29 +00:00
|
|
|
#include <dialogs/dialog_sim_command.h>
|
2016-08-11 12:41:19 +00:00
|
|
|
|
2016-08-11 12:41:07 +00:00
|
|
|
#include <wx/event.h>
|
2016-08-11 12:41:45 +00:00
|
|
|
|
|
|
|
#include <list>
|
2016-08-11 12:41:41 +00:00
|
|
|
#include <memory>
|
2016-08-11 12:41:45 +00:00
|
|
|
#include <map>
|
2016-08-11 12:41:01 +00:00
|
|
|
|
2016-08-11 12:41:41 +00:00
|
|
|
class SCH_EDIT_FRAME;
|
2021-06-10 14:10:55 +00:00
|
|
|
class SCH_SYMBOL;
|
2016-08-11 12:41:45 +00:00
|
|
|
|
2016-08-11 12:41:01 +00:00
|
|
|
class SPICE_SIMULATOR;
|
2021-03-18 19:31:02 +00:00
|
|
|
class SPICE_SIMULATOR_SETTINGS;
|
2022-03-05 23:49:25 +00:00
|
|
|
class NGSPICE_CIRCUIT_MODEL;
|
2020-04-15 01:51:58 +00:00
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
#include <sim/sim_plot_panel.h>
|
|
|
|
#include <sim/sim_panel_base.h>
|
2023-02-12 14:55:00 +00:00
|
|
|
#include <sim/sim_notebook.h>
|
2020-04-15 01:51:58 +00:00
|
|
|
|
2016-08-19 13:51:19 +00:00
|
|
|
class SIM_THREAD_REPORTER;
|
2016-08-11 12:41:45 +00:00
|
|
|
class TUNER_SLIDER;
|
2016-08-11 12:41:01 +00:00
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
|
2016-08-11 12:41:01 +00:00
|
|
|
class SIM_PLOT_FRAME : public SIM_PLOT_FRAME_BASE
|
|
|
|
{
|
2016-08-11 12:42:17 +00:00
|
|
|
public:
|
|
|
|
SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
|
|
|
~SIM_PLOT_FRAME();
|
|
|
|
|
2023-02-12 14:55:00 +00:00
|
|
|
/**
|
|
|
|
* Check and load the current netlist into the simulator.
|
|
|
|
* @return true if document is fully annotated and netlist was loaded successfully.
|
|
|
|
*/
|
|
|
|
bool LoadSimulator();
|
|
|
|
|
2023-02-11 23:25:32 +00:00
|
|
|
void StartSimulation();
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Create a new plot panel for a given simulation type and adds it to the main notebook.
|
|
|
|
*
|
2023-01-14 00:17:33 +00:00
|
|
|
* @param aSimCommand is requested simulation command.
|
|
|
|
* @param aSimOptions netlisting options
|
2016-08-11 12:42:17 +00:00
|
|
|
* @return The new plot panel.
|
|
|
|
*/
|
2023-01-29 16:01:03 +00:00
|
|
|
SIM_PANEL_BASE* NewPlotPanel( const wxString& aSimCommand, int aSimOptions );
|
2016-08-11 12:42:17 +00:00
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
/**
|
|
|
|
* Shows a dialog for editing the current tab's simulation command, or creating a new tab
|
|
|
|
* with a different simulation command type.
|
|
|
|
*/
|
2023-01-21 13:24:47 +00:00
|
|
|
bool EditSimCommand();
|
2023-01-01 23:37:24 +00:00
|
|
|
|
2023-02-21 09:06:02 +00:00
|
|
|
const std::vector<wxString>& Signals() { return m_signals; }
|
|
|
|
|
|
|
|
const std::vector<wxString>& UserDefinedSignals() { return m_userDefinedSignals; }
|
|
|
|
void SetUserDefinedSignals( const std::vector<wxString>& aSignals );
|
|
|
|
|
2016-08-11 12:42:17 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Add a voltage plot for a given net name.
|
|
|
|
*
|
2016-08-11 12:42:17 +00:00
|
|
|
* @param aNetName is the net name for which a voltage plot should be created.
|
|
|
|
*/
|
|
|
|
void AddVoltagePlot( const wxString& aNetName );
|
|
|
|
|
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Add a current plot for a particular device.
|
|
|
|
*
|
2016-08-11 12:42:17 +00:00
|
|
|
* @param aDeviceName is the device name (e.g. R1, C1).
|
|
|
|
* @param aParam is the current type (e.g. I, Ic, Id).
|
|
|
|
*/
|
2022-04-12 14:37:06 +00:00
|
|
|
void AddCurrentPlot( const wxString& aDeviceName );
|
2016-08-11 12:42:17 +00:00
|
|
|
|
2023-02-05 20:47:27 +00:00
|
|
|
/**
|
2023-02-11 20:39:50 +00:00
|
|
|
* Get/Set the number of significant digits and the range for formatting a cursor value.
|
2023-02-05 20:47:27 +00:00
|
|
|
* @param aValueCol 0 indicates the X value column; 1 the Y value.
|
|
|
|
*/
|
2023-02-11 20:39:50 +00:00
|
|
|
SPICE_VALUE_FORMAT GetCursorFormat( int aCursorId, int aValueCol ) const
|
2023-02-05 20:47:27 +00:00
|
|
|
{
|
2023-02-11 20:39:50 +00:00
|
|
|
return m_cursorFormats[ aCursorId ][ aValueCol ];
|
2023-02-05 20:47:27 +00:00
|
|
|
}
|
|
|
|
|
2023-02-11 20:39:50 +00:00
|
|
|
void SetCursorFormat( int aCursorId, int aValueCol, const SPICE_VALUE_FORMAT& aFormat )
|
2023-02-05 20:47:27 +00:00
|
|
|
{
|
2023-02-11 20:39:50 +00:00
|
|
|
m_cursorFormats[ aCursorId ][ aValueCol ] = aFormat;
|
2023-02-05 20:47:27 +00:00
|
|
|
|
|
|
|
wxCommandEvent dummy;
|
|
|
|
onCursorUpdate( dummy );
|
|
|
|
}
|
|
|
|
|
2016-08-11 12:42:17 +00:00
|
|
|
/**
|
2021-06-10 14:10:55 +00:00
|
|
|
* Add a tuner for a symbol.
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
2022-12-23 22:02:59 +00:00
|
|
|
void AddTuner( const SCH_SHEET_PATH& aSheetPath, SCH_SYMBOL* aSymbol );
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Remove an existing tuner.
|
|
|
|
*
|
2016-08-11 12:42:17 +00:00
|
|
|
* @param aTuner is the tuner to be removed.
|
|
|
|
* @param aErase decides whether the tuner should be also removed from the tuners list.
|
|
|
|
* Otherwise it is removed only from the SIM_PLOT_FRAME pane.
|
|
|
|
*/
|
|
|
|
void RemoveTuner( TUNER_SLIDER* aTuner, bool aErase = true );
|
|
|
|
|
2021-11-02 00:04:09 +00:00
|
|
|
/**
|
2021-12-14 13:00:00 +00:00
|
|
|
* Safely update a field of the associated symbol without dereferencing
|
2021-11-02 00:04:09 +00:00
|
|
|
* the symbol.
|
|
|
|
*
|
2022-12-23 17:39:28 +00:00
|
|
|
* @param aSymbol id of the symbol needing updating
|
2021-12-14 13:00:00 +00:00
|
|
|
* @param aId id of the symbol field
|
|
|
|
* @param aValue new value of the symbol field
|
2021-11-02 00:04:09 +00:00
|
|
|
*/
|
2022-12-23 22:02:59 +00:00
|
|
|
void UpdateTunerValue( const SCH_SHEET_PATH& aSheetPath, const KIID& aSymbol,
|
|
|
|
const wxString& aRef, const wxString& aValue );
|
2021-11-02 00:04:09 +00:00
|
|
|
|
2023-02-11 20:39:50 +00:00
|
|
|
/**
|
|
|
|
* Add a measurement to the measurements grid.
|
|
|
|
*/
|
2023-02-21 13:31:32 +00:00
|
|
|
void AddMeasurement( const wxString& aCmd );
|
2023-02-11 20:39:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete a row from the measurements grid.
|
|
|
|
*/
|
|
|
|
void DeleteMeasurement( int aRow );
|
|
|
|
|
2023-02-21 11:36:14 +00:00
|
|
|
/**
|
|
|
|
* Get/Set the format of a value in the measurements grid.
|
|
|
|
*/
|
|
|
|
SPICE_VALUE_FORMAT GetMeasureFormat( int aRow ) const;
|
|
|
|
void SetMeasureFormat( int aRow, const SPICE_VALUE_FORMAT& aFormat );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update a measurement in the measurements grid.
|
|
|
|
*/
|
|
|
|
void UpdateMeasurement( int aRow );
|
|
|
|
|
2016-08-11 12:42:17 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Return the currently opened plot panel (or NULL if there is none).
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
2021-07-09 19:35:47 +00:00
|
|
|
SIM_PLOT_PANEL* GetCurrentPlot() const;
|
2016-08-11 12:42:17 +00:00
|
|
|
|
2018-04-27 22:34:06 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Return the netlist exporter object used for simulations.
|
2018-04-27 22:34:06 +00:00
|
|
|
*/
|
2022-03-05 23:49:25 +00:00
|
|
|
const NGSPICE_CIRCUIT_MODEL* GetExporter() const;
|
2018-04-27 22:34:06 +00:00
|
|
|
|
2020-02-01 12:05:44 +00:00
|
|
|
/**
|
2023-01-01 23:37:24 +00:00
|
|
|
* Toggle dark-mode of the plot.
|
|
|
|
*/
|
|
|
|
void ToggleDarkModePlots();
|
|
|
|
|
2023-01-04 18:06:04 +00:00
|
|
|
void ShowChangedLanguage() override;
|
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
void ReCreateHToolbar();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load plot settings from a file.
|
|
|
|
*
|
|
|
|
* @param aPath is the file name.
|
|
|
|
* @return True if successful.
|
2020-02-01 12:05:44 +00:00
|
|
|
*/
|
2023-01-01 23:37:24 +00:00
|
|
|
bool LoadWorkbook( const wxString& aPath );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Save plot settings to a file.
|
|
|
|
*
|
|
|
|
* @param aPath is the file name.
|
|
|
|
* @return True if successful.
|
|
|
|
*/
|
|
|
|
bool SaveWorkbook( const wxString& aPath );
|
2020-02-01 12:05:44 +00:00
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
|
|
|
|
|
|
|
|
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
|
|
|
|
|
|
|
|
WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override;
|
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
SCH_EDIT_FRAME* GetSchematicFrame() const { return m_schematicFrame; }
|
|
|
|
|
|
|
|
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> GetCircuitModel() const { return m_circuitModel; }
|
|
|
|
|
|
|
|
std::shared_ptr<SPICE_SIMULATOR> GetSimulator() const { return m_simulator; }
|
|
|
|
|
|
|
|
wxString GetCurrentSimCommand() const
|
|
|
|
{
|
2023-02-12 14:55:00 +00:00
|
|
|
if( getCurrentPlotWindow() )
|
|
|
|
return getCurrentPlotWindow()->GetSimCommand();
|
2023-01-01 23:37:24 +00:00
|
|
|
else
|
2023-02-12 14:55:00 +00:00
|
|
|
return m_circuitModel->GetSchTextSimCommand();
|
2023-01-01 23:37:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int GetCurrentOptions() const
|
|
|
|
{
|
2023-02-12 14:55:00 +00:00
|
|
|
if( getCurrentPlotWindow() )
|
|
|
|
return getCurrentPlotWindow()->GetSimOptions();
|
2023-01-01 23:37:24 +00:00
|
|
|
else
|
2023-02-12 14:55:00 +00:00
|
|
|
return m_circuitModel->GetSimOptions();
|
2023-01-01 23:37:24 +00:00
|
|
|
}
|
|
|
|
|
2020-03-24 01:01:23 +00:00
|
|
|
// Simulator doesn't host a tool framework
|
|
|
|
wxWindow* GetToolCanvas() const override { return nullptr; }
|
|
|
|
|
2016-08-11 12:42:17 +00:00
|
|
|
private:
|
2023-01-01 23:37:24 +00:00
|
|
|
void setupTools();
|
|
|
|
void doReCreateMenuBar() override;
|
|
|
|
|
|
|
|
void setupUIConditions() override;
|
|
|
|
|
2021-05-04 22:35:04 +00:00
|
|
|
/**
|
|
|
|
* Load the currently active workbook stored in the project settings. If there is none,
|
|
|
|
* generate a filename for the currently active workbook and store it in the project settings.
|
|
|
|
*/
|
|
|
|
void initWorkbook();
|
|
|
|
|
2021-01-26 15:23:37 +00:00
|
|
|
/**
|
2021-05-09 23:32:49 +00:00
|
|
|
* Set the main window title bar text.
|
|
|
|
*/
|
|
|
|
void updateTitle();
|
|
|
|
|
2016-08-11 12:42:17 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Add a new plot to the current panel.
|
|
|
|
*
|
2016-08-11 12:42:17 +00:00
|
|
|
* @param aName is the device/net name.
|
|
|
|
* @param aType describes the type of plot.
|
|
|
|
* @param aParam is the parameter for the device/net (e.g. I, Id, V).
|
|
|
|
*/
|
2023-02-21 09:06:02 +00:00
|
|
|
void doAddPlot( const wxString& aName, SIM_TRACE_TYPE aType );
|
|
|
|
|
|
|
|
void addTrace( const wxString& aSignalName );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For user-defined traces we have a separate SPICE vector name.
|
|
|
|
*/
|
2023-02-22 09:53:52 +00:00
|
|
|
wxString getTraceName( const wxString& aSignalName );
|
2023-02-21 09:06:02 +00:00
|
|
|
wxString getTraceName( int aRow );
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Remove a plot with a specific title.
|
|
|
|
*
|
2023-01-29 16:01:03 +00:00
|
|
|
* @param aSignalName is the full plot title (e.g. I(Net-C1-Pad1)).
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
2023-01-29 16:01:03 +00:00
|
|
|
void removeTrace( const wxString& aSignalName );
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
/**
|
2023-01-29 16:01:03 +00:00
|
|
|
* Update a trace in a particular SIM_PLOT_PANEL. If the panel does not contain the given
|
|
|
|
* trace, then add it.
|
2021-01-26 15:23:37 +00:00
|
|
|
*
|
2021-09-07 21:18:22 +00:00
|
|
|
* @param aName is the device/net name.
|
2023-02-14 00:03:30 +00:00
|
|
|
* @param aTraceType describes the type of plot.
|
2021-09-07 21:18:22 +00:00
|
|
|
* @param aParam is the parameter for the device/net (e.g. I, Id, V).
|
|
|
|
* @param aPlotPanel is the panel that should receive the update.
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
2023-02-14 00:03:30 +00:00
|
|
|
void updateTrace( const wxString& aName, SIM_TRACE_TYPE aTraceType, SIM_PLOT_PANEL* aPlotPanel );
|
2023-02-12 14:55:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Rebuild the list of signals available from the netlist.
|
|
|
|
*
|
|
|
|
* Note: this is not the filtered list. See rebuildSignalsGrid() for that.
|
|
|
|
*/
|
|
|
|
void rebuildSignalsList();
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
/**
|
2023-01-29 16:01:03 +00:00
|
|
|
* Rebuild the filtered list of signals in the signals grid.
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
2023-01-29 16:01:03 +00:00
|
|
|
void rebuildSignalsGrid( wxString aFilter );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the values in the signals grid.
|
|
|
|
*/
|
|
|
|
void updateSignalsGrid();
|
2016-08-11 12:42:17 +00:00
|
|
|
|
2023-02-12 19:54:28 +00:00
|
|
|
/**
|
|
|
|
* Update the cursor values (in the grid) and graphics (in the plot window).
|
|
|
|
*/
|
|
|
|
void updateCursors();
|
|
|
|
|
2023-02-21 09:06:02 +00:00
|
|
|
/**
|
|
|
|
* Apply user-defined signals to the SPICE session.
|
|
|
|
*/
|
|
|
|
void applyUserDefinedSignals();
|
|
|
|
|
2016-08-11 12:42:17 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Apply component values specified using tuner sliders to the current netlist.
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
|
|
|
void applyTuners();
|
|
|
|
|
2021-07-09 19:35:47 +00:00
|
|
|
/**
|
|
|
|
* Return the currently opened plot panel (or NULL if there is none).
|
|
|
|
*/
|
|
|
|
SIM_PANEL_BASE* getCurrentPlotWindow() const
|
|
|
|
{
|
2023-02-12 14:55:00 +00:00
|
|
|
return dynamic_cast<SIM_PANEL_BASE*>( m_plotNotebook->GetCurrentPage() );
|
2021-07-09 19:35:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2016-08-11 12:42:17 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Return X axis for a given simulation type.
|
2016-08-11 12:42:17 +00:00
|
|
|
*/
|
2023-01-29 16:01:03 +00:00
|
|
|
SIM_TRACE_TYPE getXAxisType( SIM_TYPE aType ) const;
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
// Event handlers
|
|
|
|
void onPlotClose( wxAuiNotebookEvent& event ) override;
|
2021-05-11 23:27:34 +00:00
|
|
|
void onPlotClosed( wxAuiNotebookEvent& event ) override;
|
|
|
|
void onPlotChanged( wxAuiNotebookEvent& event ) override;
|
|
|
|
void onPlotDragged( wxAuiNotebookEvent& event ) override;
|
2016-08-11 12:42:17 +00:00
|
|
|
|
2023-01-29 16:01:03 +00:00
|
|
|
void OnFilterText( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnFilterMouseMoved( wxMouseEvent& aEvent ) override;
|
2023-01-19 12:44:47 +00:00
|
|
|
|
2023-01-29 16:01:03 +00:00
|
|
|
void onSignalsGridCellChanged( wxGridEvent& aEvent ) override;
|
|
|
|
void onCursorsGridCellChanged( wxGridEvent& aEvent ) override;
|
2023-02-11 20:39:50 +00:00
|
|
|
void onMeasurementsGridCellChanged( wxGridEvent& aEvent ) override;
|
2016-08-11 12:42:17 +00:00
|
|
|
|
2023-02-12 14:55:00 +00:00
|
|
|
void onNotebookModified( wxCommandEvent& event );
|
2021-07-11 18:31:50 +00:00
|
|
|
|
2021-05-09 23:32:49 +00:00
|
|
|
bool canCloseWindow( wxCloseEvent& aEvent ) override;
|
2020-08-24 02:01:14 +00:00
|
|
|
void doCloseWindow() override;
|
2016-08-11 12:42:17 +00:00
|
|
|
|
|
|
|
void onCursorUpdate( wxCommandEvent& aEvent );
|
|
|
|
void onSimUpdate( wxCommandEvent& aEvent );
|
|
|
|
void onSimReport( wxCommandEvent& aEvent );
|
|
|
|
void onSimStarted( wxCommandEvent& aEvent );
|
|
|
|
void onSimFinished( wxCommandEvent& aEvent );
|
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
void onExit( wxCommandEvent& event );
|
|
|
|
|
2016-12-02 14:34:23 +00:00
|
|
|
// adjust the sash dimension of splitter windows after reading
|
|
|
|
// the config settings
|
|
|
|
// must be called after the config settings are read, and once the
|
|
|
|
// frame is initialized (end of the Ctor)
|
|
|
|
void setSubWindowsSashSize();
|
|
|
|
|
2023-02-17 00:45:48 +00:00
|
|
|
public:
|
|
|
|
int m_SuppressGridEvents;
|
|
|
|
|
2023-01-01 23:37:24 +00:00
|
|
|
private:
|
|
|
|
SCH_EDIT_FRAME* m_schematicFrame;
|
|
|
|
std::shared_ptr<NGSPICE_CIRCUIT_MODEL> m_circuitModel;
|
|
|
|
std::shared_ptr<SPICE_SIMULATOR> m_simulator;
|
|
|
|
SIM_THREAD_REPORTER* m_reporter;
|
|
|
|
|
2023-01-29 16:01:03 +00:00
|
|
|
std::vector<wxString> m_signals;
|
2023-02-21 09:06:02 +00:00
|
|
|
std::vector<wxString> m_userDefinedSignals;
|
|
|
|
std::map<wxString, wxString> m_userDefinedSignalToSpiceVecName;
|
2023-01-01 23:37:24 +00:00
|
|
|
std::list<TUNER_SLIDER*> m_tuners;
|
|
|
|
|
2023-02-21 09:06:02 +00:00
|
|
|
///< SPICE expressions need quoted versions of the netnames since KiCad allows '-' and '/'
|
|
|
|
///< in netnames.
|
|
|
|
std::map<wxString, wxString> m_quotedNetnames;
|
|
|
|
|
|
|
|
|
2021-01-26 15:23:37 +00:00
|
|
|
///< Panel that was used as the most recent one for simulations
|
2023-01-01 23:37:24 +00:00
|
|
|
SIM_PANEL_BASE* m_lastSimPlot;
|
2016-08-29 09:39:54 +00:00
|
|
|
|
2023-02-11 20:39:50 +00:00
|
|
|
SPICE_VALUE_FORMAT m_cursorFormats[3][2];
|
|
|
|
|
2016-12-02 14:34:23 +00:00
|
|
|
// Variables for temporary storage:
|
2023-02-11 20:39:50 +00:00
|
|
|
int m_splitterLeftRightSashPosition;
|
|
|
|
int m_splitterPlotAndConsoleSashPosition;
|
|
|
|
int m_splitterSignalsSashPosition;
|
|
|
|
int m_splitterCursorsSashPosition;
|
|
|
|
int m_splitterTuneValuesSashPosition;
|
|
|
|
bool m_darkMode;
|
|
|
|
unsigned int m_plotNumber;
|
|
|
|
bool m_simFinished;
|
2023-02-12 14:55:00 +00:00
|
|
|
bool m_workbookModified;
|
2016-08-11 12:41:01 +00:00
|
|
|
};
|
|
|
|
|
2016-08-11 12:41:45 +00:00
|
|
|
// Commands
|
|
|
|
wxDECLARE_EVENT( EVT_SIM_UPDATE, wxCommandEvent );
|
2016-08-11 12:41:27 +00:00
|
|
|
wxDECLARE_EVENT( EVT_SIM_REPORT, wxCommandEvent );
|
2016-08-11 12:41:45 +00:00
|
|
|
|
|
|
|
// Notifications
|
2016-08-11 12:41:27 +00:00
|
|
|
wxDECLARE_EVENT( EVT_SIM_STARTED, wxCommandEvent );
|
|
|
|
wxDECLARE_EVENT( EVT_SIM_FINISHED, wxCommandEvent );
|
2016-08-11 12:41:07 +00:00
|
|
|
|
2016-08-11 12:41:01 +00:00
|
|
|
#endif // __sim_plot_frame__
|