plot_window.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
33 #ifndef ACADO_TOOLKIT_PLOT_WINDOW_HPP
34 #define ACADO_TOOLKIT_PLOT_WINDOW_HPP
35 
36 
41 
44 
45 
47 
48 
77 {
78  friend class PlotCollection;
79  friend class Plotting;
80 
81  //
82  // PUBLIC MEMBER FUNCTIONS:
83  //
84  public:
87  PlotWindow( );
88 
93  PlotWindow( PlotFrequency _frequency
94  );
95 
96 
101  PlotWindow( const PlotWindow& rhs
102  );
103 
106  virtual ~PlotWindow( );
107 
113  );
114 
115 
121  virtual PlotWindow* clone( ) const;
122 
123 
128  virtual returnValue init( );
129 
130 
137  virtual returnValue plot( PlotFrequency _frequency = PLOT_IN_ANY_CASE
138  );
139 
140 
147  virtual returnValue replot( PlotFrequency _frequency = PLOT_IN_ANY_CASE
148  );
149 
150 
159  virtual returnValue setTitle( uint idx,
160  const char* const title_
161  );
162 
171  virtual returnValue setLabelX( uint idx,
172  const char* const xLabel_
173  );
174 
183  virtual returnValue setLabelY( uint idx,
184  const char* const yLabel_
185  );
186 
195  virtual returnValue setPlotMode( uint idx,
196  PlotMode plotMode
197  );
198 
211  virtual returnValue setRanges( uint idx,
212  double xRange1,
213  double xRange2,
214  double yRange1,
215  double yRange2
216  );
217 
218 
227  virtual returnValue addLine( uint idx,
228  double _lineValue
229  );
230 
239  virtual returnValue addData( uint idx,
240  const VariablesGrid& _newData
241  );
242 
243 
250  inline PlotWindowSubplot& operator()( uint idx
251  );
252 
259  inline PlotWindowSubplot operator()( uint idx
260  ) const;
261 
262 
274  );
275 
286  );
287 
297  returnValue operator<<( const Expression& _name
298  );
299 
300 
309  );
310 
311 
329  returnValue addSubplot( const Expression& _expression,
330  const char* const _title = "",
331  const char* const _xLabel = "",
332  const char* const _yLabel = "",
333  PlotMode _plotMode = PM_UNKNOWN,
334  double _xRangeLowerLimit = INFTY,
335  double _xRangeUpperLimit = INFTY,
336  double _yRangeLowerLimit = INFTY,
337  double _yRangeUpperLimit = INFTY
338  );
339 
358  returnValue addSubplot( const Expression& _expressionX,
359  const Expression& _expressionY,
360  const char* const _title = "",
361  const char* const _xLabel = "",
362  const char* const _yLabel = "",
363  PlotMode _plotMode = PM_UNKNOWN,
364  double _xRangeLowerLimit = INFTY,
365  double _xRangeUpperLimit = INFTY,
366  double _yRangeLowerLimit = INFTY,
367  double _yRangeUpperLimit = INFTY
368  );
369 
388  const char* const _title = "",
389  const char* const _xLabel = "",
390  const char* const _yLabel = "",
391  PlotMode _plotMode = PM_UNKNOWN,
392  double _xRangeLowerLimit = INFTY,
393  double _xRangeUpperLimit = INFTY,
394  double _yRangeLowerLimit = INFTY,
395  double _yRangeUpperLimit = INFTY
396  );
397 
415  returnValue addSubplot( const VariablesGrid& _variable,
416  const char* const _title = "",
417  const char* const _xLabel = "",
418  const char* const _yLabel = "",
419  PlotMode _plotMode = PM_UNKNOWN,
420  double _xRangeLowerLimit = INFTY,
421  double _xRangeUpperLimit = INFTY,
422  double _yRangeLowerLimit = INFTY,
423  double _yRangeUpperLimit = INFTY
424  );
425 
443  returnValue addSubplot3D( const VariablesGrid& _variable,
444  const char* const _title = "",
445  const char* const _xLabel = "",
446  const char* const _yLabel = "",
447  PlotMode _plotMode = PM_UNKNOWN,
448  double _xRangeLowerLimit = INFTY,
449  double _xRangeUpperLimit = INFTY,
450  double _yRangeLowerLimit = INFTY,
451  double _yRangeUpperLimit = INFTY
452  );
453 
471  returnValue addSubplot( const Curve& _curve,
472  double _xRangeLowerLimit = 0.0,
473  double _xRangeUpperLimit = 1.0,
474  const char* const _title = "",
475  const char* const _xLabel = "",
476  const char* const _yLabel = "",
477  PlotMode _plotMode = PM_UNKNOWN,
478  double _yRangeLowerLimit = INFTY,
479  double _yRangeUpperLimit = INFTY
480  );
481 
482 
488 
489 
495  inline PlotFrequency getPlotFrequency( ) const;
496 
497 
502  inline uint getNumSubplots( ) const;
503 
509  inline BooleanType isEmpty( ) const;
510 
511 
518  inline returnValue getPlotDataRecord( LogRecord& _record
519  ) const;
520 
527  inline returnValue setPlotDataRecord( LogRecord& _record
528  );
529 
530 
531 
540  inline returnValue setPlotData( const Expression& _name,
541  VariablesGrid& value
542  );
543 
552  inline returnValue setPlotData( LogName _name,
553  VariablesGrid& value
554  );
555 
556 
562  inline BooleanType isAlias( ) const;
563 
569  inline int getAliasIdx( ) const;
570 
571 
572  //
573  // PROTECTED MEMBER FUNCTIONS:
574  //
575  protected:
576 
583  inline returnValue setNext( PlotWindow* const _next
584  );
585 
590  inline PlotWindow* getNext( ) const;
591 
592 
601  );
602 
610  returnValue addPlotDataItem( const Expression* const _expression
611  );
612 
621  );
622 
623 
632  ) const;
633 
642  ) const;
643 
644 
653  );
654 
655 
662  inline returnValue setAliasIdx( int _aliasIdx
663  );
664 
665 
677  returnValue getVariableDataGrids( const Expression* const variable,
678  VariableType& _type,
679  VariablesGrid& _dataGrid,
680  Grid& _discretizationGrid
681  );
682 
694  returnValue getExpressionDataGrids( const Expression* const expression,
695  VariableType& _type,
696  VariablesGrid& _dataGrid,
697  Grid& _discretizationGrid
698  );
699 
710  returnValue getDataGrids( const VariablesGrid* const variablesGrid,
711  VariableType& _type,
712  VariablesGrid& _dataGrid,
713  Grid& _discretizationGrid
714  );
715 
716 
728  PlotFormat plotFormat,
729  double& lowerLimit,
730  double& upperLimit
731  ) const;
732 
733 
735 
737 
738 
740 
742 
743 
745 
747 
748 
749 
750  //
751  // DATA MEMBERS:
752  //
753  protected:
755  int aliasIdx;
769 };
770 
771 
773 
774 
775 #include <acado/user_interaction/plot_window.ipp>
776 
777 
778 #endif // ACADO_TOOLKIT_PLOT_WINDOW_HPP
779 
780 
781 /*
782  * end of file
783  */
returnValue enableNominalOutputs()
virtual returnValue replot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
virtual returnValue addLine(uint idx, double _lineValue)
uint getNumSubplots() const
virtual PlotWindow * clone() const
virtual returnValue plot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
const double INFTY
virtual returnValue setLabelX(uint idx, const char *const xLabel_)
Provides a generic way to plot algorithmic outputs during runtime.
Definition: plotting.hpp:61
PlotMode
int getAliasIdx() const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
virtual returnValue setTitle(uint idx, const char *const title_)
LogName convertPlotToLogName(PlotName _name) const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue enableNominalControls()
returnValue getVariableDataGrids(const Expression *const variable, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
Allows to conveniently handle (one-dimensional) grids consisting of time points.
Definition: grid.hpp:58
returnValue setNext(PlotWindow *const _next)
PlotWindowSubplot * first
BooleanType shallPlotNominalControls
#define CLOSE_NAMESPACE_ACADO
returnValue disableNominalControls()
returnValue addSubplot(PlotWindowSubplot &_subplot)
VariableType
Definition: acado_types.hpp:95
BooleanType isEmpty() const
returnValue enableNominalParameters()
PlotFrequency
Base class for all variables within the symbolic expressions family.
Definition: expression.hpp:56
Allows to setup and plot user-specified plot windows for algorithmic outputs.
Definition: plot_window.hpp:76
returnValue getExpressionDataGrids(const Expression *const expression, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
PlotName
PlotWindow & operator=(const PlotWindow &rhs)
virtual returnValue setRanges(uint idx, double xRange1, double xRange2, double yRange1, double yRange2)
PlotWindow * getNext() const
LogRecord plotDataRecord
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 operator<<(PlotWindowSubplot &_subplot)
PlotFormat
returnValue disableNominalParameters()
virtual returnValue setPlotMode(uint idx, PlotMode plotMode)
virtual returnValue setLabelY(uint idx, const char *const yLabel_)
LogName
returnValue setAliasIdx(int _aliasIdx)
returnValue getPlotDataRecord(LogRecord &_record) const
virtual returnValue init()
Allows to work with piecewise-continous function defined over a scalar time interval.
Definition: curve.hpp:52
void rhs(const real_t *x, real_t *f)
returnValue setPlotDataRecord(LogRecord &_record)
virtual returnValue addData(uint idx, const VariablesGrid &_newData)
PlotWindow * next
returnValue addPlotDataItem(VariableType _type)
Allows to manage sub-windows of user-specified plot windows for algorithmic outputs (for internal use...
returnValue setupLogFrequency(PlotFrequency _frequency=PLOT_AT_EACH_ITERATION)
BooleanType shallPlotNominalOutputs
PlotWindowSubplot * last
BooleanType isAlias() const
returnValue clearAllSubplots()
Allows to setup and store user-specified log records of algorithmic information.
Definition: log_record.hpp:72
Provides a generic list of plot windows (for internal use).
#define BEGIN_NAMESPACE_ACADO
BooleanType shallPlotNominalParameters
PlotFrequency getPlotFrequency() const
returnValue getDataGrids(const VariablesGrid *const variablesGrid, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
returnValue setPlotData(const Expression &_name, VariablesGrid &value)
returnValue disableNominalOutputs()
PlotName convertLogToPlotName(LogName _name) const
virtual ~PlotWindow()
PlotFrequency frequency
PlotWindowSubplot & operator()(uint idx)
returnValue getAutoScaleYLimits(const VariablesGrid &dataGridY, PlotFormat plotFormat, double &lowerLimit, double &upperLimit) const


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