KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SIM_PLOT_TAB Class Reference

#include <sim_plot_tab.h>

Inheritance diagram for SIM_PLOT_TAB:
SIM_TAB

Public Member Functions

 SIM_PLOT_TAB (const wxString &aSimCommand, wxWindow *parent)
 
virtual ~SIM_PLOT_TAB ()
 
void ApplyPreferences (const SIM_PREFERENCES &aPrefs) override
 
wxString GetLabelX () const
 
wxString GetLabelY1 () const
 
wxString GetLabelY2 () const
 
wxString GetLabelY3 () const
 
bool GetY1Scale (double *aMin, double *aMax) const
 
bool GetY2Scale (double *aMin, double *aMax) const
 
bool GetY3Scale (double *aMin, double *aMax) const
 
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
 
TRACEGetTrace (const wxString &aVecName, int aType) const
 
void ShowGrid (bool aEnable)
 
bool IsGridShown () const
 
void ShowLegend (bool aEnable)
 
bool IsLegendShown () const
 
wxPoint GetLegendPosition () const
 
void SetLegendPosition (const wxPoint &aPosition)
 
void SetDottedSecondary (bool aEnable)
 Draw secondary signal traces (current or phase) with dotted lines.
 
bool GetDottedSecondary () const
 Toggle cursor for a particular trace.
 
void EnableCursor (const wxString &aVectorName, int aType, int aCursorId, bool aEnable, const wxString &aSignalName)
 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 OnLanguageChanged () override
 Getter for math plot window.
 
mpWindowGetPlotWin () const
 
TRACEGetOrAddTrace (const wxString &aVectorName, int aType)
 
void SetTraceData (TRACE *aTrace, std::vector< double > &aX, std::vector< double > &aY)
 
bool DeleteTrace (const wxString &aVectorName, int aTraceType)
 
void DeleteTrace (TRACE *aTrace)
 
std::vector< std::pair< wxString, wxString > > & Measurements ()
 
void EnsureThirdYAxisExists ()
 
SIM_TYPE GetSimType () const
 
const wxString & GetSimCommand () const
 
void SetSimCommand (const wxString &aSimCommand)
 
int GetSimOptions () const
 
void SetSimOptions (int aOptions)
 
wxString GetLastSchTextSimCommand () const
 
void SetLastSchTextSimCommand (const wxString &aCmd)
 
const wxString & GetSpicePlotName () const
 
void SetSpicePlotName (const wxString &aPlotName)
 

Static Public Member Functions

static bool IsPlottable (SIM_TYPE aSimType)
 

Public Attributes

wxPoint m_LastLegendPosition
 

Private Member Functions

wxString getTraceId (const wxString &aVectorName, int aType) const
 Construct the plot axes for DC simulation plot.
 
void prepareDCAxes (int aNewTraceType)
 Create/Ensure axes are available for plotting.
 
void updateAxes (int aNewTraceType=SIM_TRACE_TYPE::SPT_UNKNOWN)
 

Static Private Member Functions

static mpWindow::MouseWheelActionSet convertMouseWheelActions (const SIM_MOUSE_WHEEL_ACTION_SET &s)
 

Private Attributes

SIM_PLOT_COLORS m_colors
 
std::map< wxString, wxColour > m_sessionTraceColors
 
mpWindowm_plotWin
 
wxBoxSizer * m_sizer
 
std::map< wxString, TRACE * > m_traces
 
mpScaleXBasem_axis_x
 
mpScaleYm_axis_y1
 
mpScaleYm_axis_y2
 
mpScaleYm_axis_y3
 
mpInfoLegendm_legend
 
bool m_dotted_cp
 
std::vector< std::pair< wxString, wxString > > m_measurements
 
wxString m_simCommand
 
unsigned m_simOptions
 
wxString m_lastSchTextSimCommand
 
wxString m_spicePlotName
 

Detailed Description

Definition at line 191 of file sim_plot_tab.h.

Constructor & Destructor Documentation

◆ SIM_PLOT_TAB()

◆ ~SIM_PLOT_TAB()

SIM_PLOT_TAB::~SIM_PLOT_TAB ( )
virtual

Definition at line 463 of file sim_plot_tab.cpp.

Member Function Documentation

◆ ApplyPreferences()

void SIM_PLOT_TAB::ApplyPreferences ( const SIM_PREFERENCES aPrefs)
inlineoverridevirtual

◆ convertMouseWheelActions()

◆ DeleteTrace() [1/2]

bool SIM_PLOT_TAB::DeleteTrace ( const wxString &  aVectorName,
int  aTraceType 
)

◆ DeleteTrace() [2/2]

void SIM_PLOT_TAB::DeleteTrace ( TRACE aTrace)

◆ EnableCursor()

void SIM_PLOT_TAB::EnableCursor ( const wxString &  aVectorName,
int  aType,
int  aCursorId,
bool  aEnable,
const wxString &  aSignalName 
)

◆ EnsureThirdYAxisExists()

◆ GetDottedSecondary()

bool SIM_PLOT_TAB::GetDottedSecondary ( ) const
inline

Toggle cursor for a particular trace.

Definition at line 329 of file sim_plot_tab.h.

References m_dotted_cp.

Referenced by SIMULATOR_FRAME::setupUIConditions().

◆ GetLabelX()

wxString SIM_PLOT_TAB::GetLabelX ( ) const
inline

Definition at line 203 of file sim_plot_tab.h.

References mpLayer::GetName(), and m_axis_x.

Referenced by SIMULATOR_FRAME_UI::updatePlotCursors().

◆ GetLabelY1()

wxString SIM_PLOT_TAB::GetLabelY1 ( ) const
inline

Definition at line 208 of file sim_plot_tab.h.

References mpLayer::GetName(), and m_axis_y1.

Referenced by SIMULATOR_FRAME_UI::updatePlotCursors().

◆ GetLabelY2()

wxString SIM_PLOT_TAB::GetLabelY2 ( ) const
inline

Definition at line 213 of file sim_plot_tab.h.

References mpLayer::GetName(), and m_axis_y2.

Referenced by SIMULATOR_FRAME_UI::updatePlotCursors().

◆ GetLabelY3()

wxString SIM_PLOT_TAB::GetLabelY3 ( ) const
inline

Definition at line 218 of file sim_plot_tab.h.

References mpLayer::GetName(), and m_axis_y3.

Referenced by SIMULATOR_FRAME_UI::updatePlotCursors().

◆ GetLastSchTextSimCommand()

wxString SIM_TAB::GetLastSchTextSimCommand ( ) const
inlineinherited

◆ GetLegendPosition()

wxPoint SIM_PLOT_TAB::GetLegendPosition ( ) const
inline

Definition at line 304 of file sim_plot_tab.h.

References mpInfoLayer::GetPosition(), and m_legend.

◆ GetOrAddTrace()

◆ GetPlotWin()

◆ GetSimCommand()

◆ GetSimOptions()

int SIM_TAB::GetSimOptions ( ) const
inlineinherited

◆ GetSimType()

◆ GetSpicePlotName()

const wxString & SIM_TAB::GetSpicePlotName ( ) const
inlineinherited

Definition at line 61 of file sim_tab.h.

References SIM_TAB::m_spicePlotName.

Referenced by SIMULATOR_FRAME::StartSimulation().

◆ GetTrace()

◆ getTraceId()

wxString SIM_PLOT_TAB::getTraceId ( const wxString &  aVectorName,
int  aType 
) const
inlineprivate

Construct the plot axes for DC simulation plot.

Definition at line 383 of file sim_plot_tab.h.

References SPT_Y_AXIS_MASK.

Referenced by GetOrAddTrace(), and GetTrace().

◆ GetTraces()

const std::map< wxString, TRACE * > & SIM_PLOT_TAB::GetTraces ( ) const
inline

◆ GetUnitsX()

wxString SIM_PLOT_TAB::GetUnitsX ( ) const

Definition at line 490 of file sim_plot_tab.cpp.

References LOG_SCALE< T_PARENT >::GetUnits(), and m_axis_x.

Referenced by SIMULATOR_FRAME_UI::updatePlotCursors().

◆ GetUnitsY1()

wxString SIM_PLOT_TAB::GetUnitsY1 ( ) const

◆ GetUnitsY2()

wxString SIM_PLOT_TAB::GetUnitsY2 ( ) const

◆ GetUnitsY3()

wxString SIM_PLOT_TAB::GetUnitsY3 ( ) const

◆ GetY1Scale()

bool SIM_PLOT_TAB::GetY1Scale ( double *  aMin,
double *  aMax 
) const
inline

Definition at line 223 of file sim_plot_tab.h.

References mpScaleBase::GetAxisMinMax(), and m_axis_y1.

◆ GetY2Scale()

bool SIM_PLOT_TAB::GetY2Scale ( double *  aMin,
double *  aMax 
) const
inline

Definition at line 231 of file sim_plot_tab.h.

References mpScaleBase::GetAxisMinMax(), and m_axis_y2.

◆ GetY3Scale()

bool SIM_PLOT_TAB::GetY3Scale ( double *  aMin,
double *  aMax 
) const
inline

Definition at line 239 of file sim_plot_tab.h.

References mpScaleBase::GetAxisMinMax(), and m_axis_y3.

◆ IsGridShown()

bool SIM_PLOT_TAB::IsGridShown ( ) const
inline

Definition at line 285 of file sim_plot_tab.h.

References mpScaleBase::GetTicks(), m_axis_x, and m_axis_y1.

Referenced by SIMULATOR_FRAME::setupUIConditions().

◆ IsLegendShown()

bool SIM_PLOT_TAB::IsLegendShown ( ) const
inline

Definition at line 299 of file sim_plot_tab.h.

References mpLayer::IsVisible(), and m_legend.

Referenced by SIMULATOR_FRAME::setupUIConditions().

◆ IsPlottable()

bool SIM_TAB::IsPlottable ( SIM_TYPE  aSimType)
staticinherited

◆ Measurements()

std::vector< std::pair< wxString, wxString > > & SIM_PLOT_TAB::Measurements ( )
inline

◆ OnLanguageChanged()

void SIM_PLOT_TAB::OnLanguageChanged ( )
overridevirtual

Getter for math plot window.

Implements SIM_TAB.

Definition at line 810 of file sim_plot_tab.cpp.

References m_plotWin, mpWindow::UpdateAll(), and updateAxes().

◆ prepareDCAxes()

void SIM_PLOT_TAB::prepareDCAxes ( int  aNewTraceType)
private

◆ ResetScales()

void SIM_PLOT_TAB::ResetScales ( bool  aIncludeX)

◆ SetDottedSecondary()

void SIM_PLOT_TAB::SetDottedSecondary ( bool  aEnable)
inline

Draw secondary signal traces (current or phase) with dotted lines.

Definition at line 319 of file sim_plot_tab.h.

References m_dotted_cp, m_plotWin, m_traces, name, mpWindow::UpdateAll(), and UpdateTraceStyle().

Referenced by SIMULATOR_FRAME_UI::loadJsonWorkbook(), and SIMULATOR_FRAME_UI::parseTraceParams().

◆ SetLastSchTextSimCommand()

void SIM_TAB::SetLastSchTextSimCommand ( const wxString &  aCmd)
inlineinherited

◆ SetLegendPosition()

void SIM_PLOT_TAB::SetLegendPosition ( const wxPoint &  aPosition)
inline

◆ SetSimCommand()

void SIM_TAB::SetSimCommand ( const wxString &  aSimCommand)
inlineinherited

Definition at line 53 of file sim_tab.h.

References SIM_TAB::m_simCommand.

Referenced by SIMULATOR_FRAME::EditAnalysis(), and SIMULATOR_FRAME::StartSimulation().

◆ SetSimOptions()

void SIM_TAB::SetSimOptions ( int  aOptions)
inlineinherited

◆ SetSpicePlotName()

void SIM_TAB::SetSpicePlotName ( const wxString &  aPlotName)
inlineinherited

◆ SetTraceData()

void SIM_PLOT_TAB::SetTraceData ( TRACE aTrace,
std::vector< double > &  aX,
std::vector< double > &  aY 
)

◆ SetY1Scale()

void SIM_PLOT_TAB::SetY1Scale ( bool  aLock,
double  aMin,
double  aMax 
)

Definition at line 469 of file sim_plot_tab.cpp.

References m_axis_y1, and mpScaleBase::SetAxisMinMax().

Referenced by SIMULATOR_FRAME_UI::loadJsonWorkbook().

◆ SetY2Scale()

void SIM_PLOT_TAB::SetY2Scale ( bool  aLock,
double  aMin,
double  aMax 
)

Definition at line 476 of file sim_plot_tab.cpp.

References m_axis_y2, and mpScaleBase::SetAxisMinMax().

Referenced by SIMULATOR_FRAME_UI::loadJsonWorkbook().

◆ SetY3Scale()

void SIM_PLOT_TAB::SetY3Scale ( bool  aLock,
double  aMin,
double  aMax 
)

Definition at line 483 of file sim_plot_tab.cpp.

References m_axis_y3, and mpScaleBase::SetAxisMinMax().

Referenced by SIMULATOR_FRAME_UI::loadJsonWorkbook().

◆ ShowGrid()

void SIM_PLOT_TAB::ShowGrid ( bool  aEnable)
inline

◆ ShowLegend()

void SIM_PLOT_TAB::ShowLegend ( bool  aEnable)
inline

◆ updateAxes()

◆ UpdatePlotColors()

◆ UpdateTraceStyle()

Member Data Documentation

◆ m_axis_x

mpScaleXBase* SIM_PLOT_TAB::m_axis_x
private

◆ m_axis_y1

◆ m_axis_y2

mpScaleY* SIM_PLOT_TAB::m_axis_y2
private

◆ m_axis_y3

◆ m_colors

SIM_PLOT_COLORS SIM_PLOT_TAB::m_colors
private

Definition at line 395 of file sim_plot_tab.h.

Referenced by GetOrAddTrace(), and UpdatePlotColors().

◆ m_dotted_cp

bool SIM_PLOT_TAB::m_dotted_cp
private

Definition at line 411 of file sim_plot_tab.h.

Referenced by GetDottedSecondary(), SetDottedSecondary(), and UpdateTraceStyle().

◆ m_LastLegendPosition

wxPoint SIM_PLOT_TAB::m_LastLegendPosition

Definition at line 364 of file sim_plot_tab.h.

Referenced by SetLegendPosition(), and SIM_PLOT_TAB().

◆ m_lastSchTextSimCommand

wxString SIM_TAB::m_lastSchTextSimCommand
privateinherited

◆ m_legend

mpInfoLegend* SIM_PLOT_TAB::m_legend
private

◆ m_measurements

std::vector<std::pair<wxString, wxString> > SIM_PLOT_TAB::m_measurements
private

Definition at line 414 of file sim_plot_tab.h.

Referenced by Measurements().

◆ m_plotWin

◆ m_sessionTraceColors

std::map<wxString, wxColour> SIM_PLOT_TAB::m_sessionTraceColors
private

Definition at line 396 of file sim_plot_tab.h.

Referenced by GetOrAddTrace(), and UpdateTraceStyle().

◆ m_simCommand

wxString SIM_TAB::m_simCommand
privateinherited

Definition at line 65 of file sim_tab.h.

Referenced by SIM_TAB::GetSimCommand(), SIM_TAB::GetSimType(), and SIM_TAB::SetSimCommand().

◆ m_simOptions

unsigned SIM_TAB::m_simOptions
privateinherited

Definition at line 66 of file sim_tab.h.

Referenced by SIM_TAB::GetSimOptions(), and SIM_TAB::SetSimOptions().

◆ m_sizer

wxBoxSizer* SIM_PLOT_TAB::m_sizer
private

Definition at line 400 of file sim_plot_tab.h.

Referenced by SIM_PLOT_TAB().

◆ m_spicePlotName

wxString SIM_TAB::m_spicePlotName
privateinherited

Definition at line 68 of file sim_tab.h.

Referenced by SIM_TAB::GetSpicePlotName(), and SIM_TAB::SetSpicePlotName().

◆ m_traces

std::map<wxString, TRACE*> SIM_PLOT_TAB::m_traces
private

The documentation for this class was generated from the following files: