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 () |
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 Attributes | |
FILE * | gnuPipe |
BooleanType | mouseEvent |
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.
Default constructor.
Definition at line 59 of file gnuplot_window.cpp.
GnuplotWindow::GnuplotWindow | ( | PlotFrequency | _frequency | ) |
Constructor which takes the plot frequency.
[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).
[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.
PlotWindow * GnuplotWindow::clone | ( | ) | const [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.
[out] | mouseX | X coordinate of mouse click. |
[out] | mouseX | Y coordinate of mouse click. |
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.
[in] | plotMode | Plot mode whose string needs to be generated, see the PlotMode documentation for details. |
[out] | plotModeString | String in Gnuplot syntax for plotting in given plot mode. |
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.
[in] | _type | Type of variable to be plotted. |
[out] | plotStyleString | String in Gnuplot syntax for plotting in given plot style. |
Definition at line 639 of file gnuplot_window.cpp.
returnValue GnuplotWindow::init | ( | ) | [virtual] |
Initializes the Gnuplot-thread.
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.
[in] | _dataGrid | Date grid to be plotted. |
[out] | _plotDataString | String in Gnuplot syntax for plotting given data grid. |
Definition at line 678 of file gnuplot_window.cpp.
GnuplotWindow & GnuplotWindow::operator= | ( | const GnuplotWindow & | arg | ) |
Assignment operator (deep copy).
[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.
[in] | _frequency | Frequency determining at which time instants the window is to be plotted. |
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.
Definition at line 222 of file gnuplot_window.cpp.
returnValue GnuplotWindow::waitForMouseEvent | ( | double & | mouseX, |
double & | mouseY | ||
) |
Waits until a mouse event occurs.
[out] | mouseX | X coordinate of mouse click. |
[out] | mouseX | Y coordinate of mouse click. |
Definition at line 178 of file gnuplot_window.cpp.
Runs the Gnuplot window in waiting mode until a mouse event occurs.
Definition at line 155 of file gnuplot_window.cpp.
BEGIN_NAMESPACE_ACADO int GnuplotWindow::counter = 0 [static, protected] |
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.