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

A single stacked plot area within a SIM_PLOT_TAB. More...

#include <sim_plot_tab.h>

Inheritance diagram for SIM_VIEW:
mpWindow

Public Types

enum class  MouseWheelAction {
  NONE , PAN_LEFT_RIGHT , PAN_RIGHT_LEFT , PAN_UP_DOWN ,
  ZOOM , ZOOM_HORIZONTALLY , ZOOM_VERTICALLY , COUNT
}
 Enumerates the possible mouse wheel actions that can be performed on the plot. More...
 

Public Member Functions

 SIM_VIEW (SIM_PLOT_TAB *aPlotTab, wxWindow *aParent)
 Mirrors this view's X range onto every other view of the same tab.
 
void OnXViewChanged () override
 Directly set this view's X range (used to mirror another view's zoom/pan onto this one).
 
void SetXRange (double aPos, double aDesiredMax, double aDesiredMin)
 
SIM_PLOT_TABGetPlotTab () const
 
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
 Get the display units (e.g. "V", "A", "dB") for a given trace plotted on this view.
 
wxString GetUnitsForTrace (TRACE *aTrace) const
 Get the Y-axis slot (1, 2 or 3) a trace of this type is plotted on.
 
int GetAxisSlot (TRACE *aTrace) const
 Get the Y-axis scale object for a given slot (1, 2 or 3), or nullptr if not created yet.
 
mpScaleYGetAxisBySlot (int aSlot) const
 
void ShowGrid (bool aEnable)
 
bool IsGridShown () const
 
void ShowLegend (bool aEnable)
 
bool IsLegendShown () const
 
wxPoint GetLegendPosition () const
 
void SetLegendPosition (const wxPoint &aPosition)
 Reset the Y (and, if requested, X) scale ranges to fit this view's own traces.
 
void ResetScales (bool aIncludeX)
 Create/Ensure axes are available for plotting.
 
void updateAxes (int aNewTraceType=SIM_TRACE_TYPE::SPT_UNKNOWN)
 
void UpdateAxisVisibility ()
 
void EnsureThirdYAxisExists ()
 
void SetSmithChart (bool aEnable)
 < Show/hide this view's Smith chart overlay.
 
bool IsSmithChart () const
 Refresh the grid z0 from the Smith traces shown on this view.
 
void UpdateSmithReferenceImpedance ()
 Re-read the Smith grid pen from the tab's color theme.
 
void UpdateSmithGridColor ()
 
double GetSmithZoom () const
 
const wxRealPoint & GetSmithPan () const
 
void ResetSmithView ()
 
void SetSmithView (double aZoom, double aPanX, double aPanY)
 
void SmithZoomAt (const wxPoint &aPos, double aFactor)
 
void SmithPanBy (const wxPoint &aDelta)
 
wxMenu * GetPopupMenu ()
 Get reference to context menu of the plot canvas.
 
bool AddLayer (mpLayer *layer, bool refreshDisplay=true)
 Add a plot layer to the canvas.
 
bool DelLayer (mpLayer *layer, bool alsoDeleteObject=false, bool refreshDisplay=true)
 Remove a plot layer from the canvas.
 
void DelAllLayers (bool alsoDeleteObject, bool refreshDisplay=true)
 Remove all layers from the plot.
 
mpLayerGetLayer (int position) const
 
const mpLayerGetLayerByName (const wxString &name) const
 
mpLayerGetLayerByName (const wxString &name)
 
double GetScaleX () const
 Get current view's X scale.
 
double GetScaleY () const
 Get current view's Y scale.
 
double GetPosX () const
 Get current view's X position.
 
double GetPosY () const
 Get current view's Y position.
 
int GetScrX () const
 Get current view's X dimension in device context units.
 
int GetXScreen () const
 
int GetScrY () const
 Get current view's Y dimension in device context units.
 
int GetYScreen () const
 
void SetScaleX (double scaleX)
 Set current view's X scale and refresh display.
 
void SetScaleY (double scaleY)
 Set current view's Y scale and refresh display.
 
void SetPosX (double posX)
 Set current view's X position and refresh display.
 
void SetPosY (double posY)
 Set current view's Y position and refresh display.
 
void SetPos (double posX, double posY)
 Set current view's X and Y position and refresh display.
 
void SetScr (int scrX, int scrY)
 Set current view's dimensions in device context units.
 
double p2x (wxCoord pixelCoordX)
 Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.
 
double p2y (wxCoord pixelCoordY)
 Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.
 
wxCoord x2p (double x)
 Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
 
wxCoord y2p (double y)
 Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
 
void EnableDoubleBuffer (bool enabled)
 Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
 
void EnableMousePanZoom (bool enabled)
 Enable/disable the feature of pan/zoom with the mouse (default=enabled)
 
void SetMouseWheelActions (const MouseWheelActionSet &s)
 Set the pan/zoom actions corresponding to mousewheel/trackpad events.
 
void Fit () override
 Set view to fit global bounding box of all plot layers and refresh display.
 
void Fit (double xMin, double xMax, double yMin, double yMax, const wxCoord *printSizeX=nullptr, const wxCoord *printSizeY=nullptr, wxOrientation directions=wxBOTH)
 Set view to fit a given bounding box and refresh display.
 
void ZoomIn (const wxPoint &centerPoint=wxDefaultPosition)
 Zoom into current view and refresh display.
 
void ZoomIn (const wxPoint &centerPoint, double zoomFactor, wxOrientation directions=wxBOTH)
 
void ZoomOut (const wxPoint &centerPoint=wxDefaultPosition)
 Zoom out current view and refresh display.
 
void ZoomOut (const wxPoint &centerPoint, double zoomFactor, wxOrientation directions=wxBOTH)
 
void ZoomRect (wxPoint p0, wxPoint p1)
 Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order)
 
void UpdateAll ()
 Refresh display.
 
unsigned int CountAllLayers () const
 Counts the number of plot layers, whether or not they have a bounding box.
 
double GetDesiredXmin () const
 Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
 
double GetDesiredXmax () const
 Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
 
double GetDesiredYmin () const
 Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
 
double GetDesiredYmax () const
 Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
 
void GetBoundingBox (double *bbox) const
 Returns the bounding box coordinates.
 
bool SaveScreenshot (wxImage &aImage, wxSize aImageSize=wxDefaultSize, bool aFit=false)
 Draw the window on a wxBitmap, then save it to a file.
 
void SetMargins (int top, int right, int bottom, int left)
 Set window margins, creating a blank area where some kinds of layers cannot draw.
 
void SetMarginTop (int top)
 Set the top margin.
 
void SetMarginRight (int right)
 Set the right margin.
 
void SetMarginBottom (int bottom)
 Set the bottom margin.
 
void SetMarginLeft (int left)
 Set the left margin.
 
int GetMarginTop () const
 
int GetMarginRight () const
 
int GetMarginBottom () const
 
int GetMarginLeft () const
 
mpInfoLayerIsInsideInfoLayer (wxPoint &point)
 Check if a given point is inside the area of a mpInfoLayer and eventually returns its pointer.
 
void SetLayerVisible (const wxString &name, bool viewable)
 Sets the visibility of a layer by its name.
 
void SetLayerVisible (const unsigned int position, bool viewable)
 Sets the visibility of a layer by its position in layer list.
 
bool IsLayerVisible (const wxString &name) const
 Check whether a layer with given name is visible.
 
bool IsLayerVisible (unsigned int position) const
 Check whether the layer at given position is visible.
 
void SetColourTheme (const wxColour &bgColour, const wxColour &drawColour, const wxColour &axesColour)
 Set Color theme.
 
const wxColour & GetAxesColour ()
 Get axes draw colour.
 
void LimitView (bool aEnable)
 Enable limiting of zooming & panning to the area used by the plots.
 
void LockY (bool aLock)
 
bool GetYLocked () const
 
void ZoomUndo ()
 
void ZoomRedo ()
 
int UndoZoomStackSize () const
 
int RedoZoomStackSize () const
 
void AdjustLimitedView (wxOrientation directions=wxBOTH)
 Limits the zoomed or panned view to the area used by the plots.
 
void OnFit (wxCommandEvent &event)
 
void OnCenter (wxCommandEvent &event)
 

Public Attributes

wxPoint m_lastLegendPosition
 
mpScaleXBasem_axis_x
 
mpScaleYm_axis_y1
 
mpScaleYm_axis_y2
 
mpScaleYm_axis_y3
 
mpInfoLegendm_legend
 

Static Public Attributes

static double zoomIncrementalFactor = 1.1
 This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse wheel.
 

Protected Member Functions

void pushZoomUndo (const std::array< double, 4 > &aZoom)
 
void OnPaint (wxPaintEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void OnShowPopupMenu (wxMouseEvent &event)
 
void OnMouseMiddleDown (wxMouseEvent &event)
 
void onZoomIn (wxCommandEvent &event)
 
void onZoomOut (wxCommandEvent &event)
 
void onZoomUndo (wxCommandEvent &event)
 
void onZoomRedo (wxCommandEvent &event)
 
void onMouseWheel (wxMouseEvent &event)
 
void onMagnify (wxMouseEvent &event)
 
void onMouseMove (wxMouseEvent &event)
 
void onMouseLeftDown (wxMouseEvent &event)
 
void onMouseLeftDClick (wxMouseEvent &event)
 
void onMouseLeftRelease (wxMouseEvent &event)
 
void DoZoom (const wxPoint &centerPoint, double zoomFactor, wxOrientation directions)
 
void RecomputeDesiredX (double &min, double &max)
 
void RecomputeDesiredY (double &min, double &max)
 
wxOrientation ViewNeedsRefitting (wxOrientation directions) const
 
void PerformMouseWheelAction (wxMouseEvent &event, MouseWheelAction action)
 
virtual bool UpdateBBox ()
 Recalculate global layer bounding box, and save it in m_minX,...
 
virtual bool SetXView (double pos, double desiredMax, double desiredMin)
 Applies new X view coordinates depending on the settings.
 
virtual bool SetYView (double pos, double desiredMax, double desiredMin)
 Applies new Y view coordinates depending on the settings.
 

Static Protected Member Functions

static MouseWheelActionSet defaultMouseWheelActions ()
 

Protected Attributes

wxLayerList m_layers
 
wxMenu m_popmenu
 
wxColour m_bgColour
 
wxColour m_fgColour
 
wxColour m_axColour
 
double m_minX
 
double m_maxX
 
double m_minY
 
double m_maxY
 
double m_scaleX
 
double m_scaleY
 
double m_posX
 
double m_posY
 
int m_scrX
 
int m_scrY
 
int m_clickedX
 
int m_clickedY
 
bool m_yLocked
 
double m_desiredXmin
 These are updated in Fit, ZoomIn, ZoomOut, ZoomRect, SetXView, SetYView and may be different from the real borders (layer coordinates) only if lock aspect ratio is true.
 
double m_desiredXmax
 
double m_desiredYmin
 
double m_desiredYmax
 
double m_topBottomPlotGapFactor
 
double m_leftRightPlotGapFactor
 
int m_marginTop
 
int m_marginRight
 
int m_marginBottom
 
int m_marginLeft
 
int m_last_lx
 
int m_last_ly
 
wxMemoryDC m_buff_dc
 
wxBitmap * m_buff_bmp
 
bool m_enableDoubleBuffer
 
bool m_enableMouseNavigation
 
bool m_enableLimitedView
 
MouseWheelActionSet m_mouseWheelActions
 
wxPoint m_mouseMClick
 
wxPoint m_mouseLClick
 
mpInfoLayerm_movingInfoLayer
 
bool m_zooming
 
wxRect m_zoomRect
 
std::stack< std::array< double, 4 > > m_undoZoomStack
 
std::stack< std::array< double, 4 > > m_redoZoomStack
 

Private Member Functions

void prepareDCAxes (int aNewTraceType)
 <
 
void onSmithMouseWheel (wxMouseEvent &aEvent)
 
void onSmithMagnify (wxMouseEvent &aEvent)
 
void onSmithMiddleDown (wxMouseEvent &aEvent)
 
void onSmithLeftDown (wxMouseEvent &aEvent)
 
void onSmithMotion (wxMouseEvent &aEvent)
 
void onSmithLeftUp (wxMouseEvent &aEvent)
 
void onSmithDClick (wxMouseEvent &aEvent)
 
void onSmithRightDown (wxMouseEvent &aEvent)
 
void onSmithRightUp (wxMouseEvent &aEvent)
 
void onSmithMenuCommand (wxCommandEvent &aEvent)
 
bool getSmithView (SMITH_VIEW &aView) const
 
void initializeGraphicsContext ()
 

Private Attributes

SIM_PLOT_TABm_plotTab
 
SMITH_GRIDm_smithGrid
 
bool m_smithChart
 
double m_smithZoom
 
wxRealPoint m_smithPan
 
bool m_smithPanning
 
bool m_smithLeftSkipped
 
wxPoint m_smithPanLast
 
wxPoint m_smithMenuPos
 

Detailed Description

A single stacked plot area within a SIM_PLOT_TAB.

All the SIM_VIEWs of a tab share the same (synchronized) X axis range, but each has its own independent set of Y axes (voltage/current/power), legend, and grid/data-range state.

Definition at line 356 of file sim_plot_tab.h.

Member Enumeration Documentation

◆ MouseWheelAction

enum class mpWindow::MouseWheelAction
stronginherited

Enumerates the possible mouse wheel actions that can be performed on the plot.

Enumerator
NONE 
PAN_LEFT_RIGHT 
PAN_RIGHT_LEFT 
PAN_UP_DOWN 
ZOOM 
ZOOM_HORIZONTALLY 
ZOOM_VERTICALLY 
COUNT 

Definition at line 958 of file mathplot.h.

Constructor & Destructor Documentation

◆ SIM_VIEW()

Member Function Documentation

◆ AddLayer()

bool mpWindow::AddLayer ( mpLayer * layer,
bool refreshDisplay = true )
inherited

Add a plot layer to the canvas.

Parameters
layerPointer to layer. The mpLayer object will get under control of mpWindow, i.e. it will be delete'd on mpWindow destruction
refreshDisplayStates whether to refresh the display (UpdateAll) after adding the layer.
Return values
trueSuccess
falseFailure due to out of memory.

Definition at line 2109 of file mathplot.cpp.

References m_layers, and UpdateAll().

Referenced by SIM_PLOT_TAB::AddView(), SIM_PLOT_TAB::EnableCursor(), SIM_VIEW::EnsureThirdYAxisExists(), SIM_PLOT_TAB::GetOrAddTrace(), onMouseLeftDown(), SIM_VIEW::prepareDCAxes(), SIM_VIEW::SetSmithChart(), and SIM_VIEW::updateAxes().

◆ AdjustLimitedView()

void mpWindow::AdjustLimitedView ( wxOrientation directions = wxBOTH)
inherited

Limits the zoomed or panned view to the area used by the plots.

Definition at line 1845 of file mathplot.cpp.

References m_desiredXmax, m_desiredXmin, m_desiredYmax, m_desiredYmin, m_enableLimitedView, m_maxX, m_maxY, m_minX, m_minY, m_posX, and m_posY.

Referenced by DoZoom(), SetXView(), SetYView(), ZoomRect(), ZoomRedo(), and ZoomUndo().

◆ CountAllLayers()

unsigned int mpWindow::CountAllLayers ( ) const
inlineinherited

Counts the number of plot layers, whether or not they have a bounding box.

Returns
The number of layers in the mpWindow.

Definition at line 1195 of file mathplot.h.

References m_layers.

Referenced by mpInfoLegend::Plot().

◆ defaultMouseWheelActions()

◆ DelAllLayers()

void mpWindow::DelAllLayers ( bool alsoDeleteObject,
bool refreshDisplay = true )
inherited

Remove all layers from the plot.

Parameters
alsoDeleteObjectIf set to true, the mpLayer objects will be also "deleted", not just removed from the internal list.
refreshDisplayStates whether to refresh the display (UpdateAll) after removing the layers.

Definition at line 2150 of file mathplot.cpp.

References m_layers, and UpdateAll().

Referenced by ~mpWindow().

◆ DelLayer()

bool mpWindow::DelLayer ( mpLayer * layer,
bool alsoDeleteObject = false,
bool refreshDisplay = true )
inherited

Remove a plot layer from the canvas.

Parameters
layerPointer to layer. The mpLayer object will be destructed using delete.
alsoDeleteObjectIf set to true, the mpLayer object will be also "deleted", not just removed from the internal list.
refreshDisplayStates whether to refresh the display (UpdateAll) after removing the layer.
Returns
true if layer is deleted correctly

N.B. Only the layer reference in the mpWindow is deleted, the layer object still exists!

Definition at line 2125 of file mathplot.cpp.

References m_layers, and UpdateAll().

Referenced by onMouseLeftDown().

◆ DoZoom()

void mpWindow::DoZoom ( const wxPoint & centerPoint,
double zoomFactor,
wxOrientation directions )
protectedinherited

◆ EnableDoubleBuffer()

void mpWindow::EnableDoubleBuffer ( bool enabled)
inlineinherited

Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).

Definition at line 1144 of file mathplot.h.

References m_enableDoubleBuffer.

Referenced by SIM_PLOT_TAB::AddView().

◆ EnableMousePanZoom()

void mpWindow::EnableMousePanZoom ( bool enabled)
inlineinherited

Enable/disable the feature of pan/zoom with the mouse (default=enabled)

Definition at line 1148 of file mathplot.h.

References m_enableMouseNavigation.

◆ EnsureThirdYAxisExists()

void SIM_VIEW::EnsureThirdYAxisExists ( )

◆ Fit() [1/2]

void mpWindow::Fit ( )
overrideinherited

Set view to fit global bounding box of all plot layers and refresh display.

Scale and position will be set to show all attached mpLayers. The X/Y scale aspect lock is taken into account.

Definition at line 1744 of file mathplot.cpp.

References Fit(), m_maxX, m_maxY, m_minX, m_minY, and UpdateBBox().

Referenced by DoZoom(), Fit(), OnFit(), OnSize(), SaveScreenshot(), ZoomRect(), ZoomRedo(), and ZoomUndo().

◆ Fit() [2/2]

void mpWindow::Fit ( double xMin,
double xMax,
double yMin,
double yMax,
const wxCoord * printSizeX = nullptr,
const wxCoord * printSizeY = nullptr,
wxOrientation directions = wxBOTH )
inherited

Set view to fit a given bounding box and refresh display.

The X/Y scale aspect lock is taken into account. If provided, the parameters printSizeX and printSizeY are taken as the DC size, and the pixel scales are computed accordingly. Also, in this case the passed borders are not saved as the "desired borders", since this use will be invoked only when printing.

Definition at line 1752 of file mathplot.cpp.

References m_desiredXmax, m_desiredXmin, m_desiredYmax, m_desiredYmin, m_leftRightPlotGapFactor, m_marginBottom, m_marginLeft, m_marginRight, m_marginTop, m_posX, m_posY, m_scaleX, m_scaleY, m_scrX, m_scrY, m_topBottomPlotGapFactor, OnXViewChanged(), and UpdateAll().

◆ GetAxesColour()

const wxColour & mpWindow::GetAxesColour ( )
inlineinherited

Get axes draw colour.

Returns
reference to axis colour used in theme

Definition at line 1300 of file mathplot.h.

References m_axColour.

◆ GetAxisBySlot()

mpScaleY * SIM_VIEW::GetAxisBySlot ( int aSlot) const

Definition at line 1473 of file sim_plot_tab.cpp.

References m_axis_y1, m_axis_y2, and m_axis_y3.

◆ GetAxisSlot()

int SIM_VIEW::GetAxisSlot ( TRACE * aTrace) const

Get the Y-axis scale object for a given slot (1, 2 or 3), or nullptr if not created yet.

Definition at line 1455 of file sim_plot_tab.cpp.

References TRACE::GetType(), m_plotTab, SPT_AC_PHASE, SPT_CURRENT, SPT_POWER, and ST_AC.

◆ GetBoundingBox()

void mpWindow::GetBoundingBox ( double * bbox) const
inherited

Returns the bounding box coordinates.

Parameters
bboxPointer to a 6-element double array where to store bounding box coordinates.

Definition at line 2485 of file mathplot.cpp.

References m_maxX, m_maxY, m_minX, and m_minY.

◆ GetDesiredXmax()

double mpWindow::GetDesiredXmax ( ) const
inlineinherited

Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).

See also
Fit

Definition at line 1207 of file mathplot.h.

References m_desiredXmax.

Referenced by SIM_PLOT_TAB::SyncXView().

◆ GetDesiredXmin()

double mpWindow::GetDesiredXmin ( ) const
inlineinherited

Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).

See also
Fit

Definition at line 1201 of file mathplot.h.

References m_desiredXmin.

Referenced by SIM_PLOT_TAB::SyncXView().

◆ GetDesiredYmax()

double mpWindow::GetDesiredYmax ( ) const
inlineinherited

Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).

See also
Fit

Definition at line 1219 of file mathplot.h.

References m_desiredYmax.

◆ GetDesiredYmin()

double mpWindow::GetDesiredYmin ( ) const
inlineinherited

Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).

See also
Fit

Definition at line 1213 of file mathplot.h.

References m_desiredYmin.

◆ GetLabelX()

wxString SIM_VIEW::GetLabelX ( ) const
inline

Definition at line 372 of file sim_plot_tab.h.

References m_axis_x.

Referenced by SIM_PLOT_TAB::GetLabelX().

◆ GetLabelY1()

wxString SIM_VIEW::GetLabelY1 ( ) const
inline

Definition at line 374 of file sim_plot_tab.h.

References m_axis_y1.

Referenced by SIM_PLOT_TAB::GetLabelY1().

◆ GetLabelY2()

wxString SIM_VIEW::GetLabelY2 ( ) const
inline

Definition at line 376 of file sim_plot_tab.h.

References m_axis_y2.

Referenced by SIM_PLOT_TAB::GetLabelY2().

◆ GetLabelY3()

wxString SIM_VIEW::GetLabelY3 ( ) const
inline

Definition at line 378 of file sim_plot_tab.h.

References m_axis_y3.

Referenced by SIM_PLOT_TAB::GetLabelY3().

◆ GetLayer()

mpLayer * mpWindow::GetLayer ( int position) const
inherited

Get the layer in list position indicated. N.B. You must know the index of the layer inside the list!

Parameters
positionposition of the layer in the layers list
Returns
pointer to mpLayer

Definition at line 2464 of file mathplot.cpp.

References m_layers.

Referenced by IsLayerVisible(), mpInfoLegend::Plot(), and SetLayerVisible().

◆ GetLayerByName() [1/2]

mpLayer * mpWindow::GetLayerByName ( const wxString & name)
inlineinherited

Definition at line 1039 of file mathplot.h.

References mpWindow(), and name.

◆ GetLayerByName() [2/2]

const mpLayer * mpWindow::GetLayerByName ( const wxString & name) const
inherited

Get the layer by its name (case sensitive).

Parameters
nameThe name of the layer to retrieve
Returns
A pointer to the mpLayer object, or NULL if not found.

Definition at line 2473 of file mathplot.cpp.

References m_layers, and name.

Referenced by IsLayerVisible(), and SetLayerVisible().

◆ GetLegendPosition()

wxPoint SIM_VIEW::GetLegendPosition ( ) const
inline

Definition at line 455 of file sim_plot_tab.h.

References m_legend.

Referenced by SIM_PLOT_TAB::GetLegendPosition().

◆ GetMarginBottom()

int mpWindow::GetMarginBottom ( ) const
inlineinherited

◆ GetMarginLeft()

int mpWindow::GetMarginLeft ( ) const
inlineinherited

◆ GetMarginRight()

int mpWindow::GetMarginRight ( ) const
inlineinherited

◆ GetMarginTop()

int mpWindow::GetMarginTop ( ) const
inlineinherited

◆ GetPlotTab()

SIM_PLOT_TAB * SIM_VIEW::GetPlotTab ( ) const
inline

Definition at line 370 of file sim_plot_tab.h.

References m_plotTab.

◆ GetPopupMenu()

wxMenu * mpWindow::GetPopupMenu ( )
inlineinherited

Get reference to context menu of the plot canvas.

Returns
Pointer to menu. The menu can be modified.

Definition at line 994 of file mathplot.h.

References m_popmenu.

Referenced by SIM_VIEW::onSmithRightUp().

◆ GetPosX()

double mpWindow::GetPosX ( ) const
inlineinherited

Get current view's X position.

See rules for coordinate transformation

Returns
X Position in layer coordinate system, that corresponds to the center point of the view.

Definition at line 1060 of file mathplot.h.

References m_posX.

Referenced by mpScaleXBase::Plot(), and SIM_PLOT_TAB::SyncXView().

◆ GetPosY()

double mpWindow::GetPosY ( ) const
inlineinherited

Get current view's Y position.

See rules for coordinate transformation

Returns
Y Position in layer coordinate system, that corresponds to the center point of the view.

Definition at line 1066 of file mathplot.h.

References m_posY.

Referenced by mpScaleY::Plot().

◆ GetScaleX()

double mpWindow::GetScaleX ( ) const
inlineinherited

Get current view's X scale.

See rules for coordinate transformation

Returns
Scale

Definition at line 1048 of file mathplot.h.

References m_scaleX.

Referenced by mpScaleXBase::Plot(), and SIM_PLOT_TAB::SyncXView().

◆ GetScaleY()

double mpWindow::GetScaleY ( ) const
inlineinherited

Get current view's Y scale.

See rules for coordinate transformation

Returns
Scale

Definition at line 1054 of file mathplot.h.

References m_scaleY.

Referenced by mpScaleY::Plot().

◆ GetScrX()

int mpWindow::GetScrX ( ) const
inlineinherited

Get current view's X dimension in device context units.

Usually this is equal to wxDC::GetSize, but it might differ thus mpLayer implementations should rely on the value returned by the function. See rules for coordinate transformation

Returns
X dimension.

Definition at line 1074 of file mathplot.h.

References m_scrX.

Referenced by SMITH_GRID::GetChartView(), mpScaleXBase::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFXY::Plot(), mpFY::Plot(), mpInfoLayer::Plot(), mpInfoLegend::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), SMITH_CURSOR::Plot(), and SIMULATOR_CONTROL::Zoom().

◆ GetScrY()

int mpWindow::GetScrY ( ) const
inlineinherited

Get current view's Y dimension in device context units.

Usually this is equal to wxDC::GetSize, but it might differ thus mpLayer implementations should rely on the value returned by the function. See rules for coordinate transformation

Returns
Y dimension.

Definition at line 1083 of file mathplot.h.

References m_scrY.

Referenced by SMITH_GRID::GetChartView(), mpScaleY::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFXY::Plot(), mpFY::Plot(), mpInfoLayer::Plot(), mpInfoLegend::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), SMITH_CURSOR::Plot(), and SIMULATOR_CONTROL::Zoom().

◆ GetSmithPan()

const wxRealPoint & SIM_VIEW::GetSmithPan ( ) const
inline

Definition at line 489 of file sim_plot_tab.h.

References m_smithPan.

Referenced by SIM_PLOT_TAB::GetSmithPan(), and smithView().

◆ getSmithView()

bool SIM_VIEW::getSmithView ( SMITH_VIEW & aView) const
private

◆ GetSmithZoom()

double SIM_VIEW::GetSmithZoom ( ) const
inline

Definition at line 488 of file sim_plot_tab.h.

References m_smithZoom.

Referenced by SIM_PLOT_TAB::GetSmithZoom(), and smithView().

◆ GetUnitsForTrace()

wxString SIM_VIEW::GetUnitsForTrace ( TRACE * aTrace) const

Get the Y-axis slot (1, 2 or 3) a trace of this type is plotted on.

Definition at line 1434 of file sim_plot_tab.cpp.

References TRACE::GetType(), GetUnitsY1(), GetUnitsY2(), GetUnitsY3(), m_plotTab, SPT_AC_PHASE, SPT_CURRENT, SPT_POWER, and ST_AC.

Referenced by SIM_PLOT_TAB::GetUnitsForTrace().

◆ GetUnitsX()

wxString SIM_VIEW::GetUnitsX ( ) const

Definition at line 1387 of file sim_plot_tab.cpp.

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

Referenced by SIM_PLOT_TAB::GetUnitsX().

◆ GetUnitsY1()

wxString SIM_VIEW::GetUnitsY1 ( ) const

Definition at line 1401 of file sim_plot_tab.cpp.

References LIN_SCALE< T_PARENT >::GetUnits(), and m_axis_y1.

Referenced by GetUnitsForTrace(), and SIM_PLOT_TAB::GetUnitsY1().

◆ GetUnitsY2()

wxString SIM_VIEW::GetUnitsY2 ( ) const

Definition at line 1412 of file sim_plot_tab.cpp.

References LIN_SCALE< T_PARENT >::GetUnits(), and m_axis_y2.

Referenced by GetUnitsForTrace(), and SIM_PLOT_TAB::GetUnitsY2().

◆ GetUnitsY3()

wxString SIM_VIEW::GetUnitsY3 ( ) const

Get the display units (e.g. "V", "A", "dB") for a given trace plotted on this view.

Definition at line 1423 of file sim_plot_tab.cpp.

References LIN_SCALE< T_PARENT >::GetUnits(), and m_axis_y3.

Referenced by GetUnitsForTrace(), and SIM_PLOT_TAB::GetUnitsY3().

◆ GetXScreen()

int mpWindow::GetXScreen ( ) const
inlineinherited

◆ GetY1Scale()

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

Definition at line 380 of file sim_plot_tab.h.

References m_axis_y1.

Referenced by SIM_PLOT_TAB::GetY1Scale().

◆ GetY2Scale()

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

Definition at line 388 of file sim_plot_tab.h.

References m_axis_y2.

Referenced by SIM_PLOT_TAB::GetY2Scale().

◆ GetY3Scale()

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

Definition at line 396 of file sim_plot_tab.h.

References m_axis_y3.

Referenced by SIM_PLOT_TAB::GetY3Scale().

◆ GetYLocked()

bool mpWindow::GetYLocked ( ) const
inlineinherited

Definition at line 1309 of file mathplot.h.

References m_yLocked.

◆ GetYScreen()

int mpWindow::GetYScreen ( ) const
inlineinherited

Definition at line 1084 of file mathplot.h.

References m_scrY.

Referenced by mpScaleY::recalculateTicks().

◆ initializeGraphicsContext()

void mpWindow::initializeGraphicsContext ( )
privateinherited

Definition at line 2678 of file mathplot.cpp.

References m_buff_dc.

Referenced by mpWindow(), and mpWindow().

◆ IsGridShown()

bool SIM_VIEW::IsGridShown ( ) const
inline

Definition at line 439 of file sim_plot_tab.h.

References m_axis_x, and m_axis_y1.

Referenced by SIM_PLOT_TAB::IsGridShown().

◆ IsInsideInfoLayer()

mpInfoLayer * mpWindow::IsInsideInfoLayer ( wxPoint & point)
inherited

Check if a given point is inside the area of a mpInfoLayer and eventually returns its pointer.

Parameters
pointThe position to be checked
Returns
If an info layer is found, returns its pointer, NULL otherwise

Definition at line 2554 of file mathplot.cpp.

References mpInfoLayer::Inside(), and m_layers.

Referenced by onMouseLeftDClick(), onMouseLeftDown(), SIM_VIEW::onSmithDClick(), and SIM_VIEW::onSmithLeftDown().

◆ IsLayerVisible() [1/2]

bool mpWindow::IsLayerVisible ( const wxString & name) const
inherited

Check whether a layer with given name is visible.

Parameters
nameThe layer name
Returns
layer visibility status

Definition at line 2581 of file mathplot.cpp.

References GetLayerByName(), mpLayer::IsVisible(), and name.

◆ IsLayerVisible() [2/2]

bool mpWindow::IsLayerVisible ( unsigned int position) const
inherited

Check whether the layer at given position is visible.

Parameters
positionThe layer position in layer list
Returns
layer visibility status

Definition at line 2600 of file mathplot.cpp.

References GetLayer().

◆ IsLegendShown()

bool SIM_VIEW::IsLegendShown ( ) const
inline

Definition at line 453 of file sim_plot_tab.h.

References m_legend.

Referenced by SIM_PLOT_TAB::IsLegendShown().

◆ IsSmithChart()

bool SIM_VIEW::IsSmithChart ( ) const
inline

Refresh the grid z0 from the Smith traces shown on this view.

Definition at line 480 of file sim_plot_tab.h.

References m_smithChart.

◆ LimitView()

void mpWindow::LimitView ( bool aEnable)
inlineinherited

Enable limiting of zooming & panning to the area used by the plots.

Definition at line 1303 of file mathplot.h.

References m_enableLimitedView.

Referenced by SIM_PLOT_TAB::AddView().

◆ LockY()

void mpWindow::LockY ( bool aLock)
inlineinherited

Definition at line 1308 of file mathplot.h.

References m_yLocked.

Referenced by SIMULATOR_FRAME_UI::loadJsonWorkbook().

◆ OnCenter()

void mpWindow::OnCenter ( wxCommandEvent & event)
inherited

◆ OnFit()

void mpWindow::OnFit ( wxCommandEvent & event)
inherited

Definition at line 2049 of file mathplot.cpp.

References Fit(), m_desiredXmax, m_desiredXmin, m_desiredYmax, m_desiredYmin, and pushZoomUndo().

◆ onMagnify()

void mpWindow::onMagnify ( wxMouseEvent & event)
protectedinherited

Definition at line 1527 of file mathplot.cpp.

References m_enableMouseNavigation, zoom, ZoomIn(), and ZoomOut().

◆ onMouseLeftDClick()

void mpWindow::onMouseLeftDClick ( wxMouseEvent & event)
protectedinherited

Definition at line 1705 of file mathplot.cpp.

References IsInsideInfoLayer(), and UpdateAll().

◆ onMouseLeftDown()

void mpWindow::onMouseLeftDown ( wxMouseEvent & event)
protectedinherited

◆ onMouseLeftRelease()

void mpWindow::onMouseLeftRelease ( wxMouseEvent & event)
protectedinherited

Definition at line 1722 of file mathplot.cpp.

References m_mouseLClick, m_movingInfoLayer, m_zooming, and ZoomRect().

◆ OnMouseMiddleDown()

void mpWindow::OnMouseMiddleDown ( wxMouseEvent & event)
protectedinherited

Definition at line 1520 of file mathplot.cpp.

References m_mouseMClick.

◆ onMouseMove()

◆ onMouseWheel()

void mpWindow::onMouseWheel ( wxMouseEvent & event)
protectedinherited

◆ OnPaint()

void mpWindow::OnPaint ( wxPaintEvent & event)
protectedinherited

◆ OnShowPopupMenu()

void mpWindow::OnShowPopupMenu ( wxMouseEvent & event)
protectedinherited

◆ OnSize()

void mpWindow::OnSize ( wxSizeEvent & event)
protectedinherited

Definition at line 2102 of file mathplot.cpp.

References Fit(), m_desiredXmax, m_desiredXmin, m_desiredYmax, and m_desiredYmin.

◆ onSmithDClick()

void SIM_VIEW::onSmithDClick ( wxMouseEvent & aEvent)
private

Definition at line 2099 of file sim_plot_tab.cpp.

References mpWindow::IsInsideInfoLayer(), m_smithChart, and ResetSmithView().

Referenced by SIM_VIEW().

◆ onSmithLeftDown()

void SIM_VIEW::onSmithLeftDown ( wxMouseEvent & aEvent)
private

◆ onSmithLeftUp()

void SIM_VIEW::onSmithLeftUp ( wxMouseEvent & aEvent)
private

Definition at line 2081 of file sim_plot_tab.cpp.

References m_smithChart, m_smithLeftSkipped, and m_smithPanning.

Referenced by SIM_VIEW().

◆ onSmithMagnify()

void SIM_VIEW::onSmithMagnify ( wxMouseEvent & aEvent)
private

Definition at line 2008 of file sim_plot_tab.cpp.

References m_smithChart, and SmithZoomAt().

Referenced by SIM_VIEW().

◆ onSmithMenuCommand()

void SIM_VIEW::onSmithMenuCommand ( wxCommandEvent & aEvent)
private

◆ onSmithMiddleDown()

void SIM_VIEW::onSmithMiddleDown ( wxMouseEvent & aEvent)
private

Definition at line 2023 of file sim_plot_tab.cpp.

References m_smithChart.

Referenced by SIM_VIEW().

◆ onSmithMotion()

void SIM_VIEW::onSmithMotion ( wxMouseEvent & aEvent)
private

Definition at line 2053 of file sim_plot_tab.cpp.

References m_smithChart, m_smithLeftSkipped, m_smithPanLast, m_smithPanning, and SmithPanBy().

Referenced by SIM_VIEW().

◆ onSmithMouseWheel()

void SIM_VIEW::onSmithMouseWheel ( wxMouseEvent & aEvent)
private

Definition at line 1991 of file sim_plot_tab.cpp.

References m_smithChart, and SmithZoomAt().

Referenced by SIM_VIEW().

◆ onSmithRightDown()

void SIM_VIEW::onSmithRightDown ( wxMouseEvent & aEvent)
private

Definition at line 2114 of file sim_plot_tab.cpp.

References m_smithChart, and m_smithMenuPos.

Referenced by SIM_VIEW().

◆ onSmithRightUp()

void SIM_VIEW::onSmithRightUp ( wxMouseEvent & aEvent)
private

Definition at line 2124 of file sim_plot_tab.cpp.

References mpWindow::GetPopupMenu(), m_smithChart, mpID_ZOOM_REDO, and mpID_ZOOM_UNDO.

Referenced by SIM_VIEW().

◆ OnXViewChanged()

void SIM_VIEW::OnXViewChanged ( )
overridevirtual

Directly set this view's X range (used to mirror another view's zoom/pan onto this one).

Reimplemented from mpWindow.

Definition at line 1359 of file sim_plot_tab.cpp.

References m_plotTab.

◆ onZoomIn()

void mpWindow::onZoomIn ( wxCommandEvent & event)
protectedinherited

Definition at line 2078 of file mathplot.cpp.

References m_mouseMClick, and ZoomIn().

◆ onZoomOut()

void mpWindow::onZoomOut ( wxCommandEvent & event)
protectedinherited

Definition at line 2084 of file mathplot.cpp.

References ZoomOut().

◆ onZoomRedo()

void mpWindow::onZoomRedo ( wxCommandEvent & event)
protectedinherited

Definition at line 2096 of file mathplot.cpp.

References ZoomRedo().

◆ onZoomUndo()

void mpWindow::onZoomUndo ( wxCommandEvent & event)
protectedinherited

Definition at line 2090 of file mathplot.cpp.

References ZoomUndo().

◆ p2x()

double mpWindow::p2x ( wxCoord pixelCoordX)
inlineinherited

Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.

See also
p2y,x2p,y2p

Definition at line 1127 of file mathplot.h.

References m_posX, and m_scaleX.

Referenced by DoZoom(), mpScaleXBase::getVisibleDataRange(), OnCenter(), CURSOR::Plot(), mpFX::Plot(), and ZoomRect().

◆ p2y()

double mpWindow::p2y ( wxCoord pixelCoordY)
inlineinherited

Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.

See also
p2x,x2p,y2p

Definition at line 1131 of file mathplot.h.

References m_posY, and m_scaleY.

Referenced by DoZoom(), mpScaleY::getVisibleDataRange(), OnCenter(), mpFY::Plot(), and ZoomRect().

◆ PerformMouseWheelAction()

void mpWindow::PerformMouseWheelAction ( wxMouseEvent & event,
MouseWheelAction action )
protectedinherited

◆ prepareDCAxes()

void SIM_VIEW::prepareDCAxes ( int aNewTraceType)
private

<

Construct the plot axes for DC simulation plot.

Definition at line 1652 of file sim_plot_tab.cpp.

References _, mpWindow::AddLayer(), EnsureThirdYAxisExists(), m_axis_x, m_axis_y1, m_axis_y2, m_axis_y3, m_plotTab, mpALIGN_BOTTOM, mpALIGN_LEFT, mpALIGN_RIGHT, and SPT_POWER.

Referenced by updateAxes().

◆ pushZoomUndo()

void mpWindow::pushZoomUndo ( const std::array< double, 4 > & aZoom)
protectedinherited

Definition at line 1998 of file mathplot.cpp.

References m_redoZoomStack, and m_undoZoomStack.

Referenced by DoZoom(), OnFit(), and ZoomRect().

◆ RecomputeDesiredX()

void mpWindow::RecomputeDesiredX ( double & min,
double & max )
protectedinherited

Definition at line 2322 of file mathplot.cpp.

References m_desiredXmin, m_leftRightPlotGapFactor, m_marginLeft, m_marginRight, m_posX, m_scaleX, and m_scrX.

Referenced by DoZoom().

◆ RecomputeDesiredY()

void mpWindow::RecomputeDesiredY ( double & min,
double & max )
protectedinherited

Definition at line 2333 of file mathplot.cpp.

References m_desiredYmax, m_marginBottom, m_marginTop, m_posY, m_scaleY, m_scrY, and m_topBottomPlotGapFactor.

Referenced by DoZoom().

◆ RedoZoomStackSize()

int mpWindow::RedoZoomStackSize ( ) const
inlineinherited

Definition at line 1314 of file mathplot.h.

References m_redoZoomStack.

Referenced by SIMULATOR_FRAME::setupUIConditions().

◆ ResetScales()

void SIM_VIEW::ResetScales ( bool aIncludeX)

Create/Ensure axes are available for plotting.

Definition at line 1829 of file sim_plot_tab.cpp.

References end, m_axis_x, m_axis_y1, m_axis_y2, m_axis_y3, m_plotTab, name, ST_TRAN, and SPICE_VALUE::ToDouble().

◆ ResetSmithView()

void SIM_VIEW::ResetSmithView ( )
inline

Definition at line 491 of file sim_plot_tab.h.

References m_smithPan, and m_smithZoom.

Referenced by onSmithDClick(), onSmithMenuCommand(), SetSmithChart(), and SmithZoomAt().

◆ SaveScreenshot()

bool mpWindow::SaveScreenshot ( wxImage & aImage,
wxSize aImageSize = wxDefaultSize,
bool aFit = false )
inherited

Draw the window on a wxBitmap, then save it to a file.

Parameters
aImagea wxImage where to save the screenshot
aImageSizeSet a size for the output image. Default is the same as the screen size
aFitDecide whether to fit the plot into the size

Definition at line 2494 of file mathplot.cpp.

References Fit(), m_desiredXmax, m_desiredXmin, m_desiredYmax, m_desiredYmin, m_fgColour, m_layers, m_maxX, m_maxY, m_minX, m_minY, m_scrX, m_scrY, SetScr(), and UpdateAll().

◆ SetColourTheme()

void mpWindow::SetColourTheme ( const wxColour & bgColour,
const wxColour & drawColour,
const wxColour & axesColour )
inherited

Set Color theme.

Provide colours to set a new colour theme.

Parameters
bgColourBackground colour
drawColourThe colour used to draw all elements in foreground, axes excluded
axesColourThe colour used to draw axes (but not their labels)

Definition at line 2609 of file mathplot.cpp.

References m_axColour, m_bgColour, m_fgColour, m_layers, mpLAYER_AXIS, and mpLAYER_INFO.

◆ SetLayerVisible() [1/2]

void mpWindow::SetLayerVisible ( const unsigned int position,
bool viewable )
inherited

Sets the visibility of a layer by its position in layer list.

Parameters
positionThe layer position in layer list
viewablethe view status to be set

Definition at line 2590 of file mathplot.cpp.

References GetLayer(), and UpdateAll().

◆ SetLayerVisible() [2/2]

void mpWindow::SetLayerVisible ( const wxString & name,
bool viewable )
inherited

Sets the visibility of a layer by its name.

Parameters
nameThe layer name to set visibility
viewablethe view status to be set

Definition at line 2571 of file mathplot.cpp.

References GetLayerByName(), name, and UpdateAll().

◆ SetLegendPosition()

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

Reset the Y (and, if requested, X) scale ranges to fit this view's own traces.

Definition at line 457 of file sim_plot_tab.h.

References m_lastLegendPosition, and m_legend.

◆ SetMarginBottom()

void mpWindow::SetMarginBottom ( int bottom)
inlineinherited

Set the bottom margin.

Parameters
bottomBottom Margin

Definition at line 1253 of file mathplot.h.

References m_marginBottom.

◆ SetMarginLeft()

void mpWindow::SetMarginLeft ( int left)
inlineinherited

Set the left margin.

Parameters
leftLeft Margin

Definition at line 1255 of file mathplot.h.

References left, and m_marginLeft.

◆ SetMarginRight()

void mpWindow::SetMarginRight ( int right)
inlineinherited

Set the right margin.

Parameters
rightRight Margin

Definition at line 1251 of file mathplot.h.

References m_marginRight, and right.

◆ SetMargins()

void mpWindow::SetMargins ( int top,
int right,
int bottom,
int left )
inherited

Set window margins, creating a blank area where some kinds of layers cannot draw.

This is useful for example to draw axes outside the area where the plots are drawn.

Parameters
topTop border
rightRight border
bottomBottom border
leftLeft border

Definition at line 2545 of file mathplot.cpp.

References left, m_marginBottom, m_marginLeft, m_marginRight, m_marginTop, right, and top().

Referenced by SIM_PLOT_TAB::AddView(), SIM_VIEW::EnsureThirdYAxisExists(), SIMULATOR_FRAME_UI::loadJsonWorkbook(), and SIM_VIEW::updateAxes().

◆ SetMarginTop()

void mpWindow::SetMarginTop ( int top)
inlineinherited

Set the top margin.

Parameters
topTop Margin

Definition at line 1249 of file mathplot.h.

References m_marginTop, and top().

◆ SetMouseWheelActions()

void mpWindow::SetMouseWheelActions ( const MouseWheelActionSet & s)
inlineinherited

Set the pan/zoom actions corresponding to mousewheel/trackpad events.

Definition at line 1151 of file mathplot.h.

References m_mouseWheelActions.

Referenced by SIM_PLOT_TAB::AddView().

◆ SetPos()

void mpWindow::SetPos ( double posX,
double posY )
inlineinherited

Set current view's X and Y position and refresh display.

Parameters
posXNew position that corresponds to the center point of the view.
posYNew position that corresponds to the center point of the view.

Definition at line 1116 of file mathplot.h.

References m_posX, m_posY, and UpdateAll().

Referenced by OnCenter().

◆ SetPosX()

void mpWindow::SetPosX ( double posX)
inlineinherited

Set current view's X position and refresh display.

Parameters
posXNew position that corresponds to the center point of the view.

Definition at line 1105 of file mathplot.h.

References m_posX, and UpdateAll().

◆ SetPosY()

void mpWindow::SetPosY ( double posY)
inlineinherited

Set current view's Y position and refresh display.

Parameters
posYNew position that corresponds to the center point of the view.

Definition at line 1110 of file mathplot.h.

References m_posY, and UpdateAll().

◆ SetScaleX()

void mpWindow::SetScaleX ( double scaleX)
inherited

Set current view's X scale and refresh display.

Parameters
scaleXNew scale, must not be 0.

Definition at line 2453 of file mathplot.cpp.

References m_scaleX, and UpdateAll().

◆ SetScaleY()

void mpWindow::SetScaleY ( double scaleY)
inlineinherited

Set current view's Y scale and refresh display.

Parameters
scaleYNew scale, must not be 0.

Definition at line 1094 of file mathplot.h.

References m_scaleY, and UpdateAll().

◆ SetScr()

void mpWindow::SetScr ( int scrX,
int scrY )
inlineinherited

Set current view's dimensions in device context units.

Needed by plotting functions. It doesn't refresh display.

Parameters
scrXNew position that corresponds to the center point of the view.
scrYNew position that corresponds to the center point of the view.

Definition at line 1123 of file mathplot.h.

References m_scrX, and m_scrY.

Referenced by SaveScreenshot().

◆ SetSmithChart()

void SIM_VIEW::SetSmithChart ( bool aEnable)

< Show/hide this view's Smith chart overlay.

The mode itself is owned by the tab; each view keeps its own grid layer and pan/zoom so the stacked charts stay independent.

Definition at line 1876 of file sim_plot_tab.cpp.

References mpWindow::AddLayer(), SIM_PLOT_COLORS::AXIS, KIUI::GetStatusFont(), m_plotTab, m_smithChart, m_smithGrid, m_smithLeftSkipped, m_smithPanning, ResetSmithView(), mpWindow::UpdateAll(), UpdateAxisVisibility(), and UpdateSmithReferenceImpedance().

Referenced by SIM_PLOT_TAB::AddView().

◆ SetSmithView()

void SIM_VIEW::SetSmithView ( double aZoom,
double aPanX,
double aPanY )
inline

Definition at line 497 of file sim_plot_tab.h.

References m_smithPan, and m_smithZoom.

◆ SetXRange()

void SIM_VIEW::SetXRange ( double aPos,
double aDesiredMax,
double aDesiredMin )
inline

Definition at line 365 of file sim_plot_tab.h.

References mpWindow::SetXView().

◆ SetXView()

bool mpWindow::SetXView ( double pos,
double desiredMax,
double desiredMin )
protectedvirtualinherited

Applies new X view coordinates depending on the settings.

Returns
true if the changes were applied

Definition at line 1893 of file mathplot.cpp.

References AdjustLimitedView(), m_desiredXmax, m_desiredXmin, m_posX, and OnXViewChanged().

Referenced by onMouseMove(), PerformMouseWheelAction(), and SIM_VIEW::SetXRange().

◆ SetY1Scale()

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

Definition at line 1366 of file sim_plot_tab.cpp.

References m_axis_y1.

◆ SetY2Scale()

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

Definition at line 1373 of file sim_plot_tab.cpp.

References m_axis_y2.

◆ SetY3Scale()

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

Definition at line 1380 of file sim_plot_tab.cpp.

References m_axis_y3.

◆ SetYView()

bool mpWindow::SetYView ( double pos,
double desiredMax,
double desiredMin )
protectedvirtualinherited

Applies new Y view coordinates depending on the settings.

Returns
true if the changes were applied

Definition at line 1909 of file mathplot.cpp.

References AdjustLimitedView(), m_desiredYmax, m_desiredYmin, and m_posY.

Referenced by onMouseMove(), and PerformMouseWheelAction().

◆ ShowGrid()

void SIM_VIEW::ShowGrid ( bool aEnable)
inline

Definition at line 422 of file sim_plot_tab.h.

References m_axis_x, m_axis_y1, m_axis_y2, m_axis_y3, and mpWindow::UpdateAll().

◆ ShowLegend()

void SIM_VIEW::ShowLegend ( bool aEnable)
inline

Definition at line 447 of file sim_plot_tab.h.

References m_legend, and mpWindow::UpdateAll().

◆ SmithPanBy()

void SIM_VIEW::SmithPanBy ( const wxPoint & aDelta)

Definition at line 1977 of file sim_plot_tab.cpp.

References getSmithView(), m_smithPan, and SMITH_VIEW::radius.

Referenced by onSmithMotion().

◆ SmithZoomAt()

void SIM_VIEW::SmithZoomAt ( const wxPoint & aPos,
double aFactor )

◆ UndoZoomStackSize()

int mpWindow::UndoZoomStackSize ( ) const
inlineinherited

Definition at line 1313 of file mathplot.h.

References m_undoZoomStack.

Referenced by SIMULATOR_FRAME::setupUIConditions().

◆ UpdateAll()

◆ updateAxes()

◆ UpdateAxisVisibility()

void SIM_VIEW::UpdateAxisVisibility ( )

◆ UpdateBBox()

bool mpWindow::UpdateBBox ( )
protectedvirtualinherited

Recalculate global layer bounding box, and save it in m_minX,...

Returns
true if there is any valid BBox information.

Definition at line 2435 of file mathplot.cpp.

References m_maxX, m_maxY, m_minX, and m_minY.

Referenced by Fit(), and UpdateAll().

◆ UpdateSmithGridColor()

void SIM_VIEW::UpdateSmithGridColor ( )

Definition at line 1940 of file sim_plot_tab.cpp.

References SIM_PLOT_COLORS::AXIS, m_plotTab, and m_smithGrid.

◆ UpdateSmithReferenceImpedance()

void SIM_VIEW::UpdateSmithReferenceImpedance ( )

Re-read the Smith grid pen from the tab's color theme.

Definition at line 1908 of file sim_plot_tab.cpp.

References SMITH_TRACE::GetReferenceImpedance(), TRACE::GetView(), m_plotTab, m_smithGrid, and name.

Referenced by SetSmithChart().

◆ ViewNeedsRefitting()

wxOrientation mpWindow::ViewNeedsRefitting ( wxOrientation directions) const
protectedinherited

◆ x2p()

wxCoord mpWindow::x2p ( double x)
inlineinherited

Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.

See also
p2x,p2y,y2p

Definition at line 1135 of file mathplot.h.

References m_posX, and m_scaleX.

Referenced by CURSOR::Plot(), mpFXY::Plot(), mpFY::Plot(), and mpScaleY::Plot().

◆ y2p()

wxCoord mpWindow::y2p ( double y)
inlineinherited

Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.

See also
p2x,p2y,x2p

Definition at line 1139 of file mathplot.h.

References m_posY, and m_scaleY.

Referenced by CURSOR::Plot(), mpFX::Plot(), mpFXY::Plot(), and mpScaleXBase::Plot().

◆ ZoomIn() [1/2]

void mpWindow::ZoomIn ( const wxPoint & centerPoint,
double zoomFactor,
wxOrientation directions = wxBOTH )
inherited

Definition at line 1926 of file mathplot.cpp.

References DoZoom().

◆ ZoomIn() [2/2]

void mpWindow::ZoomIn ( const wxPoint & centerPoint = wxDefaultPosition)
inherited

Zoom into current view and refresh display.

Parameters
centerPointThe point (pixel coordinates) that will stay in the same position on the screen after the zoom (by default, the center of the mpWindow).

Definition at line 1920 of file mathplot.cpp.

References ZoomIn(), and zoomIncrementalFactor.

Referenced by onMagnify(), onZoomIn(), PerformMouseWheelAction(), SIMULATOR_CONTROL::Zoom(), and ZoomIn().

◆ ZoomOut() [1/2]

void mpWindow::ZoomOut ( const wxPoint & centerPoint,
double zoomFactor,
wxOrientation directions = wxBOTH )
inherited

Definition at line 1938 of file mathplot.cpp.

References DoZoom().

◆ ZoomOut() [2/2]

void mpWindow::ZoomOut ( const wxPoint & centerPoint = wxDefaultPosition)
inherited

Zoom out current view and refresh display.

Parameters
centerPointThe point (pixel coordinates) that will stay in the same position on the screen after the zoom (by default, the center of the mpWindow).

Definition at line 1932 of file mathplot.cpp.

References zoomIncrementalFactor, and ZoomOut().

Referenced by onMagnify(), onZoomOut(), PerformMouseWheelAction(), SIMULATOR_CONTROL::Zoom(), and ZoomOut().

◆ ZoomRect()

void mpWindow::ZoomRect ( wxPoint p0,
wxPoint p1 )
inherited

Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order)

Definition at line 1947 of file mathplot.cpp.

References AdjustLimitedView(), Fit(), m_desiredXmax, m_desiredXmin, m_desiredYmax, m_desiredYmin, m_marginBottom, m_marginLeft, m_marginRight, m_marginTop, m_maxX, m_maxY, m_minX, m_minY, m_scrX, m_scrY, m_yLocked, p2x(), p2y(), pushZoomUndo(), and ViewNeedsRefitting().

Referenced by onMouseLeftRelease().

◆ ZoomRedo()

void mpWindow::ZoomRedo ( )
inherited

◆ ZoomUndo()

void mpWindow::ZoomUndo ( )
inherited

Member Data Documentation

◆ m_axColour

wxColour mpWindow::m_axColour
protectedinherited

Definition at line 1378 of file mathplot.h.

Referenced by GetAxesColour(), and SetColourTheme().

◆ m_axis_x

◆ m_axis_y1

◆ m_axis_y2

◆ m_axis_y3

◆ m_bgColour

wxColour mpWindow::m_bgColour
protectedinherited

Definition at line 1376 of file mathplot.h.

Referenced by mpWindow(), and SetColourTheme().

◆ m_buff_bmp

wxBitmap* mpWindow::m_buff_bmp
protectedinherited

Definition at line 1412 of file mathplot.h.

Referenced by mpWindow(), OnPaint(), and ~mpWindow().

◆ m_buff_dc

wxMemoryDC mpWindow::m_buff_dc
protectedinherited

Definition at line 1411 of file mathplot.h.

Referenced by initializeGraphicsContext(), and OnPaint().

◆ m_clickedX

int mpWindow::m_clickedX
protectedinherited

Definition at line 1390 of file mathplot.h.

Referenced by mpWindow(), OnCenter(), and OnShowPopupMenu().

◆ m_clickedY

int mpWindow::m_clickedY
protectedinherited

Definition at line 1391 of file mathplot.h.

Referenced by mpWindow(), OnCenter(), and OnShowPopupMenu().

◆ m_desiredXmax

◆ m_desiredXmin

double mpWindow::m_desiredXmin
protectedinherited

These are updated in Fit, ZoomIn, ZoomOut, ZoomRect, SetXView, SetYView and may be different from the real borders (layer coordinates) only if lock aspect ratio is true.

Note
They use the plot area as their coordinate system, and not the layer coordinate system used by m_posX/Y.

Definition at line 1401 of file mathplot.h.

Referenced by AdjustLimitedView(), DoZoom(), Fit(), GetDesiredXmin(), mpWindow(), OnFit(), onMouseMove(), OnSize(), PerformMouseWheelAction(), RecomputeDesiredX(), SaveScreenshot(), SetXView(), ViewNeedsRefitting(), ZoomRect(), ZoomRedo(), and ZoomUndo().

◆ m_desiredYmax

◆ m_desiredYmin

◆ m_enableDoubleBuffer

bool mpWindow::m_enableDoubleBuffer
protectedinherited

Definition at line 1413 of file mathplot.h.

Referenced by EnableDoubleBuffer(), mpWindow(), and OnPaint().

◆ m_enableLimitedView

bool mpWindow::m_enableLimitedView
protectedinherited

Definition at line 1415 of file mathplot.h.

Referenced by AdjustLimitedView(), LimitView(), mpWindow(), and ViewNeedsRefitting().

◆ m_enableMouseNavigation

bool mpWindow::m_enableMouseNavigation
protectedinherited

Definition at line 1414 of file mathplot.h.

Referenced by EnableMousePanZoom(), mpWindow(), onMagnify(), onMouseMove(), and onMouseWheel().

◆ m_fgColour

wxColour mpWindow::m_fgColour
protectedinherited

Definition at line 1377 of file mathplot.h.

Referenced by mpWindow(), onMouseMove(), OnPaint(), SaveScreenshot(), and SetColourTheme().

◆ m_last_lx

int mpWindow::m_last_lx
protectedinherited

Definition at line 1410 of file mathplot.h.

Referenced by mpWindow(), and OnPaint().

◆ m_last_ly

int mpWindow::m_last_ly
protectedinherited

Definition at line 1410 of file mathplot.h.

Referenced by mpWindow(), and OnPaint().

◆ m_lastLegendPosition

wxPoint SIM_VIEW::m_lastLegendPosition

Definition at line 508 of file sim_plot_tab.h.

Referenced by SIM_PLOT_TAB::AddView(), and SetLegendPosition().

◆ m_layers

◆ m_leftRightPlotGapFactor

double mpWindow::m_leftRightPlotGapFactor
protectedinherited

Definition at line 1406 of file mathplot.h.

Referenced by Fit(), mpWindow(), RecomputeDesiredX(), and ViewNeedsRefitting().

◆ m_legend

◆ m_marginBottom

int mpWindow::m_marginBottom
protectedinherited

◆ m_marginLeft

int mpWindow::m_marginLeft
protectedinherited

◆ m_marginRight

int mpWindow::m_marginRight
protectedinherited

◆ m_marginTop

int mpWindow::m_marginTop
protectedinherited

◆ m_maxX

double mpWindow::m_maxX
protectedinherited

◆ m_maxY

double mpWindow::m_maxY
protectedinherited

◆ m_minX

double mpWindow::m_minX
protectedinherited

◆ m_minY

double mpWindow::m_minY
protectedinherited

◆ m_mouseLClick

wxPoint mpWindow::m_mouseLClick
protectedinherited

Definition at line 1418 of file mathplot.h.

Referenced by onMouseLeftDown(), onMouseLeftRelease(), and onMouseMove().

◆ m_mouseMClick

wxPoint mpWindow::m_mouseMClick
protectedinherited

Definition at line 1417 of file mathplot.h.

Referenced by OnMouseMiddleDown(), onMouseMove(), and onZoomIn().

◆ m_mouseWheelActions

MouseWheelActionSet mpWindow::m_mouseWheelActions
protectedinherited

Definition at line 1416 of file mathplot.h.

Referenced by mpWindow(), onMouseWheel(), and SetMouseWheelActions().

◆ m_movingInfoLayer

mpInfoLayer* mpWindow::m_movingInfoLayer
protectedinherited

Definition at line 1419 of file mathplot.h.

Referenced by mpWindow(), onMouseLeftDown(), onMouseLeftRelease(), and onMouseMove().

◆ m_plotTab

◆ m_popmenu

wxMenu mpWindow::m_popmenu
protectedinherited

Definition at line 1375 of file mathplot.h.

Referenced by GetPopupMenu(), mpWindow(), and OnShowPopupMenu().

◆ m_posX

double mpWindow::m_posX
protectedinherited

◆ m_posY

double mpWindow::m_posY
protectedinherited

◆ m_redoZoomStack

std::stack<std::array<double, 4> > mpWindow::m_redoZoomStack
protectedinherited

Definition at line 1423 of file mathplot.h.

Referenced by OnShowPopupMenu(), pushZoomUndo(), RedoZoomStackSize(), ZoomRedo(), and ZoomUndo().

◆ m_scaleX

double mpWindow::m_scaleX
protectedinherited

◆ m_scaleY

double mpWindow::m_scaleY
protectedinherited

◆ m_scrX

int mpWindow::m_scrX
protectedinherited

◆ m_scrY

int mpWindow::m_scrY
protectedinherited

◆ m_smithChart

◆ m_smithGrid

SMITH_GRID* SIM_VIEW::m_smithGrid
private

◆ m_smithLeftSkipped

bool SIM_VIEW::m_smithLeftSkipped
private

◆ m_smithMenuPos

wxPoint SIM_VIEW::m_smithMenuPos
private

Definition at line 544 of file sim_plot_tab.h.

Referenced by onSmithMenuCommand(), and onSmithRightDown().

◆ m_smithPan

wxRealPoint SIM_VIEW::m_smithPan
private

◆ m_smithPanLast

wxPoint SIM_VIEW::m_smithPanLast
private

Definition at line 543 of file sim_plot_tab.h.

Referenced by onSmithLeftDown(), and onSmithMotion().

◆ m_smithPanning

bool SIM_VIEW::m_smithPanning
private

◆ m_smithZoom

double SIM_VIEW::m_smithZoom
private

◆ m_topBottomPlotGapFactor

double mpWindow::m_topBottomPlotGapFactor
protectedinherited

Definition at line 1405 of file mathplot.h.

Referenced by Fit(), mpWindow(), RecomputeDesiredY(), and ViewNeedsRefitting().

◆ m_undoZoomStack

std::stack<std::array<double, 4> > mpWindow::m_undoZoomStack
protectedinherited

Definition at line 1422 of file mathplot.h.

Referenced by OnShowPopupMenu(), pushZoomUndo(), UndoZoomStackSize(), ZoomRedo(), and ZoomUndo().

◆ m_yLocked

bool mpWindow::m_yLocked
protectedinherited

Definition at line 1393 of file mathplot.h.

Referenced by DoZoom(), GetYLocked(), LockY(), mpWindow(), PerformMouseWheelAction(), and ZoomRect().

◆ m_zooming

bool mpWindow::m_zooming
protectedinherited

Definition at line 1420 of file mathplot.h.

Referenced by mpWindow(), onMouseLeftDown(), onMouseLeftRelease(), onMouseMove(), and OnPaint().

◆ m_zoomRect

wxRect mpWindow::m_zoomRect
protectedinherited

Definition at line 1421 of file mathplot.h.

Referenced by onMouseMove(), and OnPaint().

◆ zoomIncrementalFactor

double mpWindow::zoomIncrementalFactor = 1.1
staticinherited

This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse wheel.

It must be a number above unity. This number is used for zoom in, and its inverse for zoom out. Set to 1.5 by default.

Definition at line 1238 of file mathplot.h.

Referenced by PerformMouseWheelAction(), SIMULATOR_CONTROL::Zoom(), ZoomIn(), and ZoomOut().


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