ACADO Toolkit  1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
Public Member Functions | Protected Member Functions | Protected Attributes | Friends

Provides a generic way to plot algorithmic outputs during runtime. More...

#include <plotting.hpp>

Inheritance diagram for Plotting:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Plotting ()
 Default constructor.
 Plotting (const Plotting &rhs)
 Copy constructor (deep copy).
virtual ~Plotting ()
 Destructor.
Plottingoperator= (const Plotting &rhs)
 Assignment operator (deep copy).
int operator<< (PlotWindow &_window)
 Adds a window to the plot collection.
int addPlotWindow (PlotWindow &_window)
 Adds a window to the plot collection.
returnValue getPlotWindow (uint idx, PlotWindow &_window) const
 Returns the window with given index from the plot collection.
returnValue getPlotWindow (PlotWindow &_window) const
 Returns the window with certain index from the plot collection.
virtual returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 Plots all windows of the plot collection, each one into a new figure.
virtual returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 Plots all windows of the plot collection, each one into the corresponding existing figure, if possible.
uint getNumPlotWindows () const
 Returns number of windows contained in the plot collection.

Protected Member Functions

virtual returnValue getPlotDataFromMemberLoggings (PlotWindow &_window) const
 Copies all collected logging information required to plot a given window.

Protected Attributes

PlotCollection plotCollection
 Plot collection containing a singly-linked list of plot windows.

Friends

class AlgorithmicBase

Detailed Description

The class Plotting provides a generic way to plot algorithmic outputs during runtime. This class is part of the UserInterface class, i.e. all classes that are intended to interact with the user inherit the public functionality of the Plotting class.

Author:
Hans Joachim Ferreau, Boris Houska

Constructor & Destructor Documentation

Plotting::Plotting ( const Plotting rhs)
Parameters:
[in]rhsRight-hand side object.

References plotCollection.

Plotting::~Plotting ( ) [virtual]

Member Function Documentation

int Plotting::addPlotWindow ( PlotWindow _window) [inline]
Parameters:
[in]_windowWindow to be added.
Returns:
>= 0: index of added record,
-RET_PLOT_COLLECTION_CORRUPTED

Reimplemented in UserInteraction.

References PlotCollection::addPlotWindow(), and plotCollection.

Referenced by operator<<().

uint Plotting::getNumPlotWindows ( ) const [inline]
Returns:
Number of windows

References PlotCollection::getNumPlotWindows(), and plotCollection.

Referenced by getPlotWindow().

returnValue Plotting::getPlotDataFromMemberLoggings ( PlotWindow _window) const [protected, virtual]
Parameters:
[in]_windowWindow to be plotted.
Note:
This function is overloaded within the UserInterface class to syncronize the logging information collected elsewhere within the algorithm with the one stored within the given window for plotting.
Returns:
SUCCESSFUL_RETURN

Reimplemented in UserInteraction.

References SUCCESSFUL_RETURN.

Referenced by getPlotWindow().

returnValue Plotting::getPlotWindow ( uint  idx,
PlotWindow _window 
) const [inline]
Parameters:
[in]idxIndex of desired window.
[out]_windowDesired window.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, getNumPlotWindows(), getPlotDataFromMemberLoggings(), plotCollection, and RET_INDEX_OUT_OF_BOUNDS.

Referenced by getPlotWindow(), plot(), and replot().

returnValue Plotting::getPlotWindow ( PlotWindow _window) const [inline]

This index is not provided when calling the function, but rather obtained by using the alias index of the window. If the window is no alias window, the error RET_INDEX_OUT_OF_BOUNDS is thrown.

Parameters:
[out]_windowDesired window.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References PlotWindow::getAliasIdx(), and getPlotWindow().

BEGIN_NAMESPACE_ACADO int Plotting::operator<< ( PlotWindow _window) [inline]
Parameters:
[in]_windowWindow to be added.
Note:
This function is doing the same as the corresponding addPlotWindow member function and is introduced for syntax reasons only.
Returns:
>= 0: index of added record,
-RET_PLOT_COLLECTION_CORRUPTED

Reimplemented in UserInteraction.

References addPlotWindow().

Plotting & Plotting::operator= ( const Plotting rhs)
Parameters:
[in]rhsRight-hand side object.

References plotCollection.

Parameters:
[in]_frequencyFrequency determining at which time instants the window is to be plotted.
Returns:
SUCCESSFUL_RETURN

References ACADOERROR, PlotCollection::first, PlotWindow::getNext(), getPlotWindow(), PlotWindow::plot(), PLOT_NEVER, plotCollection, RET_PLOTTING_FAILED, and SUCCESSFUL_RETURN.

Referenced by IntegrationAlgorithm::evaluate(), and AlgorithmicBase::plot().

Parameters:
[in]_frequencyFrequency determining at which time instants the window is to be plotted.
Returns:
SUCCESSFUL_RETURN

Reimplemented in Process.

References ACADOERROR, PlotCollection::first, PlotWindow::getNext(), getPlotWindow(), PLOT_NEVER, plotCollection, PlotWindow::replot(), RET_PLOTTING_FAILED, and SUCCESSFUL_RETURN.

Referenced by AlgorithmicBase::replot(), and RealTimeAlgorithm::solve().


Friends And Related Function Documentation

friend class AlgorithmicBase [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines