KiCad PCB EDA Suite
|
The SIMULATOR_FRAME_UI holds the main user-interface for running simulations. More...
#include <simulator_frame_ui.h>
Public Member Functions | |
SIMULATOR_FRAME_UI (SIMULATOR_FRAME *aSimulatorFrame, SCH_EDIT_FRAME *aSchematicFrame) | |
~SIMULATOR_FRAME_UI () | |
SIM_TAB * | NewSimTab (const wxString &aSimCommand) |
Create a new simulation tab for a given simulation type. | |
std::vector< wxString > | SimPlotVectors () const |
std::vector< wxString > | Signals () const |
const std::map< int, wxString > & | UserDefinedSignals () |
void | SetUserDefinedSignals (const std::map< int, wxString > &aSignals) |
void | CreateNewCursor () |
Creates a column at the end of m_signalsGrid named "Cursor n" ( n = m_customCursorsCnt ), increases m_customCursorsCnt, emplaces a vector to m_cursorFormatsDyn, and update widgets. | |
void | DeleteCursor () |
Deletes last m_signalsGrid "Cursor n" column, removes vector's m_cursorFormatsDyn last entry, reduces m_customCursorsCnt by one, and update widgets. | |
void | AddTrace (const wxString &aName, SIM_TRACE_TYPE aType) |
Add a new trace to the current plot. | |
SPICE_VALUE_FORMAT | GetCursorFormat (int aCursorId, int aValueCol) const |
Get/Set the number of significant digits and the range for formatting a cursor value. | |
void | SetCursorFormat (int aCursorId, int aValueCol, const SPICE_VALUE_FORMAT &aFormat) |
void | AddTuner (const SCH_SHEET_PATH &aSheetPath, SCH_SYMBOL *aSymbol) |
Add a tuner for a symbol. | |
void | RemoveTuner (TUNER_SLIDER *aTuner) |
Remove an existing tuner. | |
void | UpdateTunerValue (const SCH_SHEET_PATH &aSheetPath, const KIID &aSymbol, const wxString &aRef, const wxString &aValue) |
Safely update a field of the associated symbol without dereferencing the symbol. | |
void | AddMeasurement (const wxString &aCmd) |
Add a measurement to the measurements grid. | |
void | DeleteMeasurement (int aRow) |
Delete a row from the measurements grid. | |
SPICE_VALUE_FORMAT | GetMeasureFormat (int aRow) const |
Get/Set the format of a value in the measurements grid. | |
void | SetMeasureFormat (int aRow, const SPICE_VALUE_FORMAT &aFormat) |
void | UpdateMeasurement (int aRow) |
Update a measurement in the measurements grid. | |
void | DoFourier (const wxString &aSignal, const wxString &aFundamental) |
const SPICE_CIRCUIT_MODEL * | GetExporter () const |
Return the netlist exporter object used for simulations. | |
bool | IsSimConsoleShown () |
void | ToggleSimConsole () |
bool | IsSimSidePanelShown () |
void | ToggleSimSidePanel () |
bool | DarkModePlots () const |
void | ToggleDarkModePlots () |
void | ShowChangedLanguage () |
void | InitWorkbook () |
Load the currently active workbook stored in the project settings. | |
bool | LoadWorkbook (const wxString &aPath) |
Load plot, signal, cursor, measurement, etc. | |
bool | SaveWorkbook (const wxString &aPath) |
Save plot, signal, cursor, measurement, etc. | |
void | LoadSettings (EESCHEMA_SETTINGS *aCfg) |
void | SaveSettings (EESCHEMA_SETTINGS *aCfg) |
void | ApplyPreferences (const SIM_PREFERENCES &aPrefs) |
Called when settings are changed via the common Preferences dialog. | |
void | SetSubWindowsSashSize () |
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) | |
SIM_TAB * | GetCurrentSimTab () const |
Return the currently opened plot panel (or NULL if there is none). | |
SIM_TAB * | GetSimTab (SIM_TYPE aType) const |
int | GetSimTabIndex (SIM_TAB *aPlot) const |
void | OnPlotSettingsChanged () |
void | OnSimUpdate () |
void | OnSimReport (const wxString &aMsg) |
void | OnSimRefresh (bool aFinal) |
void | OnModify () |
void | m_splitterLeftRightOnIdle (wxIdleEvent &) |
void | m_splitterPlotAndConsoleOnIdle (wxIdleEvent &) |
void | m_splitterSignalsOnIdle (wxIdleEvent &) |
void | m_splitterCursorsOnIdle (wxIdleEvent &) |
void | m_splitterMeasurementsOnIdle (wxIdleEvent &) |
Public Attributes | |
int | m_SuppressGridEvents |
Protected Attributes | |
wxSplitterWindow * | m_splitterLeftRight |
wxPanel * | m_panelLeft |
wxBoxSizer * | m_sizer11 |
wxSplitterWindow * | m_splitterPlotAndConsole |
wxPanel * | m_plotPanel |
wxBoxSizer * | m_sizerPlot |
wxAuiNotebook * | m_plotNotebook |
wxPanel * | m_panelConsole |
wxBoxSizer * | m_sizerConsole |
wxTextCtrl * | m_simConsole |
wxPanel * | m_sidePanel |
wxBoxSizer * | m_sideSizer |
wxSplitterWindow * | m_splitterSignals |
wxPanel * | m_panelSignals |
wxSearchCtrl * | m_filter |
WX_GRID * | m_signalsGrid |
wxPanel * | m_panelCMT |
wxSplitterWindow * | m_splitterCursors |
wxPanel * | m_panelCursors |
WX_GRID * | m_cursorsGrid |
wxPanel * | m_panelMT |
wxSplitterWindow * | m_splitterMeasurements |
wxPanel * | m_panelMeasurements |
WX_GRID * | m_measurementsGrid |
wxPanel * | m_panelTuners |
wxBoxSizer * | m_sizerTuners |
Private Member Functions | |
wxString | vectorNameFromSignalName (SIM_PLOT_TAB *aPlotTab, const wxString &aSignalName, int *aTraceType) |
Get the simulator output vector name for a given signal name and type. | |
void | updateTrace (const wxString &aVectorName, int aTraceType, SIM_PLOT_TAB *aPlotTab, std::vector< double > *aDataX=nullptr, bool aClearData=false) |
Update a trace in a particular SIM_PLOT_TAB. | |
void | TogglePanel (wxPanel *aPanel, wxSplitterWindow *aSplitterWindow, int &aSashPosition) |
A common toggler for the two main wxSplitterWindow s. | |
void | CustomCursorsInit () |
Init handler for custom cursors. | |
void | rebuildSignalsList () |
Rebuild the list of signals available from the netlist. | |
void | rebuildSignalsGrid (wxString aFilter) |
Rebuild the filtered list of signals in the signals grid. | |
void | updateSignalsGrid () |
Update the values in the signals grid. | |
void | updatePlotCursors () |
Update the cursor values (in the grid) and graphics (in the plot window). | |
template<typename T , typename U , typename R > | |
void | signalsGridCursorUpdate (T t, U u, R r) |
Updates m_signalsGrid cursor widget, column rendering and attributes. | |
void | applyUserDefinedSignals () |
Apply user-defined signals to the SPICE session. | |
void | rebuildMeasurementsGrid () |
Rebuild the measurements grid for the current plot. | |
void | updateMeasurementsFromGrid () |
void | applyTuners () |
Apply component values specified using tuner sliders to the current netlist. | |
SIM_TRACE_TYPE | getXAxisType (SIM_TYPE aType) const |
Return X axis for a given simulation type. | |
wxString | getNoiseSource () const |
void | parseTraceParams (SIM_PLOT_TAB *aPlotTab, TRACE *aTrace, const wxString &aSignalName, const wxString &aParams) |
std::shared_ptr< SPICE_SIMULATOR > | simulator () const |
std::shared_ptr< SPICE_CIRCUIT_MODEL > | circuitModel () const |
void | onPlotClose (wxAuiNotebookEvent &event) override |
void | onPlotClosed (wxAuiNotebookEvent &event) override |
void | onPlotChanging (wxAuiNotebookEvent &event) override |
void | onPlotChanged (wxAuiNotebookEvent &event) override |
void | onPlotDragged (wxAuiNotebookEvent &event) override |
void | OnFilterText (wxCommandEvent &aEvent) override |
void | OnFilterMouseMoved (wxMouseEvent &aEvent) override |
void | onSignalsGridCellChanged (wxGridEvent &aEvent) override |
void | onCursorsGridCellChanged (wxGridEvent &aEvent) override |
void | onMeasurementsGridCellChanged (wxGridEvent &aEvent) override |
void | OnUpdateUI (wxUpdateUIEvent &event) override |
bool | loadLegacyWorkbook (const wxString &aPath) |
bool | loadJsonWorkbook (const wxString &aPath) |
void | SaveCursorToWorkbook (nlohmann::json &aTraceJs, TRACE *aTrace, int aCursorId) |
void | onPlotCursorUpdate (wxCommandEvent &aEvent) |
Private Attributes | |
SIMULATOR_FRAME * | m_simulatorFrame |
SCH_EDIT_FRAME * | m_schematicFrame |
std::vector< wxString > | m_signals |
std::map< int, wxString > | m_userDefinedSignals |
std::list< TUNER_SLIDER * > | m_tuners |
SPICE expressions need quoted versions of the netnames since KiCad allows '-' and '/' in netnames. | |
std::vector< wxString > | m_netnames |
SPICE_VALUE_FORMAT | m_cursorFormats [3][2] |
std::vector< std::vector< SPICE_VALUE_FORMAT > > | m_cursorFormatsDyn |
int | m_splitterLeftRightSashPosition |
int | m_splitterPlotAndConsoleSashPosition |
int | m_splitterSignalsSashPosition |
int | m_splitterCursorsSashPosition |
int | m_splitterTuneValuesSashPosition |
bool | m_darkMode |
unsigned int | m_plotNumber |
wxTimer | m_refreshTimer |
SIM_PREFERENCES | m_preferences |
int | m_customCursorsCnt |
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.).
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.
TRACEs are identified by a signal (V(OUT), I(R2), etc.) and a type (SPT_VOLTAGE, SPT_AC_PHASE, etc.).
The simulator outputs simple signals in a vector of the same name. Complex signals (such as V(OUT) / V(IN)) are stored in vectors of the format "user%d".
Definition at line 70 of file simulator_frame_ui.h.
SIMULATOR_FRAME_UI::SIMULATOR_FRAME_UI | ( | SIMULATOR_FRAME * | aSimulatorFrame, |
SCH_EDIT_FRAME * | aSchematicFrame | ||
) |
Definition at line 544 of file simulator_frame_ui.cpp.
References _, COL_CURSOR_NAME, COL_CURSOR_SIGNAL, COL_CURSOR_Y, COL_MEASUREMENT_VALUE, COL_SIGNAL_NAME, CustomCursorsInit(), SCH_BASE_FRAME::eeconfig(), SIM_PLOT_COLORS::FillDefaultColorList(), SIMULATOR_FRAME::GetSimulator(), KIUI::GetStatusFont(), LoadSettings(), SIMULATOR_FRAME_UI_BASE::m_cursorsGrid, m_darkMode, SIMULATOR_FRAME_UI_BASE::m_filter, SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_refreshTimer, m_schematicFrame, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, m_simulatorFrame, onPlotCursorUpdate(), OnSimRefresh(), and REFRESH_INTERVAL.
SIMULATOR_FRAME_UI::~SIMULATOR_FRAME_UI | ( | ) |
Definition at line 611 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_cursorsGrid, SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, and SIMULATOR_FRAME_UI_BASE::m_signalsGrid.
void SIMULATOR_FRAME_UI::AddMeasurement | ( | const wxString & | aCmd | ) |
Add a measurement to the measurements grid.
Definition at line 1699 of file simulator_frame_ui.cpp.
References COL_MEASUREMENT, GetCurrentSimTab(), SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, OnModify(), UpdateMeasurement(), and updateMeasurementsFromGrid().
Referenced by SIGNALS_GRID_TRICKS::doPopupSelection().
void SIMULATOR_FRAME_UI::AddTrace | ( | const wxString & | aName, |
SIM_TRACE_TYPE | aType | ||
) |
Add a new trace to the current plot.
aName | is the device/net name. |
aType | describes the type of trace. |
Definition at line 1757 of file simulator_frame_ui.cpp.
References _, SPICE_CIRCUIT_MODEL::CommandToSimType(), GetCurrentSimTab(), SIM_TAB::IsPlottable(), SIMULATOR_FRAME_UI_BASE::m_simConsole, OnModify(), SPT_AC_GAIN, SPT_AC_PHASE, ST_AC, ST_SP, ST_UNKNOWN, updateSignalsGrid(), and updateTrace().
Referenced by SIMULATOR_FRAME::AddCurrentTrace(), and SIMULATOR_FRAME::AddVoltageTrace().
void SIMULATOR_FRAME_UI::AddTuner | ( | const SCH_SHEET_PATH & | aSheetPath, |
SCH_SYMBOL * | aSymbol | ||
) |
Add a tuner for a symbol.
Definition at line 1610 of file simulator_frame_ui.cpp.
References _, DisplayErrorMessage(), GetCurrentSimTab(), GetExporter(), SCH_SYMBOL::GetRef(), SIMULATOR_FRAME_UI_BASE::m_panelTuners, SIMULATOR_FRAME_UI_BASE::m_sizerTuners, m_tuners, OnModify(), and KI_PARAM_ERROR::What().
Referenced by SIMULATOR_FRAME::AddTuner().
void SIMULATOR_FRAME_UI::ApplyPreferences | ( | const SIM_PREFERENCES & | aPrefs | ) |
Called when settings are changed via the common Preferences dialog.
Definition at line 784 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_plotNotebook, and m_preferences.
Referenced by SIMULATOR_FRAME::CommonSettingsChanged().
|
private |
Apply component values specified using tuner sliders to the current netlist.
Definition at line 2145 of file simulator_frame_ui.cpp.
References _, DisplayErrorMessage(), NETLIST_EXPORTER_SPICE::FindItem(), GetExporter(), WX_STRING_REPORTER::GetMessages(), SIM_MODEL::GetTunerParam(), WX_STRING_REPORTER::HasMessage(), m_tuners, SPICE_ITEM::model, WX_STRING_REPORTER::Report(), SCH_SHEET_PATH::ResolveItem(), simulator(), SIM_MODEL::SpiceGenerator(), and SPICE_GENERATOR::TunerCommand().
Referenced by OnSimUpdate().
|
private |
Apply user-defined signals to the SPICE session.
Definition at line 2088 of file simulator_frame_ui.cpp.
References m_netnames, m_userDefinedSignals, and simulator().
Referenced by OnSimRefresh(), and SetUserDefinedSignals().
|
private |
Definition at line 2876 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME::GetCircuitModel(), and m_simulatorFrame.
Referenced by GetExporter(), getNoiseSource(), InitWorkbook(), OnSimRefresh(), rebuildSignalsList(), and updateTrace().
void SIMULATOR_FRAME_UI::CreateNewCursor | ( | ) |
Creates a column at the end of m_signalsGrid named "Cursor n" ( n = m_customCursorsCnt ), increases m_customCursorsCnt, emplaces a vector to m_cursorFormatsDyn, and update widgets.
Definition at line 664 of file simulator_frame_ui.cpp.
References _, COL_CURSOR_2, m_cursorFormatsDyn, m_customCursorsCnt, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, OnModify(), updatePlotCursors(), and updateSignalsGrid().
Referenced by SIGNALS_GRID_TRICKS::doPopupSelection(), and loadJsonWorkbook().
|
private |
Init handler for custom cursors.
Called once in class's body
Definition at line 620 of file simulator_frame_ui.cpp.
References _, m_cursorFormats, m_cursorFormatsDyn, m_customCursorsCnt, and SIMULATOR_FRAME_UI_BASE::m_signalsGrid.
Referenced by SIMULATOR_FRAME_UI().
|
inline |
Definition at line 184 of file simulator_frame_ui.h.
References m_darkMode.
Referenced by SIMULATOR_FRAME::setupUIConditions().
void SIMULATOR_FRAME_UI::DeleteCursor | ( | ) |
Deletes last m_signalsGrid "Cursor n" column, removes vector's m_cursorFormatsDyn last entry, reduces m_customCursorsCnt by one, and update widgets.
Definition at line 689 of file simulator_frame_ui.cpp.
References COL_CURSOR_2, m_cursorFormatsDyn, m_customCursorsCnt, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, OnModify(), onSignalsGridCellChanged(), updatePlotCursors(), and updateSignalsGrid().
Referenced by SIGNALS_GRID_TRICKS::doPopupSelection().
void SIMULATOR_FRAME_UI::DeleteMeasurement | ( | int | aRow | ) |
Delete a row from the measurements grid.
Definition at line 1418 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_measurementsGrid.
Referenced by MEASUREMENTS_GRID_TRICKS::doPopupSelection().
void SIMULATOR_FRAME_UI::DoFourier | ( | const wxString & | aSignal, |
const wxString & | aFundamental | ||
) |
Definition at line 1741 of file simulator_frame_ui.cpp.
References simulator().
Referenced by SIGNALS_GRID_TRICKS::doPopupSelection().
|
inline |
Return the currently opened plot panel (or NULL if there is none).
Definition at line 225 of file simulator_frame_ui.h.
References SIMULATOR_FRAME_UI_BASE::m_plotNotebook.
Referenced by AddMeasurement(), AddTrace(), AddTuner(), SIMULATOR_FRAME::EditAnalysis(), SIMULATOR_FRAME::GetCurrentOptions(), SIMULATOR_FRAME::GetCurrentSimCommand(), SIMULATOR_FRAME::GetCurrentSimTab(), getNoiseSource(), loadJsonWorkbook(), loadLegacyWorkbook(), onCursorsGridCellChanged(), onMeasurementsGridCellChanged(), onPlotChanged(), onPlotClosed(), onSignalsGridCellChanged(), OnSimRefresh(), OnSimUpdate(), OnUpdateUI(), rebuildMeasurementsGrid(), rebuildSignalsGrid(), SIGNALS_GRID_TRICKS::showPopupMenu(), signalsGridCursorUpdate(), SIMULATOR_FRAME::StartSimulation(), UpdateMeasurement(), updateMeasurementsFromGrid(), and updatePlotCursors().
|
inline |
Get/Set the number of significant digits and the range for formatting a cursor value.
aValueCol | 0 indicates the X value column; 1 the Y value. |
Definition at line 117 of file simulator_frame_ui.h.
References m_cursorFormatsDyn.
Referenced by CURSORS_GRID_TRICKS::doPopupSelection().
const SPICE_CIRCUIT_MODEL * SIMULATOR_FRAME_UI::GetExporter | ( | ) | const |
Return the netlist exporter object used for simulations.
Definition at line 1751 of file simulator_frame_ui.cpp.
References circuitModel().
Referenced by AddTuner(), applyTuners(), and TUNER_SLIDER::TUNER_SLIDER().
SPICE_VALUE_FORMAT SIMULATOR_FRAME_UI::GetMeasureFormat | ( | int | aRow | ) | const |
Get/Set the format of a value in the measurements grid.
Definition at line 1404 of file simulator_frame_ui.cpp.
References COL_MEASUREMENT_FORMAT, SPICE_VALUE_FORMAT::FromString(), and SIMULATOR_FRAME_UI_BASE::m_measurementsGrid.
Referenced by MEASUREMENTS_GRID_TRICKS::doPopupSelection(), and UpdateMeasurement().
|
private |
Definition at line 2677 of file simulator_frame_ui.cpp.
References circuitModel(), GetCurrentSimTab(), and scale.
Referenced by vectorNameFromSignalName().
Definition at line 230 of file simulator_frame_ui.h.
References SIM_TAB::GetSimType(), and SIMULATOR_FRAME_UI_BASE::m_plotNotebook.
Referenced by SIMULATOR_FRAME::StartSimulation().
|
inline |
Definition at line 243 of file simulator_frame_ui.h.
References SIMULATOR_FRAME_UI_BASE::m_plotNotebook.
Referenced by SIMULATOR_FRAME::StartSimulation().
|
private |
Return X axis for a given simulation type.
Definition at line 2658 of file simulator_frame_ui.cpp.
References SPT_LIN_FREQUENCY, SPT_SWEEP, SPT_TIME, SPT_UNKNOWN, ST_AC, ST_DC, ST_FFT, ST_NOISE, ST_SP, and ST_TRAN.
Referenced by updateTrace().
void SIMULATOR_FRAME_UI::InitWorkbook | ( | ) |
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.
Definition at line 796 of file simulator_frame_ui.cpp.
References circuitModel(), PROJECT::GetProjectPath(), SIMULATOR_FRAME::LoadSimulator(), LoadWorkbook(), SIMULATOR_FRAME_UI_BASE::m_filter, m_schematicFrame, m_simulatorFrame, NewSimTab(), NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS, KIWAY_HOLDER::Prj(), rebuildSignalsGrid(), rebuildSignalsList(), SIM_TAB::SetSimOptions(), and simulator().
bool SIMULATOR_FRAME_UI::IsSimConsoleShown | ( | ) |
Definition at line 2717 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_panelConsole.
Referenced by SIMULATOR_FRAME::setupUIConditions().
bool SIMULATOR_FRAME_UI::IsSimSidePanelShown | ( | ) |
Definition at line 2729 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_sidePanel.
Referenced by SIMULATOR_FRAME::setupUIConditions().
|
private |
Definition at line 2225 of file simulator_frame_ui.cpp.
References mpWindow::AddLayer(), color, CreateNewCursor(), cursor, SIM_PLOT_TAB::EnsureThirdYAxisExists(), GetCurrentSimTab(), SIM_PLOT_TAB::GetPlotWin(), SIMULATOR_FRAME::LoadSimulator(), mpWindow::LockY(), m_cursorFormatsDyn, m_customCursorsCnt, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_simulatorFrame, m_userDefinedSignals, SIM_PLOT_TAB::Measurements(), NewSimTab(), NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS, NETLIST_EXPORTER_SPICE::OPTION_ADJUST_PASSIVE_VALS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_EVENTS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES, SIM_PLOT_TAB::SetDottedSecondary(), SIM_PLOT_TAB::SetLegendPosition(), mpWindow::SetMargins(), SIM_TAB::SetSimOptions(), TRACE::SetTraceColour(), SIM_PLOT_TAB::SetY1Scale(), SIM_PLOT_TAB::SetY2Scale(), SIM_PLOT_TAB::SetY3Scale(), SIM_PLOT_TAB::ShowGrid(), SIM_PLOT_TAB::ShowLegend(), traceSettings, and vectorNameFromSignalName().
Referenced by LoadWorkbook().
|
private |
Definition at line 112 of file legacy_workbook.cpp.
References _, EXPECTING, GetCurrentSimTab(), SIMULATOR_FRAME::LoadSimulator(), SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_simulatorFrame, m_userDefinedSignals, measurement, SIM_PLOT_TAB::Measurements(), name, NewSimTab(), NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS, NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES, parseTraceParams(), SIM_TAB::SetLastSchTextSimCommand(), SIM_TAB::SetSimOptions(), SPT_UNKNOWN, UnescapeString(), and vectorNameFromSignalName().
Referenced by LoadWorkbook().
void SIMULATOR_FRAME_UI::LoadSettings | ( | EESCHEMA_SETTINGS * | aCfg | ) |
Definition at line 755 of file simulator_frame_ui.cpp.
References EESCHEMA_SETTINGS::SIMULATOR::VIEW::cursors_panel_height, m_darkMode, m_preferences, EESCHEMA_SETTINGS::m_Simulator, m_splitterCursorsSashPosition, m_splitterLeftRightSashPosition, m_splitterPlotAndConsoleSashPosition, m_splitterSignalsSashPosition, m_splitterTuneValuesSashPosition, EESCHEMA_SETTINGS::SIMULATOR::VIEW::measurements_panel_height, EESCHEMA_SETTINGS::SIMULATOR::VIEW::plot_panel_height, EESCHEMA_SETTINGS::SIMULATOR::VIEW::plot_panel_width, EESCHEMA_SETTINGS::SIMULATOR::preferences, EESCHEMA_SETTINGS::SIMULATOR::VIEW::signal_panel_height, EESCHEMA_SETTINGS::SIMULATOR::view, and EESCHEMA_SETTINGS::SIMULATOR::VIEW::white_background.
Referenced by SIMULATOR_FRAME::LoadSettings(), and SIMULATOR_FRAME_UI().
bool SIMULATOR_FRAME_UI::LoadWorkbook | ( | const wxString & | aPath | ) |
Load plot, signal, cursor, measurement, etc.
settings from a file.
Definition at line 2181 of file simulator_frame_ui.cpp.
References dummy, PROJECT::GetProjectPath(), loadJsonWorkbook(), loadLegacyWorkbook(), SIMULATOR_FRAME_UI_BASE::m_filter, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_schematicFrame, m_userDefinedSignals, KIWAY_HOLDER::Prj(), rebuildMeasurementsGrid(), rebuildSignalsGrid(), rebuildSignalsList(), simulator(), updatePlotCursors(), and updateSignalsGrid().
Referenced by InitWorkbook(), and SIMULATOR_FRAME::LoadWorkbook().
|
inlineinherited |
Definition at line 103 of file simulator_frame_ui_base.h.
References SIMULATOR_FRAME_UI_BASE::m_splitterCursors, and SIMULATOR_FRAME_UI_BASE::m_splitterCursorsOnIdle().
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterCursorsOnIdle(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
inlineinherited |
Definition at line 85 of file simulator_frame_ui_base.h.
References SIMULATOR_FRAME_UI_BASE::m_splitterLeftRight, and SIMULATOR_FRAME_UI_BASE::m_splitterLeftRightOnIdle().
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterLeftRightOnIdle(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
inlineinherited |
Definition at line 109 of file simulator_frame_ui_base.h.
References SIMULATOR_FRAME_UI_BASE::m_splitterMeasurements, and SIMULATOR_FRAME_UI_BASE::m_splitterMeasurementsOnIdle().
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterMeasurementsOnIdle(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
inlineinherited |
Definition at line 91 of file simulator_frame_ui_base.h.
References SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsole, and SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsoleOnIdle().
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsoleOnIdle(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
inlineinherited |
Definition at line 97 of file simulator_frame_ui_base.h.
References SIMULATOR_FRAME_UI_BASE::m_splitterSignals, and SIMULATOR_FRAME_UI_BASE::m_splitterSignalsOnIdle().
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterSignalsOnIdle(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
SIM_TAB * SIMULATOR_FRAME_UI::NewSimTab | ( | const wxString & | aSimCommand | ) |
Create a new simulation tab for a given simulation type.
aSimCommand | is requested simulation command. |
Definition at line 1136 of file simulator_frame_ui.cpp.
References _, SIM_PLOT_TAB::ApplyPreferences(), SPICE_CIRCUIT_MODEL::CommandToSimType(), SIM_TAB::IsPlottable(), SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_plotNumber, m_preferences, and simulator().
Referenced by InitWorkbook(), loadJsonWorkbook(), loadLegacyWorkbook(), and SIMULATOR_FRAME::NewSimTab().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 1333 of file simulator_frame_ui.cpp.
References _, COL_CURSOR_NAME, COL_CURSOR_X, cursor, CURSOR::GetCoords(), GetCurrentSimTab(), SIM_PLOT_TAB::GetTraces(), SIMULATOR_FRAME_UI_BASE::m_cursorsGrid, m_customCursorsCnt, m_SuppressGridEvents, name, OnModify(), CURSOR::SetCoordX(), text, SPICE_VALUE::ToDouble(), and updatePlotCursors().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 1167 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_filter.
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 1161 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_filter, and rebuildSignalsGrid().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 1425 of file simulator_frame_ui.cpp.
References COL_MEASUREMENT, GetCurrentSimTab(), SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, OnModify(), UpdateMeasurement(), and updateMeasurementsFromGrid().
void SIMULATOR_FRAME_UI::OnModify | ( | ) |
Definition at line 3324 of file simulator_frame_ui.cpp.
References m_simulatorFrame, and SIMULATOR_FRAME::OnModify().
Referenced by AddMeasurement(), AddTrace(), AddTuner(), CreateNewCursor(), DeleteCursor(), MEASUREMENTS_GRID_TRICKS::doPopupSelection(), onCursorsGridCellChanged(), onMeasurementsGridCellChanged(), onPlotClose(), onPlotCursorUpdate(), onSignalsGridCellChanged(), OnUpdateUI(), RemoveTuner(), and SetUserDefinedSignals().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 2831 of file simulator_frame_ui.cpp.
References GetCurrentSimTab(), OnPlotSettingsChanged(), and simulator().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 2810 of file simulator_frame_ui.cpp.
References WX_GRID::ClearRows(), and SIMULATOR_FRAME_UI_BASE::m_measurementsGrid.
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 2763 of file simulator_frame_ui.cpp.
References OnModify().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 2769 of file simulator_frame_ui.cpp.
References SCHEMATIC::ClearOperatingPoints(), SCH_BASE_FRAME::GetCanvas(), GetCurrentSimTab(), SIM_TAB::GetSimType(), SIMULATOR_FRAME_UI_BASE::m_filter, m_schematicFrame, rebuildSignalsGrid(), rebuildSignalsList(), EDA_DRAW_PANEL_GAL::Refresh(), SCH_EDIT_FRAME::RefreshOperatingPointDisplay(), SCH_EDIT_FRAME::Schematic(), ST_OP, and updatePlotCursors().
|
private |
Definition at line 3077 of file simulator_frame_ui.cpp.
References OnModify(), and updatePlotCursors().
Referenced by SetCursorFormat(), and SIMULATOR_FRAME_UI().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 2865 of file simulator_frame_ui.cpp.
void SIMULATOR_FRAME_UI::OnPlotSettingsChanged | ( | ) |
Definition at line 2818 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_filter, SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, rebuildMeasurementsGrid(), rebuildSignalsGrid(), rebuildSignalsList(), UpdateMeasurement(), and updatePlotCursors().
Referenced by SIMULATOR_FRAME::EditAnalysis(), onPlotChanged(), and SIMULATOR_FRAME::StartSimulation().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 1248 of file simulator_frame_ui.cpp.
References COL_CURSOR_1, COL_CURSOR_2, COL_SIGNAL_COLOR, COL_SIGNAL_NAME, COL_SIGNAL_SHOW, color, SIM_PLOT_TAB::DeleteTrace(), SIM_PLOT_TAB::DisableCursor(), SIM_PLOT_TAB::EnableCursor(), GetCurrentSimTab(), SIM_PLOT_TAB::GetPlotWin(), SIM_PLOT_TAB::GetTrace(), SIM_PLOT_TAB::GetTraces(), TRACE::HasCursor(), m_cursorFormats, m_cursorFormatsDyn, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, m_SuppressGridEvents, name, OnModify(), TRACE::SetTraceColour(), SPT_UNKNOWN, text, mpWindow::UpdateAll(), SIM_PLOT_TAB::UpdatePlotColors(), updatePlotCursors(), updateSignalsGrid(), updateTrace(), SIM_PLOT_TAB::UpdateTraceStyle(), and vectorNameFromSignalName().
Referenced by DeleteCursor().
void SIMULATOR_FRAME_UI::OnSimRefresh | ( | bool | aFinal | ) |
Definition at line 3132 of file simulator_frame_ui.cpp.
References _, applyUserDefinedSignals(), circuitModel(), SIM_PLOT_TAB::DeleteTrace(), mpWindow::Fit(), GetCurrentSimTab(), SIM_PLOT_TAB::GetPlotWin(), SIM_TAB::GetSimType(), SIM_PLOT_TAB::GetTrace(), SIM_PLOT_TAB::GetTraces(), info, SIM_TAB::IsPlottable(), SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, m_refreshTimer, m_schematicFrame, m_signals, SIMULATOR_FRAME_UI_BASE::m_simConsole, m_userDefinedSignals, name, SIM_PLOT_TAB::ResetScales(), SCH_EDIT_FRAME::Schematic(), SCHEMATIC::SetOperatingPoint(), SIM_TAB::SetSpicePlotName(), simulator(), SPT_AC_GAIN, SPT_AC_PHASE, SPT_CURRENT, SPT_POWER, SPT_SP_AMP, SPT_UNKNOWN, SPT_VOLTAGE, ST_AC, ST_NOISE, ST_OP, ST_PZ, ST_SP, SPICE_VALUE::ToSpiceString(), mpWindow::UpdateAll(), UpdateMeasurement(), updatePlotCursors(), updateSignalsGrid(), updateTrace(), and vectorNameFromSignalName().
Referenced by SIMULATOR_FRAME::onSimFinished(), SIMULATOR_FRAME_UI(), and SIMULATOR_FRAME::StartSimulation().
void SIMULATOR_FRAME_UI::OnSimReport | ( | const wxString & | aMsg | ) |
Definition at line 3098 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_simConsole.
Referenced by SIMULATOR_FRAME::onSimReport().
void SIMULATOR_FRAME_UI::OnSimUpdate | ( | ) |
Definition at line 3084 of file simulator_frame_ui.cpp.
References applyTuners(), GetCurrentSimTab(), m_refreshTimer, SIMULATOR_FRAME_UI_BASE::m_simConsole, and REFRESH_INTERVAL.
Referenced by SIMULATOR_FRAME::onUpdateSim(), and SIMULATOR_FRAME::StartSimulation().
|
overrideprivatevirtual |
Reimplemented from SIMULATOR_FRAME_UI_BASE.
Definition at line 1471 of file simulator_frame_ui.cpp.
References GetCurrentSimTab(), and OnModify().
|
private |
Definition at line 38 of file legacy_workbook.cpp.
References mpWindow::AddLayer(), color, cursor, SPICE_VALUE_FORMAT::FromString(), SIM_PLOT_TAB::GetPlotWin(), m_cursorFormats, TRACE::SetCursor(), SIM_PLOT_TAB::SetDottedSecondary(), TRACE::SetTraceColour(), SIM_PLOT_TAB::ShowGrid(), and SIM_PLOT_TAB::UpdateTraceStyle().
Referenced by loadLegacyWorkbook().
|
private |
Rebuild the measurements grid for the current plot.
Definition at line 2842 of file simulator_frame_ui.cpp.
References WX_GRID::ClearRows(), COL_MEASUREMENT, COL_MEASUREMENT_FORMAT, GetCurrentSimTab(), SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, measurement, ST_AC, ST_DC, ST_SP, and ST_TRAN.
Referenced by LoadWorkbook(), and OnPlotSettingsChanged().
|
private |
Rebuild the filtered list of signals in the signals grid.
Definition at line 857 of file simulator_frame_ui.cpp.
References _, WX_GRID::ClearRows(), COL_CURSOR_1, COL_CURSOR_2, COL_SIGNAL_COLOR, COL_SIGNAL_NAME, COL_SIGNAL_SHOW, color, CTX_SIGNAL, EDA_COMBINED_MATCHER::Find(), GetCurrentSimTab(), TRACE::GetCursor(), mpLayer::GetPen(), SIM_TAB::GetSimCommand(), SIM_TAB::GetSimType(), SIM_PLOT_TAB::GetTrace(), m_customCursorsCnt, m_signals, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, m_userDefinedSignals, sortSignals(), SPT_UNKNOWN, ST_AC, ST_FFT, ST_SP, and vectorNameFromSignalName().
Referenced by InitWorkbook(), LoadWorkbook(), OnFilterText(), onPlotClosed(), OnPlotSettingsChanged(), and SetUserDefinedSignals().
|
private |
Rebuild the list of signals available from the netlist.
Note: this is not the filtered list. See rebuildSignalsGrid() for that.
Definition at line 1004 of file simulator_frame_ui.cpp.
References _, circuitModel(), NETLIST_EXPORTER_SPICE::ConvertToSpiceMarkup(), SIMULATOR_FRAME::GetCurrentOptions(), SIMULATOR_FRAME::GetCurrentSimType(), m_netnames, m_signals, m_simulatorFrame, name, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES, ST_AC, ST_DC, ST_FFT, ST_NOISE, ST_SP, ST_TRAN, ST_UNKNOWN, SIM_VALUE::ToSpice(), and UnescapeString().
Referenced by InitWorkbook(), LoadWorkbook(), onPlotClosed(), OnPlotSettingsChanged(), and SetUserDefinedSignals().
void SIMULATOR_FRAME_UI::RemoveTuner | ( | TUNER_SLIDER * | aTuner | ) |
Remove an existing tuner.
Definition at line 1690 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_panelTuners, m_tuners, and OnModify().
Referenced by TUNER_SLIDER::onClose().
|
private |
Definition at line 2458 of file simulator_frame_ui.cpp.
References cursor, TRACE::GetCursor(), and m_cursorFormatsDyn.
Referenced by SaveWorkbook().
void SIMULATOR_FRAME_UI::SaveSettings | ( | EESCHEMA_SETTINGS * | aCfg | ) |
Definition at line 771 of file simulator_frame_ui.cpp.
References EESCHEMA_SETTINGS::SIMULATOR::VIEW::cursors_panel_height, m_darkMode, EESCHEMA_SETTINGS::m_Simulator, SIMULATOR_FRAME_UI_BASE::m_splitterCursors, SIMULATOR_FRAME_UI_BASE::m_splitterLeftRight, SIMULATOR_FRAME_UI_BASE::m_splitterMeasurements, SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsole, SIMULATOR_FRAME_UI_BASE::m_splitterSignals, EESCHEMA_SETTINGS::SIMULATOR::VIEW::measurements_panel_height, EESCHEMA_SETTINGS::SIMULATOR::VIEW::plot_panel_height, EESCHEMA_SETTINGS::SIMULATOR::VIEW::plot_panel_width, EESCHEMA_SETTINGS::SIMULATOR::VIEW::signal_panel_height, EESCHEMA_SETTINGS::SIMULATOR::view, and EESCHEMA_SETTINGS::SIMULATOR::VIEW::white_background.
Referenced by SIMULATOR_FRAME::SaveSettings().
bool SIMULATOR_FRAME_UI::SaveWorkbook | ( | const wxString & | aPath | ) |
Save plot, signal, cursor, measurement, etc.
settings to a file.
Definition at line 2483 of file simulator_frame_ui.cpp.
References _, SIM_TAB::GetLastSchTextSimCommand(), mpWindow::GetMarginBottom(), mpWindow::GetMarginLeft(), mpWindow::GetMarginRight(), mpWindow::GetMarginTop(), PROJECT::GetProjectPath(), SIM_TAB::GetSimCommand(), SIM_TAB::GetSimOptions(), SIM_TAB::GetSimType(), m_cursorFormatsDyn, m_customCursorsCnt, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_schematicFrame, m_userDefinedSignals, measurement, name, NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_EVENTS, NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES, KIWAY_HOLDER::Prj(), res, SaveCursorToWorkbook(), simulator(), KIGFX::COLOR4D::ToCSSString(), SPICE_SIMULATOR::TypeToName(), updateMeasurementsFromGrid(), vectorNameFromSignalId(), and FILEEXT::WorkbookFileExtension.
Referenced by SIMULATOR_FRAME::SaveWorkbook().
|
inline |
Definition at line 122 of file simulator_frame_ui.h.
References dummy, m_cursorFormatsDyn, and onPlotCursorUpdate().
Referenced by CURSORS_GRID_TRICKS::doPopupSelection().
void SIMULATOR_FRAME_UI::SetMeasureFormat | ( | int | aRow, |
const SPICE_VALUE_FORMAT & | aFormat | ||
) |
Definition at line 1412 of file simulator_frame_ui.cpp.
References COL_MEASUREMENT_FORMAT, SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, and SPICE_VALUE_FORMAT::ToString().
Referenced by MEASUREMENTS_GRID_TRICKS::doPopupSelection(), and UpdateMeasurement().
void SIMULATOR_FRAME_UI::SetSubWindowsSashSize | ( | ) |
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)
Definition at line 822 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_splitterCursors, m_splitterCursorsSashPosition, SIMULATOR_FRAME_UI_BASE::m_splitterLeftRight, m_splitterLeftRightSashPosition, SIMULATOR_FRAME_UI_BASE::m_splitterMeasurements, SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsole, m_splitterPlotAndConsoleSashPosition, SIMULATOR_FRAME_UI_BASE::m_splitterSignals, m_splitterSignalsSashPosition, and m_splitterTuneValuesSashPosition.
void SIMULATOR_FRAME_UI::SetUserDefinedSignals | ( | const std::map< int, wxString > & | aSignals | ) |
Definition at line 1806 of file simulator_frame_ui.cpp.
References applyUserDefinedSignals(), SIM_PLOT_TAB::DeleteTrace(), SIM_TAB::GetSimType(), SIM_PLOT_TAB::GetTrace(), SIMULATOR_FRAME_UI_BASE::m_filter, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, m_simulatorFrame, m_userDefinedSignals, OnModify(), rebuildSignalsGrid(), rebuildSignalsList(), SIMULATOR_FRAME::SimFinished(), SPT_AC_GAIN, SPT_AC_PHASE, SPT_SP_AMP, SPT_UNKNOWN, ST_AC, ST_SP, updatePlotCursors(), updateSignalsGrid(), and vectorNameFromSignalName().
Referenced by SIMULATOR_FRAME::SetUserDefinedSignals().
void SIMULATOR_FRAME_UI::ShowChangedLanguage | ( | ) |
Definition at line 721 of file simulator_frame_ui.cpp.
References _, COL_CURSOR_1, COL_CURSOR_2, COL_CURSOR_NAME, COL_CURSOR_SIGNAL, COL_CURSOR_X, COL_CURSOR_Y, COL_SIGNAL_COLOR, COL_SIGNAL_NAME, COL_SIGNAL_SHOW, SIMULATOR_FRAME_UI_BASE::m_cursorsGrid, SIMULATOR_FRAME_UI_BASE::m_filter, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, m_tuners, simulator(), and updatePlotCursors().
Referenced by SIMULATOR_FRAME::ShowChangedLanguage().
std::vector< wxString > SIMULATOR_FRAME_UI::Signals | ( | ) | const |
Definition at line 3116 of file simulator_frame_ui.cpp.
References m_signals, m_userDefinedSignals, and sortSignals().
Referenced by SIMULATOR_FRAME::Signals().
|
private |
Updates m_signalsGrid cursor widget, column rendering and attributes.
t | is the type of the enum that holds m_signalsGrid column indexing |
u | a cursor "ID". Applies a 2 integer offset against the enum indexing |
r | is a wxGrid widget's row |
Definition at line 1987 of file simulator_frame_ui.cpp.
References COL_SIGNAL_COLOR, COL_SIGNAL_NAME, color, GetCurrentSimTab(), SIM_PLOT_TAB::GetTrace(), SIMULATOR_FRAME_UI_BASE::m_signalsGrid, SPT_UNKNOWN, and vectorNameFromSignalName().
Referenced by updateSignalsGrid().
std::vector< wxString > SIMULATOR_FRAME_UI::SimPlotVectors | ( | ) | const |
Definition at line 3105 of file simulator_frame_ui.cpp.
References simulator().
Referenced by SIMULATOR_FRAME::SimPlotVectors().
|
private |
Definition at line 2870 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME::GetSimulator(), and m_simulatorFrame.
Referenced by applyTuners(), applyUserDefinedSignals(), DoFourier(), InitWorkbook(), LoadWorkbook(), NewSimTab(), onPlotChanged(), OnSimRefresh(), SaveWorkbook(), ShowChangedLanguage(), SimPlotVectors(), UpdateMeasurement(), and updateTrace().
void SIMULATOR_FRAME_UI::ToggleDarkModePlots | ( | ) |
Definition at line 2741 of file simulator_frame_ui.cpp.
References SIM_PLOT_COLORS::FillDefaultColorList(), m_darkMode, SIMULATOR_FRAME_UI_BASE::m_plotNotebook, and SIM_PLOT_TAB::UpdatePlotColors().
Referenced by SIMULATOR_FRAME::ToggleDarkModePlots().
|
private |
A common toggler for the two main wxSplitterWindow s.
Definition at line 2698 of file simulator_frame_ui.cpp.
Referenced by ToggleSimConsole(), and ToggleSimSidePanel().
void SIMULATOR_FRAME_UI::ToggleSimConsole | ( | ) |
Definition at line 2723 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_panelConsole, SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsole, m_splitterPlotAndConsoleSashPosition, and TogglePanel().
Referenced by SIMULATOR_FRAME::ToggleSimConsole().
void SIMULATOR_FRAME_UI::ToggleSimSidePanel | ( | ) |
Definition at line 2735 of file simulator_frame_ui.cpp.
References SIMULATOR_FRAME_UI_BASE::m_sidePanel, SIMULATOR_FRAME_UI_BASE::m_splitterLeftRight, m_splitterLeftRightSashPosition, and TogglePanel().
Referenced by SIMULATOR_FRAME::ToggleSimSidePanel().
void SIMULATOR_FRAME_UI::UpdateMeasurement | ( | int | aRow | ) |
Update a measurement in the measurements grid.
The user measurement looks something like: MAX V(out)
We need to send ngspice a "MEAS" command with the analysis type, an output variable name, and the signal name. For our example above, this looks something like: MEAS TRAN meas_result_0 MAX V(out)
This is also a good time to harvest the signal name prefix so we know what units to show on the result. For instance, for: MAX P(out) we want to show: 15W
Definition at line 1498 of file simulator_frame_ui.cpp.
References COL_MEASUREMENT, COL_MEASUREMENT_VALUE, GetCurrentSimTab(), GetMeasureFormat(), SIM_TAB::GetSimType(), SIMULATOR_FRAME_UI_BASE::m_measurementsGrid, m_simulatorFrame, SetMeasureFormat(), SIMULATOR_FRAME::SimFinished(), simulator(), ST_AC, ST_DC, ST_DISTO, ST_FFT, ST_NOISE, ST_OP, ST_PZ, ST_SENS, ST_SP, ST_TF, ST_TRAN, text, SPICE_VALUE::ToString(), updateMeasurementsFromGrid(), and SPICE_VALUE_FORMAT::UpdateUnits().
Referenced by AddMeasurement(), MEASUREMENTS_GRID_TRICKS::doPopupSelection(), onMeasurementsGridCellChanged(), OnPlotSettingsChanged(), and OnSimRefresh().
|
private |
Definition at line 2790 of file simulator_frame_ui.cpp.
References COL_MEASUREMENT, COL_MEASUREMENT_FORMAT, GetCurrentSimTab(), and SIMULATOR_FRAME_UI_BASE::m_measurementsGrid.
Referenced by AddMeasurement(), onMeasurementsGridCellChanged(), SaveWorkbook(), and UpdateMeasurement().
|
private |
Update the cursor values (in the grid) and graphics (in the plot window).
Definition at line 2882 of file simulator_frame_ui.cpp.
References _, WX_GRID::ClearRows(), COL_CURSOR_NAME, COL_CURSOR_SIGNAL, COL_CURSOR_X, COL_CURSOR_Y, cursor, CURSOR::GetCoords(), GetCurrentSimTab(), SIM_PLOT_TAB::GetLabelX(), SIM_PLOT_TAB::GetLabelY1(), SIM_PLOT_TAB::GetLabelY2(), SIM_PLOT_TAB::GetLabelY3(), mpLayer::GetName(), SIM_TAB::GetSimType(), SIM_PLOT_TAB::GetTraces(), SIM_PLOT_TAB::GetUnitsX(), SIM_PLOT_TAB::GetUnitsY1(), SIM_PLOT_TAB::GetUnitsY2(), SIM_PLOT_TAB::GetUnitsY3(), m_cursorFormatsDyn, SIMULATOR_FRAME_UI_BASE::m_cursorsGrid, m_customCursorsCnt, m_simulatorFrame, name, SIMULATOR_FRAME::SimFinished(), SPT_AC_PHASE, SPT_CURRENT, SPT_POWER, ST_AC, and SPICE_VALUE::ToString().
Referenced by CreateNewCursor(), DeleteCursor(), LoadWorkbook(), onCursorsGridCellChanged(), onPlotClosed(), onPlotCursorUpdate(), OnPlotSettingsChanged(), onSignalsGridCellChanged(), OnSimRefresh(), SetUserDefinedSignals(), and ShowChangedLanguage().
|
private |
Update the values in the signals grid.
Definition at line 2063 of file simulator_frame_ui.cpp.
References COL_CURSOR_1, COL_CURSOR_2, COL_SIGNAL_COLOR, COL_SIGNAL_SHOW, m_customCursorsCnt, SIMULATOR_FRAME_UI_BASE::m_signalsGrid, and signalsGridCursorUpdate().
Referenced by AddTrace(), CreateNewCursor(), DeleteCursor(), LoadWorkbook(), onSignalsGridCellChanged(), OnSimRefresh(), and SetUserDefinedSignals().
|
private |
Update a trace in a particular SIM_PLOT_TAB.
If the panel does not contain the given trace, then add it.
aVectorName | is the SPICE vector name, such as "I(Net-C1-Pad1)". |
aTraceType | describes the type of plot. |
aPlotTab | is the tab that should receive the update. |
Definition at line 1877 of file simulator_frame_ui.cpp.
References circuitModel(), SPICE_CIRCUIT_MODEL::CommandToSimType(), SIM_PLOT_TAB::GetOrAddTrace(), SIM_TAB::GetSimCommand(), getXAxisType(), SIM_TAB::IsPlottable(), KiROUND(), m_simulatorFrame, SPICE_DC_PARAMS::m_source, SPICE_DC_PARAMS::m_vend, SPICE_DC_PARAMS::m_vincrement, SPICE_DC_PARAMS::m_vstart, SIM_PLOT_TAB::SetTraceData(), SIMULATOR_FRAME::SimFinished(), simulator(), SPT_AC_GAIN, SPT_AC_PHASE, SPT_POWER, SPT_SP_AMP, SPT_Y_AXIS_MASK, ST_AC, ST_DC, ST_FFT, ST_NOISE, ST_SP, ST_TRAN, and SPICE_VALUE::ToDouble().
Referenced by AddTrace(), onSignalsGridCellChanged(), and OnSimRefresh().
void SIMULATOR_FRAME_UI::UpdateTunerValue | ( | const SCH_SHEET_PATH & | aSheetPath, |
const KIID & | aSymbol, | ||
const wxString & | aRef, | ||
const wxString & | aValue | ||
) |
Safely update a field of the associated symbol without dereferencing the symbol.
aSymbol | id of the symbol needing updating |
aId | id of the symbol field |
aValue | new value of the symbol field |
Definition at line 1649 of file simulator_frame_ui.cpp.
References _, SIM_LIB_MGR::CreateModel(), DisplayErrorMessage(), SCH_SYMBOL::GetEmbeddedFiles(), SCHEMATIC::GetEmbeddedFiles(), SCH_SYMBOL::GetFields(), SIM_MODEL::GetTunerParam(), SIM_MODEL::PARAM::info, m_schematicFrame, SIM_MODEL::PARAM::INFO::name, SCH_EDIT_FRAME::OnModify(), KIWAY_HOLDER::Prj(), SCH_SHEET_PATH::ResolveItem(), SCH_EDIT_FRAME::Schematic(), SIM_LIB_MGR::SetFilesStack(), SIM_MODEL::SetParamValue(), SCH_EDIT_FRAME::UpdateItem(), and SIM_MODEL::WriteFields().
Referenced by TUNER_SLIDER::onSave().
|
inline |
Definition at line 87 of file simulator_frame_ui.h.
References m_userDefinedSignals.
Referenced by SIMULATOR_FRAME::UserDefinedSignals().
|
private |
Get the simulator output vector name for a given signal name and type.
For user-defined signals we display the user-oriented signal name such as "V(out)-V(in)", but the simulator vector we actually have to plot will be "user0" or some-such.
Definition at line 1192 of file simulator_frame_ui.cpp.
References _, getNoiseSource(), SIM_TAB::GetSimType(), m_userDefinedSignals, name, SPT_AC_GAIN, SPT_AC_PHASE, SPT_CURRENT, SPT_POWER, SPT_SP_AMP, SPT_VOLTAGE, ST_NOISE, and vectorNameFromSignalId().
Referenced by loadJsonWorkbook(), loadLegacyWorkbook(), onSignalsGridCellChanged(), OnSimRefresh(), rebuildSignalsGrid(), SetUserDefinedSignals(), and signalsGridCursorUpdate().
|
private |
Definition at line 386 of file simulator_frame_ui.h.
Referenced by CustomCursorsInit(), onSignalsGridCellChanged(), and parseTraceParams().
|
private |
Definition at line 389 of file simulator_frame_ui.h.
Referenced by CreateNewCursor(), CustomCursorsInit(), DeleteCursor(), GetCursorFormat(), loadJsonWorkbook(), onSignalsGridCellChanged(), SaveCursorToWorkbook(), SaveWorkbook(), SetCursorFormat(), and updatePlotCursors().
|
protectedinherited |
Definition at line 57 of file simulator_frame_ui_base.h.
Referenced by onCursorsGridCellChanged(), ShowChangedLanguage(), SIMULATOR_FRAME_UI(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), updatePlotCursors(), ~SIMULATOR_FRAME_UI(), and SIMULATOR_FRAME_UI_BASE::~SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 403 of file simulator_frame_ui.h.
Referenced by CreateNewCursor(), CustomCursorsInit(), DeleteCursor(), loadJsonWorkbook(), onCursorsGridCellChanged(), rebuildSignalsGrid(), SaveWorkbook(), updatePlotCursors(), and updateSignalsGrid().
|
private |
Definition at line 397 of file simulator_frame_ui.h.
Referenced by DarkModePlots(), LoadSettings(), SaveSettings(), SIMULATOR_FRAME_UI(), and ToggleDarkModePlots().
|
protectedinherited |
Definition at line 52 of file simulator_frame_ui_base.h.
Referenced by InitWorkbook(), LoadWorkbook(), OnFilterMouseMoved(), OnFilterText(), onPlotClosed(), OnPlotSettingsChanged(), SetUserDefinedSignals(), ShowChangedLanguage(), SIMULATOR_FRAME_UI(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), and SIMULATOR_FRAME_UI_BASE::~SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 61 of file simulator_frame_ui_base.h.
Referenced by AddMeasurement(), DeleteMeasurement(), GetMeasureFormat(), onMeasurementsGridCellChanged(), onPlotChanging(), OnPlotSettingsChanged(), OnSimRefresh(), rebuildMeasurementsGrid(), SetMeasureFormat(), SIMULATOR_FRAME_UI(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), UpdateMeasurement(), updateMeasurementsFromGrid(), ~SIMULATOR_FRAME_UI(), and SIMULATOR_FRAME_UI_BASE::~SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 384 of file simulator_frame_ui.h.
Referenced by applyUserDefinedSignals(), and rebuildSignalsList().
|
protectedinherited |
Definition at line 54 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 45 of file simulator_frame_ui_base.h.
Referenced by IsSimConsoleShown(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), and ToggleSimConsole().
|
protectedinherited |
Definition at line 56 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 39 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 60 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 58 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 51 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 62 of file simulator_frame_ui_base.h.
Referenced by AddTuner(), RemoveTuner(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 44 of file simulator_frame_ui_base.h.
Referenced by ApplyPreferences(), DeleteCursor(), GetCurrentSimTab(), GetSimTab(), GetSimTabIndex(), loadJsonWorkbook(), loadLegacyWorkbook(), LoadWorkbook(), NewSimTab(), SaveWorkbook(), SetUserDefinedSignals(), ShowChangedLanguage(), SIMULATOR_FRAME_UI(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), ToggleDarkModePlots(), and SIMULATOR_FRAME_UI_BASE::~SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 398 of file simulator_frame_ui.h.
Referenced by NewSimTab().
|
protectedinherited |
Definition at line 42 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 400 of file simulator_frame_ui.h.
Referenced by ApplyPreferences(), LoadSettings(), and NewSimTab().
|
private |
Definition at line 399 of file simulator_frame_ui.h.
Referenced by OnSimRefresh(), OnSimUpdate(), and SIMULATOR_FRAME_UI().
|
private |
Definition at line 376 of file simulator_frame_ui.h.
Referenced by InitWorkbook(), LoadWorkbook(), onPlotClosed(), OnSimRefresh(), SaveWorkbook(), SIMULATOR_FRAME_UI(), and UpdateTunerValue().
|
protectedinherited |
Definition at line 48 of file simulator_frame_ui_base.h.
Referenced by IsSimSidePanelShown(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), and ToggleSimSidePanel().
|
protectedinherited |
Definition at line 49 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 378 of file simulator_frame_ui.h.
Referenced by OnSimRefresh(), rebuildSignalsGrid(), rebuildSignalsList(), and Signals().
|
protectedinherited |
Definition at line 53 of file simulator_frame_ui_base.h.
Referenced by CreateNewCursor(), CustomCursorsInit(), DeleteCursor(), onSignalsGridCellChanged(), rebuildSignalsGrid(), ShowChangedLanguage(), signalsGridCursorUpdate(), SIMULATOR_FRAME_UI(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), updateSignalsGrid(), ~SIMULATOR_FRAME_UI(), and SIMULATOR_FRAME_UI_BASE::~SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 47 of file simulator_frame_ui_base.h.
Referenced by AddTrace(), OnSimRefresh(), OnSimReport(), OnSimUpdate(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 375 of file simulator_frame_ui.h.
Referenced by circuitModel(), InitWorkbook(), loadJsonWorkbook(), loadLegacyWorkbook(), OnModify(), rebuildSignalsList(), SetUserDefinedSignals(), simulator(), SIMULATOR_FRAME_UI(), UpdateMeasurement(), updatePlotCursors(), and updateTrace().
|
protectedinherited |
Definition at line 40 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 46 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 43 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 63 of file simulator_frame_ui_base.h.
Referenced by AddTuner(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 55 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterCursorsOnIdle(), SaveSettings(), SetSubWindowsSashSize(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 395 of file simulator_frame_ui.h.
Referenced by LoadSettings(), and SetSubWindowsSashSize().
|
protectedinherited |
Definition at line 38 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterLeftRightOnIdle(), SaveSettings(), SetSubWindowsSashSize(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), and ToggleSimSidePanel().
|
private |
Definition at line 392 of file simulator_frame_ui.h.
Referenced by LoadSettings(), SetSubWindowsSashSize(), and ToggleSimSidePanel().
|
protectedinherited |
Definition at line 59 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterMeasurementsOnIdle(), SaveSettings(), SetSubWindowsSashSize(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
protectedinherited |
Definition at line 41 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterPlotAndConsoleOnIdle(), SaveSettings(), SetSubWindowsSashSize(), SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE(), and ToggleSimConsole().
|
private |
Definition at line 393 of file simulator_frame_ui.h.
Referenced by LoadSettings(), SetSubWindowsSashSize(), and ToggleSimConsole().
|
protectedinherited |
Definition at line 50 of file simulator_frame_ui_base.h.
Referenced by SIMULATOR_FRAME_UI_BASE::m_splitterSignalsOnIdle(), SaveSettings(), SetSubWindowsSashSize(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
|
private |
Definition at line 394 of file simulator_frame_ui.h.
Referenced by LoadSettings(), and SetSubWindowsSashSize().
|
private |
Definition at line 396 of file simulator_frame_ui.h.
Referenced by LoadSettings(), and SetSubWindowsSashSize().
int SIMULATOR_FRAME_UI::m_SuppressGridEvents |
Definition at line 372 of file simulator_frame_ui.h.
Referenced by onCursorsGridCellChanged(), onSignalsGridCellChanged(), SUPPRESS_GRID_CELL_EVENTS::SUPPRESS_GRID_CELL_EVENTS(), and SUPPRESS_GRID_CELL_EVENTS::~SUPPRESS_GRID_CELL_EVENTS().
|
private |
SPICE expressions need quoted versions of the netnames since KiCad allows '-' and '/' in netnames.
Definition at line 380 of file simulator_frame_ui.h.
Referenced by AddTuner(), applyTuners(), RemoveTuner(), and ShowChangedLanguage().
|
private |
Definition at line 379 of file simulator_frame_ui.h.
Referenced by applyUserDefinedSignals(), loadJsonWorkbook(), loadLegacyWorkbook(), LoadWorkbook(), OnSimRefresh(), rebuildSignalsGrid(), SaveWorkbook(), SetUserDefinedSignals(), Signals(), UserDefinedSignals(), and vectorNameFromSignalName().