Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members

Provides an interface to Gnuplot for plotting algorithmic outputs. More...

#include <gnuplot_window.hpp>

Inheritance diagram for GnuplotWindow:
Inheritance graph
[legend]

Public Member Functions

virtual PlotWindowclone () const
 
BooleanType getMouseEvent (double &mouseX, double &mouseY)
 
 GnuplotWindow ()
 
 GnuplotWindow (PlotFrequency _frequency)
 
 GnuplotWindow (const GnuplotWindow &arg)
 
virtual returnValue init ()
 
GnuplotWindowoperator= (const GnuplotWindow &arg)
 
virtual returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
returnValue waitForMouseEvent (double &mouseX, double &mouseY)
 
returnValue waitForMouseEvents ()
 
virtual ~GnuplotWindow ()
 
- Public Member Functions inherited from PlotWindow
virtual returnValue addData (uint idx, const VariablesGrid &_newData)
 
virtual returnValue addLine (uint idx, double _lineValue)
 
returnValue addSubplot (PlotWindowSubplot &_subplot)
 
returnValue addSubplot (const Expression &_expression, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _xRangeLowerLimit=INFTY, double _xRangeUpperLimit=INFTY, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
 
returnValue addSubplot (const Expression &_expressionX, const Expression &_expressionY, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _xRangeLowerLimit=INFTY, double _xRangeUpperLimit=INFTY, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
 
returnValue addSubplot (PlotName _name, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _xRangeLowerLimit=INFTY, double _xRangeUpperLimit=INFTY, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
 
returnValue addSubplot (const VariablesGrid &_variable, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _xRangeLowerLimit=INFTY, double _xRangeUpperLimit=INFTY, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
 
returnValue addSubplot (const Curve &_curve, double _xRangeLowerLimit=0.0, double _xRangeUpperLimit=1.0, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
 
returnValue addSubplot3D (const VariablesGrid &_variable, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _xRangeLowerLimit=INFTY, double _xRangeUpperLimit=INFTY, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
 
returnValue clearAllSubplots ()
 
int getAliasIdx () const
 
uint getNumSubplots () const
 
returnValue getPlotDataRecord (LogRecord &_record) const
 
PlotFrequency getPlotFrequency () const
 
BooleanType isAlias () const
 
BooleanType isEmpty () const
 
PlotWindowSubplotoperator() (uint idx)
 
PlotWindowSubplot operator() (uint idx) const
 
returnValue operator<< (PlotWindowSubplot &_subplot)
 
returnValue operator<< (PlotName _name)
 
returnValue operator<< (const Expression &_name)
 
PlotWindowoperator= (const PlotWindow &rhs)
 
virtual returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
 PlotWindow ()
 
 PlotWindow (PlotFrequency _frequency)
 
 PlotWindow (const PlotWindow &rhs)
 
virtual returnValue setLabelX (uint idx, const char *const xLabel_)
 
virtual returnValue setLabelY (uint idx, const char *const yLabel_)
 
returnValue setPlotData (const Expression &_name, VariablesGrid &value)
 
returnValue setPlotData (LogName _name, VariablesGrid &value)
 
returnValue setPlotDataRecord (LogRecord &_record)
 
virtual returnValue setPlotMode (uint idx, PlotMode plotMode)
 
virtual returnValue setRanges (uint idx, double xRange1, double xRange2, double yRange1, double yRange2)
 
virtual returnValue setTitle (uint idx, const char *const title_)
 
virtual ~PlotWindow ()
 

Protected Member Functions

returnValue getPlotModeString (PlotMode plotMode, std::string &plotModeString) const
 
returnValue getPlotStyleString (VariableType _type, std::string &plotStyleString) const
 
returnValue obtainPlotDataString (VariablesGrid &_dataGrid, std::string &_plotDataString) const
 
returnValue sendDataToGnuplot ()
 
- Protected Member Functions inherited from PlotWindow
returnValue addPlotDataItem (VariableType _type)
 
returnValue addPlotDataItem (const Expression *const _expression)
 
returnValue addPlotDataItem (PlotName _name)
 
PlotName convertLogToPlotName (LogName _name) const
 
LogName convertPlotToLogName (PlotName _name) const
 
returnValue disableNominalControls ()
 
returnValue disableNominalOutputs ()
 
returnValue disableNominalParameters ()
 
returnValue enableNominalControls ()
 
returnValue enableNominalOutputs ()
 
returnValue enableNominalParameters ()
 
returnValue getAutoScaleYLimits (const VariablesGrid &dataGridY, PlotFormat plotFormat, double &lowerLimit, double &upperLimit) const
 
returnValue getDataGrids (const VariablesGrid *const variablesGrid, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
 
returnValue getExpressionDataGrids (const Expression *const expression, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
 
PlotWindowgetNext () const
 
returnValue getVariableDataGrids (const Expression *const variable, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
 
returnValue setAliasIdx (int _aliasIdx)
 
returnValue setNext (PlotWindow *const _next)
 
returnValue setupLogFrequency (PlotFrequency _frequency=PLOT_AT_EACH_ITERATION)
 

Protected Attributes

FILE * gnuPipe
 
BooleanType mouseEvent
 
- Protected Attributes inherited from PlotWindow
int aliasIdx
 
PlotWindowSubplotfirst
 
PlotFrequency frequency
 
PlotWindowSubplotlast
 
PlotWindownext
 
uint number
 
LogRecord plotDataRecord
 
BooleanType shallPlotNominalControls
 
BooleanType shallPlotNominalOutputs
 
BooleanType shallPlotNominalParameters
 

Static Protected Attributes

static int counter = 0
 

Detailed Description

Provides an interface to Gnuplot for plotting algorithmic outputs.

The acado2gnuplot interface provides the functionality to easiliy plot data which is available in the ACADO Toolkit format. The methods that are implemented in this interface convert ACADO sturctures into a format that can be read by the program Gnuplot.

Author
Boris Houska, Hans Joachim Ferreau, Milan Vukov

Definition at line 58 of file gnuplot_window.hpp.

Constructor & Destructor Documentation

GnuplotWindow::GnuplotWindow ( )

Default constructor.

Definition at line 59 of file gnuplot_window.cpp.

GnuplotWindow::GnuplotWindow ( PlotFrequency  _frequency)

Constructor which takes the plot frequency.

@param[in] _frequency       Frequency determining at which time instants the window is to be plotted.

Definition at line 68 of file gnuplot_window.cpp.

GnuplotWindow::GnuplotWindow ( const GnuplotWindow arg)

Copy constructor (deep copy).

@param[in] arg      Right-hand side object.

Definition at line 78 of file gnuplot_window.cpp.

GnuplotWindow::~GnuplotWindow ( )
virtual

Destructor.

Definition at line 86 of file gnuplot_window.cpp.

Member Function Documentation

PlotWindow * GnuplotWindow::clone ( ) const
virtual

Clone operator returning a base class pointer to a deep copy of respective class instance.

Returns
Base class pointer to a deep copy of respective class instance

Reimplemented from PlotWindow.

Definition at line 111 of file gnuplot_window.cpp.

BooleanType GnuplotWindow::getMouseEvent ( double &  mouseX,
double &  mouseY 
)

Returns whether a mouse event has occured.

    @param[out] mouseX      X coordinate of mouse click.
    @param[out] mouseX      Y coordinate of mouse click.

\return BT_TRUE  iff mouse event occured, \n
        BT_FALSE otherwise

Definition at line 162 of file gnuplot_window.cpp.

returnValue GnuplotWindow::getPlotModeString ( PlotMode  plotMode,
std::string &  plotModeString 
) const
protected

Generates string in Gnuplot syntax for plotting in given plot mode.

    @param[in]  plotMode            Plot mode whose string needs to be generated, see the PlotMode documentation for details.
    @param[out] plotModeString      String in Gnuplot syntax for plotting in given plot mode.

    \return SUCCESSFUL_RETURN

Definition at line 617 of file gnuplot_window.cpp.

returnValue GnuplotWindow::getPlotStyleString ( VariableType  _type,
std::string &  plotStyleString 
) const
protected

Generates string in Gnuplot syntax for plotting in given plot style.

    @param[in]  _type                               Type of variable to be plotted.
    @param[out] plotStyleString             String in Gnuplot syntax for plotting in given plot style.

    \return SUCCESSFUL_RETURN

Definition at line 639 of file gnuplot_window.cpp.

returnValue GnuplotWindow::init ( )
virtual

Initializes the Gnuplot-thread.

    \return SUCCESSFUL_RETURN, \n
            RET_PLOT_WINDOW_CAN_NOT_BE_OPEN

Reimplemented from PlotWindow.

Definition at line 117 of file gnuplot_window.cpp.

returnValue GnuplotWindow::obtainPlotDataString ( VariablesGrid _dataGrid,
std::string &  _plotDataString 
) const
protected

Generates string in Gnuplot syntax for plotting given data grid.

    @param[in]  _dataGrid                   Date grid to be plotted.
    @param[out] _plotDataString             String in Gnuplot syntax for plotting given data grid.

    \return SUCCESSFUL_RETURN

Definition at line 678 of file gnuplot_window.cpp.

GnuplotWindow & GnuplotWindow::operator= ( const GnuplotWindow arg)

Assignment operator (deep copy).

@param[in] arg      Right-hand side object.

Definition at line 93 of file gnuplot_window.cpp.

returnValue GnuplotWindow::replot ( PlotFrequency  _frequency = PLOT_IN_ANY_CASE)
virtual

Actually sets-up and plots the data in a Gnuplot window.

    @param[in] _frequency   Frequency determining at which time instants the window is to be plotted.

\return SUCCESSFUL_RETURN, \n
        RET_PLOTTING_FAILED, \n
            RET_INVALID_ARGUMENTS, \n
            RET_PLOT_WINDOW_CAN_NOT_BE_OPEN

Reimplemented from PlotWindow.

Definition at line 138 of file gnuplot_window.cpp.

returnValue GnuplotWindow::sendDataToGnuplot ( )
protected

Sets-up and plots the data in a Gnuplot window.

\return SUCCESSFUL_RETURN, \n
        RET_PLOTTING_FAILED, \n
            RET_INVALID_ARGUMENTS, \n
            RET_PLOT_WINDOW_CAN_NOT_BE_OPEN

Definition at line 222 of file gnuplot_window.cpp.

returnValue GnuplotWindow::waitForMouseEvent ( double &  mouseX,
double &  mouseY 
)

Waits until a mouse event occurs.

    @param[out] mouseX      X coordinate of mouse click.
    @param[out] mouseX      Y coordinate of mouse click.

    \return SUCCESSFUL_RETURN, \n
            RET_NOT_YET_IMPLEMENTED

Definition at line 178 of file gnuplot_window.cpp.

returnValue GnuplotWindow::waitForMouseEvents ( )

Runs the Gnuplot window in waiting mode until a mouse event occurs.

    \return SUCCESSFUL_RETURN

Definition at line 155 of file gnuplot_window.cpp.

Member Data Documentation

BEGIN_NAMESPACE_ACADO int GnuplotWindow::counter = 0
staticprotected

Static counter for counting the number of GnuplotWindows.

Definition at line 214 of file gnuplot_window.hpp.

FILE* GnuplotWindow::gnuPipe
protected

Pipe to Gnuplot.

Definition at line 210 of file gnuplot_window.hpp.

BooleanType GnuplotWindow::mouseEvent
protected

Flag indicating whether window should wait for mouse events.

Definition at line 212 of file gnuplot_window.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:24