28#ifndef __SIM_PLOT_PANEL_H
29#define __SIM_PLOT_PANEL_H
83 Move( wxPoint( aX, 0 ) );
91 bool Inside(
const wxPoint& aPoint )
const override;
93 void Move( wxPoint aDelta )
override
153 void SetData(
const std::vector<double>& aX,
const std::vector<double>& aY )
override
188 SIM_PLOT_PANEL(
const wxString& aCommand,
int aOptions, wxWindow* parent, wxWindowID
id,
189 const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
190 long style = 0,
const wxString&
name = wxPanelNameStr );
228 return trace ==
m_traces.end() ? nullptr : trace->second;
279 void EnableCursor(
const wxString& aVectorName,
int aType,
int aCursorId,
bool aEnable,
280 const wxString& aSignalName );
298 void SetTraceData(
TRACE* aTrace,
unsigned int aPoints,
const double* aX,
const double* aY );
300 bool DeleteTrace(
const wxString& aVectorName,
int aTraceType );
304 wxString
getTraceId(
const wxString& aVectorName,
int aType )
const
The SIMULATOR_FRAME holds the main user-interface for running simulations.
const wxRealPoint & GetCoords() const
void Move(wxPoint aDelta) override
Moves the layer rectangle of given pixel deltas.
static constexpr int DRAG_MARGIN
bool Inside(const wxPoint &aPoint) const override
Checks whether a point is inside the info box rectangle.
void doSetCoordX(double aValue)
CURSOR(TRACE *aTrace, SIM_PLOT_PANEL *aPlotPanel)
void SetCoordX(double aValue)
void UpdateReference() override
Updates the rectangle reference point.
void Plot(wxDC &aDC, mpWindow &aWindow) override
Plot method.
The SIMULATOR_FRAME holds the main user-interface for running simulations.
void UpdatePlotColors()
Update plot colors
void ShowLegend(bool aEnable)
void UpdateTraceStyle(TRACE *trace)
void ResetScales()
Update trace line style.
wxString GetLabelY2() const
wxString GetUnitsX() const
void updateAxes(int aNewTraceType=SIM_TRACE_TYPE::SPT_UNKNOWN)
Create/Ensure axes are available for plotting
TRACE * AddTrace(const wxString &aVectorName, int aType)
wxString GetLabelY3() const
bool DeleteTrace(const wxString &aVectorName, int aTraceType)
bool IsLegendShown() const
TRACE * GetTrace(const wxString &aVecName, int aType) const
virtual ~SIM_PLOT_PANEL()
wxString GetUnitsY3() const
wxString getTraceId(const wxString &aVectorName, int aType) const
Construct the plot axes for DC simulation plot.
void SetDottedSecondary(bool aEnable)
Draw secondary signal traces (current or phase) with dotted lines.
void OnLanguageChanged() override
Getter for math plot window.
void EnableCursor(const wxString &aVectorName, int aType, int aCursorId, bool aEnable, const wxString &aSignalName)
Reset scale ranges to fit the current traces.
bool GetDottedSecondary() const
Toggle cursor for a particular trace.
std::map< wxString, TRACE * > m_traces
void prepareDCAxes(int aNewTraceType)
const std::map< wxString, TRACE * > & GetTraces() const
void SetTraceData(TRACE *aTrace, unsigned int aPoints, const double *aX, const double *aY)
wxString GetUnitsY2() const
SIM_PLOT_PANEL(const wxString &aCommand, int aOptions, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
mpWindow * GetPlotWin() const
void ShowGrid(bool aEnable)
wxString GetLabelY1() const
wxString GetUnitsY1() const
wxString GetLabelX() const
void SetTraceColour(const wxColour &aColour)
std::map< int, CURSOR * > & GetCursors()
SIM_TRACE_TYPE GetType() const
std::map< int, CURSOR * > m_cursors
bool HasCursor(int aCursorId)
TRACE(const wxString &aName, SIM_TRACE_TYPE aType)
void SetData(const std::vector< double > &aX, const std::vector< double > &aY) override
Assigns new data set for the trace.
void SetCursor(int aCursorId, CURSOR *aCursor)
void SetName(wxString aName) override
Set layer name.
const std::vector< double > & GetDataY() const
wxColour GetTraceColour() const
const std::vector< double > & GetDataX() const
CURSOR * GetCursor(int aCursorId)
A class providing graphs functionality for a 2D plot (either continuous or a set of points),...
std::vector< double > m_ys
std::vector< double > m_xs
The internal copy of the set of data to draw.
virtual void SetData(const std::vector< double > &xs, const std::vector< double > &ys)
Changes the internal data: the set of points to draw.
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
virtual void Move(wxPoint delta)
Moves the layer rectangle of given pixel deltas.
Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...
bool IsVisible() const
Checks whether the layer is visible or not.
const wxString & GetName() const
Get layer name.
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
void SetVisible(bool show)
Sets layer visibility.
virtual void SetName(wxString name)
Set layer name.
void SetDrawOutsideMargins(bool drawModeOutside)
Set Draw mode: inside or outside margins.
void SetTicks(bool enable)
Set X axis ticks or grid.
bool GetTicks() const
Get X axis ticks or grid.
Plot layer implementing a y-scale ruler.
void SetTicks(bool ticks)
Set Y axis ticks or grid.
bool GetTicks() const
Get Y axis ticks or grid.
Canvas for plotting mpLayer implementations.
void UpdateAll()
Refresh display.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Class is responsible for providing colors for traces on simulation plot.
wxDECLARE_EVENT(EVT_SIM_CURSOR_UPDATE, wxCommandEvent)