28 #ifndef __SIM_PLOT_PANEL_H 29 #define __SIM_PLOT_PANEL_H 59 Move( wxPoint( aX, 0 ) );
67 bool Inside( wxPoint& aPoint )
override;
69 void Move( wxPoint aDelta )
override 96 TRACE(
const wxString& aName ) :
110 void SetData(
const std::vector<double>& aX,
const std::vector<double>& aY )
override 174 const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
175 long style = 0,
const wxString&
name = wxPanelNameStr );
200 bool AddTrace(
const wxString& aName,
int aPoints,
const double* aX,
219 auto trace =
m_traces.find( aName );
273 void EnableCursor(
const wxString& aName,
bool aEnable );
void Plot(wxDC &aDC, mpWindow &aWindow) override
Plot method.
void SetMasterFrame(SIM_PLOT_FRAME *aFrame)
bool IsLegendShown() const
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
static constexpr int DRAG_MARGIN
const wxString & GetName() const
Get layer name.
mpWindow * GetPlotWin() const
void ShowLegend(bool aEnable)
void Move(wxPoint aDelta) override
Moves the layer rectangle of given pixel deltas.
const std::vector< double > & GetDataX() const
bool HasCursorEnabled(const wxString &aName) const
Toggles cursor for a particular trace.
wxColour GetTraceColour()
bool GetDottedCurrentPhase() const
Returns true if the trace has cursor shown.
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
A class providing graphs functionality for a 2D plot (either continuous or a set of points),...
void SetDottedCurrentPhase(bool aEnable)
std::vector< double > m_xs
The internal copy of the set of data to draw.
SIM_PLOT_FRAME * m_masterFrame
std::vector< double > m_ys
virtual ~SIM_PLOT_PANEL()
set the pointer to the sim plot frame
TRACE * GetTrace(const wxString &aName) const
SIM_PLOT_PANEL * m_plotPanel
wxString GetLabelY1() const
void UpdateTraceStyle(TRACE *trace)
void UpdateReference() override
Updates the rectangle reference point.
void SetFlags(int aFlags)
wxDECLARE_EVENT(EVT_SIM_CURSOR_UPDATE, wxCommandEvent)
bool GetTicks()
Get Y axis ticks or grid.
bool DeleteTrace(const wxString &aName)
const wxRealPoint & GetCoords() const
void UpdateAll()
Refresh display.
void EnableCursor(const wxString &aName, bool aEnable)
Resets scale ranges to fit the current traces.
virtual void Move(wxPoint delta)
Moves the layer rectangle of given pixel deltas.
wxString GetLabelX() const
void SetVisible(bool show)
Sets layer visibility.
wxString GetLabelY2() const
bool IsVisible()
Checks whether the layer is visible or not.
std::vector< mpLayer * > m_topLevel
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
std::map< wxString, TRACE * > m_traces
Plot layer implementing a y-scale ruler.
bool AddTrace(const wxString &aName, int aPoints, const double *aX, const double *aY, SIM_PLOT_TYPE aFlags)
void SetTicks(bool enable)
Set X axis ticks or grid.
void ResetScales()
Update trace line style.
bool GetTicks()
Get X axis ticks or grid.
void ShowGrid(bool aEnable)
void SetDrawOutsideMargins(bool drawModeOutside)
Set Draw mode: inside or outside margins.
Implementing SIM_PLOT_FRAME_BASE.
void UpdatePlotColors()
Getter for math plot window.
CURSOR(const TRACE *aTrace, SIM_PLOT_PANEL *aPlotPanel)
CURSOR * GetCursor() const
wxColour generateColor()
<
virtual void SetData(const std::vector< double > &xs, const std::vector< double > &ys)
Changes the internal data: the set of points to draw.
void SetData(const std::vector< double > &aX, const std::vector< double > &aY) override
Assigns new data set for the trace.
Canvas for plotting mpLayer implementations.
void SetTicks(bool ticks)
Set Y axis ticks or grid.
const std::vector< double > & GetDataY() const
SIM_PLOT_PANEL(wxString aCommand, wxWindow *parent, SIM_PLOT_FRAME *aMainFrame, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...
const std::map< wxString, TRACE * > & GetTraces() const
wxColour GetPlotColor(int aIndex)
A proxy to SIM_PLOT_FRAME::GetPlotColor()
void SetCursor(CURSOR *aCursor)
bool Inside(wxPoint &aPoint) override
Checks whether a point is inside the info box rectangle.
TRACE(const wxString &aName)
bool TraceShown(const wxString &aName) const
Cursor attached to a trace to follow its values:
void SetTraceColour(wxColour aColour)