Provides an interface to Gnuplot for plotting algorithmic outputs. More...
#include <gnuplot_window.hpp>
Public Member Functions | |
virtual PlotWindow * | clone () const |
BooleanType | getMouseEvent (double &mouseX, double &mouseY) |
GnuplotWindow () | |
GnuplotWindow (PlotFrequency _frequency) | |
GnuplotWindow (const GnuplotWindow &arg) | |
virtual returnValue | init () |
GnuplotWindow & | operator= (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 |
PlotWindowSubplot & | operator() (uint idx) |
PlotWindowSubplot | operator() (uint idx) const |
returnValue | operator<< (PlotWindowSubplot &_subplot) |
returnValue | operator<< (PlotName _name) |
returnValue | operator<< (const Expression &_name) |
PlotWindow & | operator= (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 Attributes | |
FILE * | gnuPipe |
BooleanType | mouseEvent |
Protected Attributes inherited from PlotWindow | |
int | aliasIdx |
PlotWindowSubplot * | first |
PlotFrequency | frequency |
PlotWindowSubplot * | last |
PlotWindow * | next |
uint | number |
LogRecord | plotDataRecord |
BooleanType | shallPlotNominalControls |
BooleanType | shallPlotNominalOutputs |
BooleanType | shallPlotNominalParameters |
Static Protected Attributes | |
static int | counter = 0 |
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.
Definition at line 58 of file gnuplot_window.hpp.
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.
|
virtual |
Destructor.
Definition at line 86 of file gnuplot_window.cpp.
|
virtual |
Clone operator returning a 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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
staticprotected |
Static counter for counting the number of GnuplotWindows.
Definition at line 214 of file gnuplot_window.hpp.
|
protected |
Pipe to Gnuplot.
Definition at line 210 of file gnuplot_window.hpp.
|
protected |
Flag indicating whether window should wait for mouse events.
Definition at line 212 of file gnuplot_window.hpp.