plot_collection.cpp
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 
35 
36 
37 
39 
40 
41 //
42 // PUBLIC MEMBER FUNCTIONS:
43 //
44 
45 
47 {
48  first = 0;
49  last = 0;
50 
51  number = 0;
52 }
53 
54 
56 {
57  first = 0;
58  last = 0;
59 
60  number = 0;
61 
62  /* if rhs logging list is not empty, add all logging windows... */
63  PlotWindow* current = rhs.first;
64 
65  while ( current != 0 )
66  {
67  addPlotWindow( *current );
68  current = current->getNext( );
69  }
70 }
71 
72 
74 {
75  clearAllWindows( );
76 }
77 
78 
80 {
81  if ( this != &rhs )
82  {
83  clearAllWindows( );
84 
85  /* if rhs logging list is not empty, add all option items... */
86  PlotWindow* current = rhs.first;
87 
88  while ( current != 0 )
89  {
90  addPlotWindow( *current );
91  current = current->getNext( );
92  }
93  }
94 
95  return *this;
96 }
97 
98 
100  )
101 {
102  return addPlotWindow( window );
103 }
104 
105 
107  )
108 {
109  window.setAliasIdx( number );
110 
111  // create new window
112  PlotWindow* newWindow = window.clone( );
113 
114  if ( number == 0 )
115  {
116  first = newWindow;
117  last = newWindow;
118  }
119  else
120  {
121  if ( last->setNext( newWindow ) != SUCCESSFUL_RETURN )
123  last = newWindow;
124  }
125 
126  ++number;
127 
128  return (number-1);
129 }
130 
131 
133 {
134  PlotWindow* current = first;
135  PlotWindow* tmp;
136 
137  /* deallocate all LogginRecords within list... */
138  while ( current != 0 )
139  {
140  tmp = current->getNext( );
141  delete current;
142  current = tmp;
143  }
144 
145  /* ... and initialise an empty list. */
146  first = 0;
147  last = 0;
148  number = 0;
149 
150  return SUCCESSFUL_RETURN;
151 }
152 
153 
154 
156 {
157  PlotWindow* current = first;
158 
159  while ( current != 0 )
160  {
161  current->enableNominalControls( );
162  current = current->getNext( );
163  }
164 
165  return SUCCESSFUL_RETURN;
166 }
167 
168 
170 {
171  PlotWindow* current = first;
172 
173  while ( current != 0 )
174  {
175  current->disableNominalControls( );
176  current = current->getNext( );
177  }
178 
179  return SUCCESSFUL_RETURN;
180 }
181 
182 
183 
185 {
186  PlotWindow* current = first;
187 
188  while ( current != 0 )
189  {
190  current->enableNominalParameters( );
191  current = current->getNext( );
192  }
193 
194  return SUCCESSFUL_RETURN;
195 }
196 
197 
199 {
200  PlotWindow* current = first;
201 
202  while ( current != 0 )
203  {
204  current->disableNominalParameters( );
205  current = current->getNext( );
206  }
207 
208  return SUCCESSFUL_RETURN;
209 }
210 
211 
212 
214 {
215  PlotWindow* current = first;
216 
217  while ( current != 0 )
218  {
219  current->enableNominalOutputs( );
220  current = current->getNext( );
221  }
222 
223  return SUCCESSFUL_RETURN;
224 }
225 
226 
228 {
229  PlotWindow* current = first;
230 
231  while ( current != 0 )
232  {
233  current->disableNominalOutputs( );
234  current = current->getNext( );
235  }
236 
237  return SUCCESSFUL_RETURN;
238 }
239 
240 
241 //
242 // PROTECTED MEMBER FUNCTIONS:
243 //
244 
245 
246 
247 
249 
250 
251 /*
252  * end of file
253  */
returnValue enableNominalOutputs()
int addPlotWindow(PlotWindow &window)
virtual PlotWindow * clone() const
returnValue disableNominalParameters()
Allows to pass back messages to the calling function.
returnValue enableNominalControls()
returnValue setNext(PlotWindow *const _next)
PlotCollection & operator=(const PlotCollection &rhs)
#define CLOSE_NAMESPACE_ACADO
returnValue disableNominalControls()
returnValue enableNominalParameters()
PlotWindow * first
Allows to setup and plot user-specified plot windows for algorithmic outputs.
Definition: plot_window.hpp:76
PlotWindow * getNext() const
returnValue disableNominalParameters()
returnValue setAliasIdx(int _aliasIdx)
void rhs(const real_t *x, real_t *f)
returnValue disableNominalOutputs()
returnValue disableNominalControls()
int operator<<(PlotWindow &window)
Provides a generic list of plot windows (for internal use).
#define BEGIN_NAMESPACE_ACADO
PlotWindow * last
returnValue enableNominalParameters()
returnValue enableNominalOutputs()
returnValue disableNominalOutputs()
returnValue clearAllWindows()
returnValue enableNominalControls()
#define ACADOERROR(retval)


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