80 std::vector<wxString>
Signals()
const;
121 wxCommandEvent
dummy;
144 const wxString& aRef,
const wxString& aValue );
167 void DoFourier(
const wxString& aSignal,
const wxString& aFundamental );
230 for(
int ii = 0; ii < (int)
m_plotNotebook->GetPageCount(); ++ii )
234 if( candidate && candidate->
GetSimType() == aType )
254 if( aPlotName.IsEmpty() )
257 for(
int ii = 0; ii < (int)
m_plotNotebook->GetPageCount(); ++ii )
261 if( candidate && candidate != aExcept && candidate->
GetSpicePlotName() == aPlotName )
293 std::vector<double>* aDataX =
nullptr,
bool aClearData =
false,
SIM_VIEW* aView =
nullptr );
301 void TogglePanel( wxPanel* aPanel, wxSplitterWindow* aSplitterWindow,
int& aSashPosition );
352 template <
typename T,
typename U,
typename R>
401 struct MULTI_RUN_STEP;
406 std::string
multiRunTraceKey(
const wxString& aVectorName,
int aTraceType )
const;
408 const std::vector<double>& aX,
const std::vector<double>& aY );
414 const wxString& aParams );
416 std::shared_ptr<SPICE_SIMULATOR>
simulator()
const;
417 std::shared_ptr<SPICE_CIRCUIT_MODEL>
circuitModel()
const;
420 void onPlotClose( wxAuiNotebookEvent& event )
override;
421 void onPlotClosed( wxAuiNotebookEvent& event )
override;
433 void OnUpdateUI( wxUpdateUIEvent& event )
override;
464 std::vector<std::vector<double>>
xRuns;
480 std::map<std::string, MULTI_RUN_TRACE>
traces;
The SIMULATOR_FRAME holds the main user-interface for running simulations.
Schematic editor (Eeschema) main window.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SIMULATOR_FRAME_UI_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxAuiNotebook * m_plotNotebook
SIM_TAB * NewSimTab(const wxString &aSimCommand)
Create a new simulation tab for a given simulation type.
std::string multiRunTraceKey(const wxString &aVectorName, int aTraceType) const
std::vector< int > m_smithCursorWidths
void SetUserDefinedSignals(const std::map< int, wxString > &aSignals)
void updatePlotCursors()
Update the cursor values (in the grid) and graphics (in the plot window).
void OnSimRefresh(bool aFinal)
void onPlotClose(wxAuiNotebookEvent &event) override
void CustomCursorsInit()
Init handler for custom cursors.
void recordMultiRunData(const wxString &aVectorName, int aTraceType, const std::vector< double > &aX, const std::vector< double > &aY)
std::vector< MULTI_RUN_STEP > calculateMultiRunSteps(const std::vector< TUNER_SLIDER * > &aTuners) const
void autoSizeGridColumn(WX_GRID *aGrid, int aCol, int aMinWidth, int aExtraPadding=0)
Grow (but never shrink below aMinWidth) a grid column to fit its current contents.
int m_splitterTuneValuesSashPosition
void TogglePanel(wxPanel *aPanel, wxSplitterWindow *aSplitterWindow, int &aSashPosition)
A common toggler for the two main wxSplitterWindow s.
void onPlotChanged(wxAuiNotebookEvent &event) override
void rebuildSignalsGrid(wxString aFilter)
Rebuild the filtered list of signals in the signals grid.
SIM_TAB * GetSimTab(SIM_TYPE aType) const
std::vector< std::vector< SPICE_VALUE_FORMAT > > m_cursorFormatsDyn
void DoFourier(const wxString &aSignal, const wxString &aFundamental)
void rebuildMeasurementsGrid()
Rebuild the measurements grid for the current plot.
std::list< TUNER_SLIDER * > m_tuners
bool IsPlotOwnedByOtherTab(const SIM_TAB *aExcept, const wxString &aPlotName) const
Return true if a tab other than aExcept records aPlotName as its ngspice plot.
void rebuildSignalsList()
Rebuild the list of signals available from the netlist.
bool loadLegacyWorkbook(const wxString &aPath)
int m_splitterCursorsSashPosition
MULTI_RUN_STATE m_multiRunState
SPICE expressions need quoted versions of the netnames since KiCad allows '-' and '/' in netnames.
wxArrayString getYScaleChoices(SIM_PLOT_TAB *aPlotTab, SIM_VIEW *aOwnView) const
The Signals grid's "Y Scale" column label for a trace ("Default" if not explicitly linked).
void ToggleSimSidePanel()
void UpdateMeasurement(int aRow)
Update a measurement in the measurements grid.
wxString getNoiseSource() const
std::vector< wxString > SimPlotVectors() const
unsigned int m_plotNumber
void SetSubWindowsSashSize()
Adjust the sash dimension of splitter windows after reading the config settings must be called after ...
void applyUserDefinedSignals()
Apply user-defined signals to the SPICE session.
SIM_PREFERENCES m_preferences
void DeleteMeasurement(int aRow)
Delete a row from the measurements grid.
SCH_EDIT_FRAME * m_schematicFrame
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 updateSignalsGrid()
Update the values in the signals grid.
int m_splitterLeftRightSashPosition
void onCursorsGridCellChanged(wxGridEvent &aEvent) override
void onPlotDragged(wxAuiNotebookEvent &event) override
std::vector< wxString > Signals() const
bool SaveWorkbook(const wxString &aPath)
Save plot, signal, cursor, measurement, etc.
bool hasMultiRunTrace(const wxString &aVectorName, int aTraceType) const
std::vector< wxString > m_signals
SIM_TAB * GetCurrentSimTab() const
Return the currently opened plot panel (or NULL if there is none).
wxString getViewLabel(SIM_PLOT_TAB *aPlotTab, SIM_VIEW *aView) const
The views a trace's Y-axis scale could be linked to: every view except its own (since linking to its ...
void updateSmithCursorColumns(bool aSmithMode)
Add or remove the Smith-only cursor columns, carrying their shown/hidden state across.
void SaveCursorToWorkbook(nlohmann::json &aTraceJs, TRACE *aTrace, int aCursorId)
void updateMeasurementsFromGrid()
bool LoadWorkbook(const wxString &aPath)
Load plot, signal, cursor, measurement, etc.
wxString getYScaleLabel(SIM_PLOT_TAB *aPlotTab, TRACE *aTrace) const
void applySmithCursorColumns()
SPICE_VALUE_FORMAT GetMeasureFormat(int aRow) const
Get/Set the format of a value in the measurements grid.
std::map< int, wxString > m_userDefinedSignals
void updateTrace(const wxString &aVectorName, int aTraceType, SIM_PLOT_TAB *aPlotTab, std::vector< double > *aDataX=nullptr, bool aClearData=false, SIM_VIEW *aView=nullptr)
Update a trace in a particular SIM_PLOT_TAB.
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 fillSmithCursorRow(int aRow, CURSOR *aCursor, TRACE *aTrace)
bool DarkModePlots() const
const std::map< int, wxString > & UserDefinedSignals()
std::vector< wxString > m_netnames
void AddTrace(const wxString &aName, SIM_TRACE_TYPE aType)
Add a new trace to the current plot.
void onPlotClosed(wxAuiNotebookEvent &event) override
void RemoveTuner(TUNER_SLIDER *aTuner)
Remove an existing tuner.
void SaveSettings(EESCHEMA_SETTINGS *aCfg)
std::shared_ptr< SPICE_CIRCUIT_MODEL > circuitModel() const
void rememberSmithCursorColumns()
void OnFilterText(wxCommandEvent &aEvent) override
void onMeasurementsGridCellChanged(wxGridEvent &aEvent) override
void DeleteCursor()
Deletes last m_signalsGrid "Cursor n" column, removes vector's m_cursorFormatsDyn last entry,...
void CreateNewCursor()
Creates a column at the end of m_signalsGrid named "Cursor n" ( n = m_customCursorsCnt ),...
void applyTuners()
Apply component values specified using tuner sliders to the current netlist.
bool loadJsonWorkbook(const wxString &aPath)
wxString m_smithCursorColumns
wxArrayString getViewChoices(SIM_PLOT_TAB *aPlotTab) const
The Signals grid's "Plot" column label for a given view ("Disabled" if null).
void clearMultiRunState(bool aClearTraces)
void OnFilterMouseMoved(wxMouseEvent &aEvent) override
void AddMeasurement(const wxString &aCmd)
Add a measurement to the measurements grid.
void onPlotChanging(wxAuiNotebookEvent &event) override
std::vector< SIM_VIEW * > getYScaleTargetViews(SIM_PLOT_TAB *aPlotTab, SIM_VIEW *aOwnView) const
The Signals grid's "Y Scale" column choices: "Default" plus one entry per eligible view.
std::map< const TUNER_SLIDER *, double > m_tunerOverrides
STD_BITMAP_BUTTON * m_addViewButton
std::shared_ptr< SPICE_SIMULATOR > simulator() const
int GetSimTabIndex(SIM_TAB *aPlot) const
STD_BITMAP_BUTTON * m_removeViewButton
void onPlotCursorUpdate(wxCommandEvent &aEvent)
void onSignalsGridCellChanged(wxGridEvent &aEvent) override
void SetCursorFormat(int aCursorId, int aValueCol, const SPICE_VALUE_FORMAT &aFormat)
void InitWorkbook()
Load the currently active workbook stored in the project settings.
void ToggleDarkModePlots()
Toggle the current S-parameter tab between Smith chart and amplitude/phase views.
SIM_TRACE_TYPE getXAxisType(SIM_TYPE aType) const
Return X axis for a given simulation type.
void prepareMultiRunState()
void OnPlotSettingsChanged()
void signalsGridCursorUpdate(T t, U u, R r)
Updates m_signalsGrid cursor widget, column rendering and attributes.
void SetMeasureFormat(int aRow, const SPICE_VALUE_FORMAT &aFormat)
int m_splitterSignalsSashPosition
double getSmithPortImpedance(const wxString &aVectorName)
void setSmithCursorColumnLabels()
void ApplyPreferences(const SIM_PREFERENCES &aPrefs)
Called when settings are changed via the common Preferences dialog.
const SPICE_CIRCUIT_MODEL * GetExporter() const
Return the netlist exporter object used for simulations.
int m_splitterPlotAndConsoleSashPosition
SIMULATOR_FRAME * m_simulatorFrame
void ShowChangedLanguage()
void AddTuner(const SCH_SHEET_PATH &aSheetPath, SCH_SYMBOL *aSymbol)
Add a tuner for a symbol.
void parseTraceParams(SIM_PLOT_TAB *aPlotTab, TRACE *aTrace, const wxString &aSignalName, const wxString &aParams)
bool IsSimSidePanelShown()
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 OnUpdateUI(wxUpdateUIEvent &event) override
SIMULATOR_FRAME_UI(SIMULATOR_FRAME *aSimulatorFrame, SCH_EDIT_FRAME *aSchematicFrame)
SPICE_VALUE_FORMAT m_cursorFormats[3][2]
void LoadSettings(EESCHEMA_SETTINGS *aCfg)
The SIMULATOR_FRAME holds the main user-interface for running simulations.
const wxString & GetSpicePlotName() const
SIM_TYPE GetSimType() const
A single stacked plot area within a SIM_PLOT_TAB.
Special netlist exporter flavor that allows one to override simulation commands.
Storage for simulator specific settings.
Overlay layer drawing the Smith chart grid (constant resistance and reactance circles)
Custom widget to handle quick component values modification and simulation on the fly.
Contains preferences pertaining to the simulator.
SIM_TYPE
< Possible simulation types
std::vector< FAB_LAYER_COLOR > dummy
std::vector< TUNER_SLIDER * > tuners
std::map< std::string, MULTI_RUN_TRACE > traces
std::vector< MULTI_RUN_STEP > steps
std::map< const TUNER_SLIDER *, double > overrides
std::vector< std::vector< double > > xRuns
std::vector< std::vector< double > > yValues
std::vector< double > xValues
Contains preferences pertaining to the simulator.