plotting.cpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00034 #include <acado/user_interaction/plot_collection.hpp>
00035 #include <acado/user_interaction/plotting.hpp>
00036 
00037 
00038 BEGIN_NAMESPACE_ACADO
00039 
00040 
00041 
00042 //
00043 // PUBLIC MEMBER FUNCTIONS:
00044 //
00045 
00046 
00047 Plotting::Plotting( )
00048 {
00049 }
00050 
00051 
00052 Plotting::Plotting( const Plotting& rhs )
00053 {
00054         plotCollection = rhs.plotCollection;
00055 }
00056 
00057 
00058 Plotting::~Plotting( )
00059 {
00060 }
00061 
00062 
00063 Plotting& Plotting::operator=( const Plotting& rhs )
00064 {
00065         if ( this != &rhs )
00066         {
00067                 plotCollection = rhs.plotCollection;
00068         }
00069 
00070         return *this;
00071 }
00072 
00073 
00074 returnValue Plotting::plot(     PlotFrequency _frequency
00075                                                         )
00076 {
00077         if ( _frequency == PLOT_NEVER )
00078                 return SUCCESSFUL_RETURN;
00079 
00080         PlotWindow* window = plotCollection.first;
00081 
00082         while ( window != 0 )
00083         {
00084                 // update plot data and ...
00085                 getPlotWindow( *window );
00086 
00087                 // ... plot the window
00088                 if ( window->plot( _frequency ) != SUCCESSFUL_RETURN )
00089                         return ACADOERROR( RET_PLOTTING_FAILED );
00090 
00091                 window = window->getNext( );
00092         }
00093 
00094         return SUCCESSFUL_RETURN;
00095 }
00096 
00097 
00098 returnValue Plotting::replot(   PlotFrequency _frequency
00099                                                                 )
00100 {
00101         if ( _frequency == PLOT_NEVER )
00102                 return SUCCESSFUL_RETURN;
00103 
00104         PlotWindow* window = plotCollection.first;
00105 
00106         while ( window != 0 )
00107         {
00108                 // update plot data and ...
00109                 getPlotWindow( *window );
00110 
00111                 // ... plot the window
00112                 if ( window->replot( _frequency ) != SUCCESSFUL_RETURN )
00113                         return ACADOERROR( RET_PLOTTING_FAILED );
00114 
00115                 window = window->getNext( );
00116         }
00117 
00118         return SUCCESSFUL_RETURN;
00119 }
00120 
00121 
00122 
00123 //
00124 // PROTECTED MEMBER FUNCTIONS:
00125 //
00126 
00127 
00128 returnValue Plotting::getPlotDataFromMemberLoggings(    PlotWindow& _window
00129                                                                                                                 ) const
00130 {
00131         return SUCCESSFUL_RETURN;
00132 }
00133 
00134 
00135 
00136 CLOSE_NAMESPACE_ACADO
00137 
00138 
00139 /*
00140  *      end of file
00141  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:38:42