1 /**********************************************************************
3 FILENAME: uiuc_recorder.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: outputs variables specified in input file to recorder
10 ----------------------------------------------------------------------
14 ----------------------------------------------------------------------
16 REFERENCES: Liberty, Jesse. "Sam's Teach Yourself C++ in 21 Days,"
19 ----------------------------------------------------------------------
21 HISTORY: 01/31/2000 initial release
22 03/02/2000 (JS) added record options for 1D and 2D
23 interpolated variables
25 ----------------------------------------------------------------------
27 AUTHOR(S): Jeff Scott <jscott@mail.com>
29 ----------------------------------------------------------------------
33 ----------------------------------------------------------------------
37 ----------------------------------------------------------------------
39 OUTPUTS: -variables recorded in uiuc_recorder.dat
41 ----------------------------------------------------------------------
43 CALLED BY: uiuc_wrapper.cpp
45 ----------------------------------------------------------------------
49 ----------------------------------------------------------------------
51 COPYRIGHT: (C) 2000 by Michael Selig
53 This program is free software; you can redistribute it and/or
54 modify it under the terms of the GNU General Public License
55 as published by the Free Software Foundation.
57 This program is distributed in the hope that it will be useful,
58 but WITHOUT ANY WARRANTY; without even the implied warranty of
59 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60 GNU General Public License for more details.
62 You should have received a copy of the GNU General Public License
63 along with this program; if not, write to the Free Software
64 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
65 USA or view http://www.gnu.org/copyleft/gpl.html.
67 **********************************************************************/
69 #include "uiuc_recorder.h"
71 void uiuc_recorder(double dt )
77 string record_variables = "# ";
80 command_list = recordParts->getCommands();
83 for ( command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
84 record_variables += recordParts->getToken(*command_line,2) + " ";
86 fout << record_variables << endl;
87 for ( command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
90 linetoken = recordParts->getToken(*command_line, 2);
92 switch(record_map[linetoken])
96 fout << Dx_pilot << " ";
101 fout << Dy_pilot << " ";
104 case Dz_pilot_record:
106 fout << Dz_pilot << " ";
111 fout << V_north << " ";
116 fout << V_east << " ";
121 fout << V_down << " ";
124 case V_rel_wind_record:
126 fout << V_rel_wind << " ";
129 case Dynamic_pressure_record:
131 fout << Dynamic_pressure << " ";
136 fout << Alpha << " ";
139 case Alpha_dot_record:
141 fout << Alpha_dot << " ";
149 case Beta_dot_record:
151 fout << Beta_dot << " ";
156 // fout << Gamma << " ";
161 fout << P_body << " ";
166 fout << Q_body << " ";
171 fout << R_body << " ";
181 fout << Theta << " ";
189 case Theta_dot_record:
191 fout << Theta_dot << " ";
196 fout << Density << " ";
206 fout << Simtime << " ";
214 case elevator_record:
216 fout << elevator << " ";
221 fout << aileron << " ";
226 fout << rudder << " ";
236 fout << CDfaI << " ";
241 fout << CDfadeI << " ";
251 fout << CLfaI << " ";
256 fout << CLfadeI << " ";
266 fout << CmfadeI << " ";
276 fout << CYfadaI << " ";
279 case CYfbetadrI_record:
281 fout << CYfbetadrI << " ";
291 fout << ClfadaI << " ";
294 case ClfbetadrI_record:
296 fout << ClfbetadrI << " ";
306 fout << CnfadaI << " ";
309 case CnfbetadrI_record:
311 fout << CnfbetadrI << " ";
314 case F_X_wind_record:
316 fout << F_X_wind << " ";
319 case F_Y_wind_record:
321 fout << F_Y_wind << " ";
324 case F_Z_wind_record:
326 fout << F_Z_wind << " ";
329 case F_X_aero_record:
331 fout << F_X_aero << " ";
334 case F_Y_aero_record:
336 fout << F_Y_aero << " ";
339 case F_Z_aero_record:
341 fout << F_Z_aero << " ";
344 case F_X_engine_record:
346 fout << F_X_engine << " ";
349 case F_Y_engine_record:
351 fout << F_Y_engine << " ";
354 case F_Z_engine_record:
356 fout << F_Z_engine << " ";
359 case F_X_gear_record:
361 fout << F_X_gear << " ";
364 case F_Y_gear_record:
366 fout << F_Y_gear << " ";
369 case F_Z_gear_record:
371 fout << F_Z_gear << " ";
389 case M_l_aero_record:
391 fout << M_l_aero << " ";
394 case M_m_aero_record:
396 fout << M_m_aero << " ";
399 case M_n_aero_record:
401 fout << M_n_aero << " ";
404 case M_l_engine_record:
406 fout << M_l_engine << " ";
409 case M_m_engine_record:
411 fout << M_m_engine << " ";
414 case M_n_engine_record:
416 fout << M_n_engine << " ";
419 case M_l_gear_record:
421 fout << M_l_gear << " ";
424 case M_m_gear_record:
426 fout << M_m_gear << " ";
429 case M_n_gear_record:
431 fout << M_n_gear << " ";
436 fout << M_l_rp << " ";
441 fout << M_m_rp << " ";
446 fout << M_n_rp << " ";
453 // end uiuc_recorder.cpp