1 /*******************************************************************************
6 Purpose: Manage output of sim parameters to file or stdout
9 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
11 This program is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free Software
13 Foundation; either version 2 of the License, or (at your option) any later
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23 Place - Suite 330, Boston, MA 02111-1307, USA.
25 Further information about the GNU General Public License can also be found on
26 the world wide web at http://www.gnu.org.
28 FUNCTIONAL DESCRIPTION
29 --------------------------------------------------------------------------------
30 This is the place where you create output routines to dump data for perusal
31 later. Some machines may not support the ncurses console output. Borland is one
32 of those environments which does not, so the ncurses stuff is commented out.
35 --------------------------------------------------------------------------------
38 ********************************************************************************
40 *******************************************************************************/
43 # include <Include/compiler.h>
44 # ifdef FG_HAVE_STD_INCLUDES
47 # include <iostream.h>
59 #include "FGFDMExec.h"
60 #include "FGAtmosphere.h"
62 #include "FGAircraft.h"
63 #include "FGTranslation.h"
64 #include "FGRotation.h"
65 #include "FGPosition.h"
66 #include "FGAuxiliary.h"
68 /*******************************************************************************
69 ************************************ CODE **************************************
70 *******************************************************************************/
72 FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex)
84 FGOutput::~FGOutput(void)
89 bool FGOutput::Run(void)
91 if (!FGModel::Run()) {
100 void FGOutput::ConsoleOutput(void)
106 move(1,1); insstr("Quaternions");
107 move(2,5); insstr("Q0");
108 move(2,16); insstr("Q1");
109 move(2,27); insstr("Q2");
110 move(2,38); insstr("Q3");
112 move(3,1); buffer = Rotation->GetQ0(); insstr(buffer.c_str());
113 move(3,12); buffer = Rotation->GetQ1(); insstr(buffer.c_str());
114 move(3,23); buffer = Rotation->GetQ2(); insstr(buffer.c_str());
115 move(3,34); buffer = Rotation->GetQ3(); insstr(buffer.c_str());
117 move(0,0); insstr("Time: ");
118 move(0,6); insstr(gcvt(State->Getsim_time(),6,buffer));
120 move(2,46); insstr("Phi");
121 move(2,55); insstr("Tht");
122 move(2,64); insstr("Psi");
124 move(3,45); buffer = Rotation->Getphi(); insstr(buffer.c_str());
125 move(3,54); buffer = Rotation->Gettht(); insstr(buffer.c_str());
126 move(3,63); buffer = Rotation->Getpsi(); insstr(buffer.c_str());
128 move(5,47); insstr("U");
129 move(5,56); insstr("V");
130 move(5,65); insstr("W");
132 move(6,45); buffer = Translation->GetU(); insstr(buffer.c_str());
133 move(6,54); buffer = Translation->GetV(); insstr(buffer.c_str());
134 move(6,63); buffer = Translation->GetW(); insstr(buffer.c_str());
136 move(8,47); insstr("Fx");
137 move(8,56); insstr("Fy");
138 move(8,65); insstr("Fz");
140 move(9,45); buffer = Aircraft->GetFx(); insstr(buffer.c_str());
141 move(9,54); buffer = Aircraft->GetFy(); insstr(buffer.c_str());
142 move(9,63); buffer = Aircraft->GetFz(); insstr(buffer.c_str());
144 move(11,47); insstr("Fn");
145 move(11,56); insstr("Fe");
146 move(11,65); insstr("Fd");
148 move(12,45); buffer = Position->GetFn(); insstr(buffer.c_str());
149 move(12,54); buffer = Position->GetFe(); insstr(buffer.c_str());
150 move(12,63); buffer = Position->GetFd(); insstr(buffer.c_str());
152 move(14,47); insstr("Latitude");
153 move(14,57); insstr("Longitude");
154 move(14,67); insstr("Altitude");
156 move(15,47); buffer = State->Getlatitude(); insstr(buffer.c_str());
157 move(15,57); buffer = State->Getlongitude(); insstr(buffer.c_str());
158 move(15,67); buffer = State->Geth(); insstr(buffer.c_str());
168 void FGOutput::DelimitedOutput(void)
191 cout << "Longitude,";
197 cout << State->Getsim_time() << ",";
198 cout << State->Geth() << ",";
199 cout << Rotation->Getphi() << ",";
200 cout << Rotation->Gettht() << ",";
201 cout << Rotation->Getpsi() << ",";
202 cout << Atmosphere->Getrho() << ",";
203 cout << State->GetVt() << ",";
204 cout << Translation->GetU() << ",";
205 cout << Translation->GetV() << ",";
206 cout << Translation->GetW() << ",";
207 cout << Position->GetVn() << ",";
208 cout << Position->GetVe() << ",";
209 cout << Position->GetVd() << ",";
210 cout << Translation->GetUdot() << ",";
211 cout << Translation->GetVdot() << ",";
212 cout << Translation->GetWdot() << ",";
213 cout << Aircraft->GetFx() << ",";
214 cout << Aircraft->GetFy() << ",";
215 cout << Aircraft->GetFz() << ",";
216 cout << State->Getlatitude() << ",";
217 cout << State->Getlongitude() << ",";
218 cout << State->Getqbar() << ",";
219 cout << Translation->Getalpha() << "";