1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 Purpose: Manage output of sim parameters to file or stdout
9 ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) -------------
11 This program is free software; you can redistribute it and/or modify it under
12 the terms of the GNU Lesser 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 Lesser General Public License for more
21 You should have received a copy of the GNU Lesser 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 Lesser 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
34 --------------------------------------------------------------------------------
36 11/09/07 HDW Added FlightGear Socket Interface
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48 #include "FGFDMExec.h"
49 #include "FGAtmosphere.h"
50 #include "FGAccelerations.h"
51 #include "atmosphere/FGWinds.h"
53 #include "FGAerodynamics.h"
54 #include "FGGroundReactions.h"
55 #include "FGExternalReactions.h"
56 #include "FGBuoyantForces.h"
57 #include "FGAircraft.h"
58 #include "FGMassBalance.h"
59 #include "FGPropagate.h"
60 #include "FGAuxiliary.h"
61 #include "FGInertial.h"
62 #include "FGPropulsion.h"
63 #include "models/propulsion/FGEngine.h"
64 #include "models/propulsion/FGTank.h"
65 #include "models/propulsion/FGPiston.h"
67 #if defined(WIN32) && !defined(__CYGWIN__)
70 # include <netinet/in.h> // htonl() ntohl()
73 static const int endianTest = 1;
74 #define isLittleEndian (*((char *) &endianTest ) != 0)
80 static const char *IdSrc = "$Id: FGOutput.cpp,v 1.59 2011/08/14 20:15:56 jberndt Exp $";
81 static const char *IdHdr = ID_OUTPUT;
83 // (stolen from FGFS native_fdm.cxx)
84 // The function htond is defined this way due to the way some
85 // processors and OSes treat floating point values. Some will raise
86 // an exception whenever a "bad" floating point value is loaded into a
87 // floating point register. Solaris is notorious for this, but then
88 // so is LynxOS on the PowerPC. By translating the data in place,
89 // there is no need to load a FP register with the "corruped" floating
90 // point value. By doing the BIG_ENDIAN test, I can optimize the
91 // routine for big-endian processors so it can be as efficient as
93 static void htond (double &x)
95 if ( isLittleEndian ) {
99 Double_Overlay = (int *) &x;
100 Holding_Buffer = Double_Overlay [0];
102 Double_Overlay [0] = htonl (Double_Overlay [1]);
103 Double_Overlay [1] = htonl (Holding_Buffer);
110 static void htonf (float &x)
112 if ( isLittleEndian ) {
116 Float_Overlay = (int *) &x;
117 Holding_Buffer = Float_Overlay [0];
119 Float_Overlay [0] = htonl (Holding_Buffer);
126 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
130 FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex)
133 sFirstPass = dFirstPass = true;
139 StartNewFile = false;
141 BaseFilename = Filename = "";
143 output_file_name = "";
145 memset(&fgSockBuf, 0x00, sizeof(fgSockBuf));
150 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152 FGOutput::~FGOutput()
155 OutputProperties.clear();
159 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161 bool FGOutput::InitModel(void)
163 if (Filename.size() > 0 && StartNewFile) {
165 string::size_type dot = BaseFilename.find_last_of('.');
166 if (dot != string::npos) {
167 buf << BaseFilename.substr(0, dot) << '_' << runID_postfix++ << BaseFilename.substr(dot);
169 buf << BaseFilename << '_' << runID_postfix++;
171 Filename = buf.str();
173 StartNewFile = false;
180 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182 bool FGOutput::Run(bool Holding)
184 if (FGModel::Run(Holding)) return true;
186 if (enabled && !FDMExec->IntegrationSuspended() && !Holding) {
194 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196 void FGOutput::Print(void)
198 if (Type == otSocket) {
200 } else if (Type == otFlightGear) {
201 FlightGearSocketOutput();
202 } else if (Type == otCSV || Type == otTab) {
203 DelimitedOutput(Filename);
204 } else if (Type == otTerminal) {
206 } else if (Type == otNone) {
209 // Not a valid type of output
213 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
215 void FGOutput::SetType(const string& type)
220 } else if (type == "TABULAR") {
223 } else if (type == "SOCKET") {
225 } else if (type == "FLIGHTGEAR") {
227 } else if (type == "TERMINAL") {
229 } else if (type != string("NONE")) {
231 cerr << "Unknown type of output specified in config file" << endl;
235 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
237 void FGOutput::SetProtocol(const string& protocol)
239 if (protocol == "UDP") Protocol = FGfdmSocket::ptUDP;
240 else if (protocol == "TCP") Protocol = FGfdmSocket::ptTCP;
241 else Protocol = FGfdmSocket::ptTCP; // Default to TCP
244 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246 void FGOutput::DelimitedOutput(const string& fname)
248 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
249 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
250 const FGAircraft* Aircraft = FDMExec->GetAircraft();
251 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
252 const FGWinds* Winds = FDMExec->GetWinds();
253 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
254 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
255 const FGPropagate* Propagate = FDMExec->GetPropagate();
256 const FGAccelerations* Accelerations = FDMExec->GetAccelerations();
257 const FGFCS* FCS = FDMExec->GetFCS();
258 const FGInertial* Inertial = FDMExec->GetInertial();
259 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
260 const FGExternalReactions* ExternalReactions = FDMExec->GetExternalReactions();
261 const FGBuoyantForces* BuoyantForces = FDMExec->GetBuoyantForces();
266 if (fname == "COUT" || fname == "cout") {
267 buffer = cout.rdbuf();
269 if (!datafile.is_open()) datafile.open(fname.c_str());
270 buffer = datafile.rdbuf();
273 ostream outstream(buffer);
275 outstream.precision(10);
279 if (SubSystems & ssSimulation) {
282 if (SubSystems & ssAerosurfaces) {
283 outstream << delimeter;
284 outstream << "Aileron Command (norm)" + delimeter;
285 outstream << "Elevator Command (norm)" + delimeter;
286 outstream << "Rudder Command (norm)" + delimeter;
287 outstream << "Flap Command (norm)" + delimeter;
288 outstream << "Left Aileron Position (deg)" + delimeter;
289 outstream << "Right Aileron Position (deg)" + delimeter;
290 outstream << "Elevator Position (deg)" + delimeter;
291 outstream << "Rudder Position (deg)" + delimeter;
292 outstream << "Flap Position (deg)";
294 if (SubSystems & ssRates) {
295 outstream << delimeter;
296 outstream << "P (deg/s)" + delimeter + "Q (deg/s)" + delimeter + "R (deg/s)" + delimeter;
297 outstream << "P dot (deg/s^2)" + delimeter + "Q dot (deg/s^2)" + delimeter + "R dot (deg/s^2)" + delimeter;
298 outstream << "P_{inertial} (deg/s)" + delimeter + "Q_{inertial} (deg/s)" + delimeter + "R_{inertial} (deg/s)";
300 if (SubSystems & ssVelocities) {
301 outstream << delimeter;
302 outstream << "q bar (psf)" + delimeter;
303 outstream << "Reynolds Number" + delimeter;
304 outstream << "V_{Total} (ft/s)" + delimeter;
305 outstream << "V_{Inertial} (ft/s)" + delimeter;
306 outstream << "UBody" + delimeter + "VBody" + delimeter + "WBody" + delimeter;
307 outstream << "Aero V_{X Body} (ft/s)" + delimeter + "Aero V_{Y Body} (ft/s)" + delimeter + "Aero V_{Z Body} (ft/s)" + delimeter;
308 outstream << "V_{X_{inertial}} (ft/s)" + delimeter + "V_{Y_{inertial}} (ft/s)" + delimeter + "V_{Z_{inertial}} (ft/s)" + delimeter;
309 outstream << "V_{X_{ecef}} (ft/s)" + delimeter + "V_{Y_{ecef}} (ft/s)" + delimeter + "V_{Z_{ecef}} (ft/s)" + delimeter;
310 outstream << "V_{North} (ft/s)" + delimeter + "V_{East} (ft/s)" + delimeter + "V_{Down} (ft/s)";
312 if (SubSystems & ssForces) {
313 outstream << delimeter;
314 outstream << "F_{Drag} (lbs)" + delimeter + "F_{Side} (lbs)" + delimeter + "F_{Lift} (lbs)" + delimeter;
315 outstream << "L/D" + delimeter;
316 outstream << "F_{Aero x} (lbs)" + delimeter + "F_{Aero y} (lbs)" + delimeter + "F_{Aero z} (lbs)" + delimeter;
317 outstream << "F_{Prop x} (lbs)" + delimeter + "F_{Prop y} (lbs)" + delimeter + "F_{Prop z} (lbs)" + delimeter;
318 outstream << "F_{Gear x} (lbs)" + delimeter + "F_{Gear y} (lbs)" + delimeter + "F_{Gear z} (lbs)" + delimeter;
319 outstream << "F_{Ext x} (lbs)" + delimeter + "F_{Ext y} (lbs)" + delimeter + "F_{Ext z} (lbs)" + delimeter;
320 outstream << "F_{Buoyant x} (lbs)" + delimeter + "F_{Buoyant y} (lbs)" + delimeter + "F_{Buoyant z} (lbs)" + delimeter;
321 outstream << "F_{Total x} (lbs)" + delimeter + "F_{Total y} (lbs)" + delimeter + "F_{Total z} (lbs)";
323 if (SubSystems & ssMoments) {
324 outstream << delimeter;
325 outstream << "L_{Aero} (ft-lbs)" + delimeter + "M_{Aero} ( ft-lbs)" + delimeter + "N_{Aero} (ft-lbs)" + delimeter;
326 outstream << "L_{Prop} (ft-lbs)" + delimeter + "M_{Prop} (ft-lbs)" + delimeter + "N_{Prop} (ft-lbs)" + delimeter;
327 outstream << "L_{Gear} (ft-lbs)" + delimeter + "M_{Gear} (ft-lbs)" + delimeter + "N_{Gear} (ft-lbs)" + delimeter;
328 outstream << "L_{ext} (ft-lbs)" + delimeter + "M_{ext} (ft-lbs)" + delimeter + "N_{ext} (ft-lbs)" + delimeter;
329 outstream << "L_{Buoyant} (ft-lbs)" + delimeter + "M_{Buoyant} (ft-lbs)" + delimeter + "N_{Buoyant} (ft-lbs)" + delimeter;
330 outstream << "L_{Total} (ft-lbs)" + delimeter + "M_{Total} (ft-lbs)" + delimeter + "N_{Total} (ft-lbs)";
332 if (SubSystems & ssAtmosphere) {
333 outstream << delimeter;
334 outstream << "Rho (slugs/ft^3)" + delimeter;
335 outstream << "Absolute Viscosity" + delimeter;
336 outstream << "Kinematic Viscosity" + delimeter;
337 outstream << "Temperature (R)" + delimeter;
338 outstream << "P_{SL} (psf)" + delimeter;
339 outstream << "P_{Ambient} (psf)" + delimeter;
340 outstream << "Turbulence Magnitude (ft/sec)" + delimeter;
341 outstream << "Turbulence X Direction (rad)" + delimeter + "Turbulence Y Direction (rad)" + delimeter + "Turbulence Z Direction (rad)" + delimeter;
342 outstream << "Wind V_{North} (ft/s)" + delimeter + "Wind V_{East} (ft/s)" + delimeter + "Wind V_{Down} (ft/s)";
344 if (SubSystems & ssMassProps) {
345 outstream << delimeter;
346 outstream << "I_{xx}" + delimeter;
347 outstream << "I_{xy}" + delimeter;
348 outstream << "I_{xz}" + delimeter;
349 outstream << "I_{yx}" + delimeter;
350 outstream << "I_{yy}" + delimeter;
351 outstream << "I_{yz}" + delimeter;
352 outstream << "I_{zx}" + delimeter;
353 outstream << "I_{zy}" + delimeter;
354 outstream << "I_{zz}" + delimeter;
355 outstream << "Mass" + delimeter;
356 outstream << "X_{cg}" + delimeter + "Y_{cg}" + delimeter + "Z_{cg}";
358 if (SubSystems & ssPropagate) {
359 outstream << delimeter;
360 outstream << "Altitude ASL (ft)" + delimeter;
361 outstream << "Altitude AGL (ft)" + delimeter;
362 outstream << "Phi (deg)" + delimeter + "Theta (deg)" + delimeter + "Psi (deg)" + delimeter;
363 outstream << "Alpha (deg)" + delimeter;
364 outstream << "Beta (deg)" + delimeter;
365 outstream << "Latitude (deg)" + delimeter;
366 outstream << "Longitude (deg)" + delimeter;
367 outstream << "X_{ECI} (ft)" + delimeter + "Y_{ECI} (ft)" + delimeter + "Z_{ECI} (ft)" + delimeter;
368 outstream << "X_{ECEF} (ft)" + delimeter + "Y_{ECEF} (ft)" + delimeter + "Z_{ECEF} (ft)" + delimeter;
369 outstream << "Earth Position Angle (deg)" + delimeter;
370 outstream << "Distance AGL (ft)" + delimeter;
371 outstream << "Terrain Elevation (ft)";
373 if (SubSystems & ssAeroFunctions) {
374 scratch = Aerodynamics->GetAeroFunctionStrings(delimeter);
375 if (scratch.length() != 0) outstream << delimeter << scratch;
377 if (SubSystems & ssFCS) {
378 scratch = FCS->GetComponentStrings(delimeter);
379 if (scratch.length() != 0) outstream << delimeter << scratch;
381 if (SubSystems & ssGroundReactions) {
382 outstream << delimeter;
383 outstream << GroundReactions->GetGroundReactionStrings(delimeter);
385 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
386 outstream << delimeter;
387 outstream << Propulsion->GetPropulsionStrings(delimeter);
389 if (OutputProperties.size() > 0) {
390 for (unsigned int i=0;i<OutputProperties.size();i++) {
391 outstream << delimeter << OutputProperties[i]->GetPrintableName();
399 outstream << FDMExec->GetSimTime();
400 if (SubSystems & ssSimulation) {
402 if (SubSystems & ssAerosurfaces) {
403 outstream << delimeter;
404 outstream << FCS->GetDaCmd() << delimeter;
405 outstream << FCS->GetDeCmd() << delimeter;
406 outstream << FCS->GetDrCmd() << delimeter;
407 outstream << FCS->GetDfCmd() << delimeter;
408 outstream << FCS->GetDaLPos(ofDeg) << delimeter;
409 outstream << FCS->GetDaRPos(ofDeg) << delimeter;
410 outstream << FCS->GetDePos(ofDeg) << delimeter;
411 outstream << FCS->GetDrPos(ofDeg) << delimeter;
412 outstream << FCS->GetDfPos(ofDeg);
414 if (SubSystems & ssRates) {
415 outstream << delimeter;
416 outstream << (radtodeg*Propagate->GetPQR()).Dump(delimeter) << delimeter;
417 outstream << (radtodeg*Accelerations->GetPQRdot()).Dump(delimeter) << delimeter;
418 outstream << (radtodeg*Propagate->GetPQRi()).Dump(delimeter);
420 if (SubSystems & ssVelocities) {
421 outstream << delimeter;
422 outstream << Auxiliary->Getqbar() << delimeter;
423 outstream << Auxiliary->GetReynoldsNumber() << delimeter;
424 outstream << setprecision(12) << Auxiliary->GetVt() << delimeter;
425 outstream << Propagate->GetInertialVelocityMagnitude() << delimeter;
426 outstream << setprecision(12) << Propagate->GetUVW().Dump(delimeter) << delimeter;
427 outstream << Auxiliary->GetAeroUVW().Dump(delimeter) << delimeter;
428 outstream << Propagate->GetInertialVelocity().Dump(delimeter) << delimeter;
429 outstream << Propagate->GetECEFVelocity().Dump(delimeter) << delimeter;
430 outstream << Propagate->GetVel().Dump(delimeter);
431 outstream.precision(10);
433 if (SubSystems & ssForces) {
434 outstream << delimeter;
435 outstream << Aerodynamics->GetvFw().Dump(delimeter) << delimeter;
436 outstream << Aerodynamics->GetLoD() << delimeter;
437 outstream << Aerodynamics->GetForces().Dump(delimeter) << delimeter;
438 outstream << Propulsion->GetForces().Dump(delimeter) << delimeter;
439 outstream << GroundReactions->GetForces().Dump(delimeter) << delimeter;
440 outstream << ExternalReactions->GetForces().Dump(delimeter) << delimeter;
441 outstream << BuoyantForces->GetForces().Dump(delimeter) << delimeter;
442 outstream << Aircraft->GetForces().Dump(delimeter);
444 if (SubSystems & ssMoments) {
445 outstream << delimeter;
446 outstream << Aerodynamics->GetMoments().Dump(delimeter) << delimeter;
447 outstream << Propulsion->GetMoments().Dump(delimeter) << delimeter;
448 outstream << GroundReactions->GetMoments().Dump(delimeter) << delimeter;
449 outstream << ExternalReactions->GetMoments().Dump(delimeter) << delimeter;
450 outstream << BuoyantForces->GetMoments().Dump(delimeter) << delimeter;
451 outstream << Aircraft->GetMoments().Dump(delimeter);
453 if (SubSystems & ssAtmosphere) {
454 outstream << delimeter;
455 outstream << Atmosphere->GetDensity() << delimeter;
456 outstream << Atmosphere->GetAbsoluteViscosity() << delimeter;
457 outstream << Atmosphere->GetKinematicViscosity() << delimeter;
458 outstream << Atmosphere->GetTemperature() << delimeter;
459 outstream << Atmosphere->GetPressureSL() << delimeter;
460 outstream << Atmosphere->GetPressure() << delimeter;
461 outstream << Winds->GetTurbMagnitude() << delimeter;
462 outstream << Winds->GetTurbDirection().Dump(delimeter) << delimeter;
463 outstream << Winds->GetTotalWindNED().Dump(delimeter);
465 if (SubSystems & ssMassProps) {
466 outstream << delimeter;
467 outstream << MassBalance->GetJ().Dump(delimeter) << delimeter;
468 outstream << MassBalance->GetMass() << delimeter;
469 outstream << MassBalance->GetXYZcg().Dump(delimeter);
471 if (SubSystems & ssPropagate) {
472 outstream.precision(14);
473 outstream << delimeter;
474 outstream << Propagate->GetAltitudeASL() << delimeter;
475 outstream << Propagate->GetDistanceAGL() << delimeter;
476 outstream << (radtodeg*Propagate->GetEuler()).Dump(delimeter) << delimeter;
477 outstream << Auxiliary->Getalpha(inDegrees) << delimeter;
478 outstream << Auxiliary->Getbeta(inDegrees) << delimeter;
479 outstream << Propagate->GetLocation().GetLatitudeDeg() << delimeter;
480 outstream << Propagate->GetLocation().GetLongitudeDeg() << delimeter;
481 outstream.precision(18);
482 outstream << ((FGColumnVector3)Propagate->GetInertialPosition()).Dump(delimeter) << delimeter;
483 outstream << ((FGColumnVector3)Propagate->GetLocation()).Dump(delimeter) << delimeter;
484 outstream.precision(14);
485 outstream << Propagate->GetEarthPositionAngleDeg() << delimeter;
486 outstream << Propagate->GetDistanceAGL() << delimeter;
487 outstream << Propagate->GetTerrainElevation();
488 outstream.precision(10);
490 if (SubSystems & ssAeroFunctions) {
491 scratch = Aerodynamics->GetAeroFunctionValues(delimeter);
492 if (scratch.length() != 0) outstream << delimeter << scratch;
494 if (SubSystems & ssFCS) {
495 scratch = FCS->GetComponentValues(delimeter);
496 if (scratch.length() != 0) outstream << delimeter << scratch;
498 if (SubSystems & ssGroundReactions) {
499 outstream << delimeter;
500 outstream << GroundReactions->GetGroundReactionValues(delimeter);
502 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
503 outstream << delimeter;
504 outstream << Propulsion->GetPropulsionValues(delimeter);
507 outstream.precision(18);
508 for (unsigned int i=0;i<OutputProperties.size();i++) {
509 outstream << delimeter << OutputProperties[i]->getDoubleValue();
511 outstream.precision(10);
517 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
519 void FGOutput::SocketDataFill(FGNetFDM* net)
521 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
522 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
523 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
524 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
525 const FGPropagate* Propagate = FDMExec->GetPropagate();
526 const FGFCS* FCS = FDMExec->GetFCS();
527 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
531 net->version = FG_NET_FDM_VERSION;
534 net->longitude = Propagate->GetLocation().GetLongitude(); // geodetic (radians)
535 net->latitude = Propagate->GetLocation().GetLatitude(); // geodetic (radians)
536 net->altitude = Propagate->GetAltitudeASL()*0.3048; // altitude, above sea level (meters)
537 net->agl = (float)(Propagate->GetDistanceAGL()*0.3048); // altitude, above ground level (meters)
539 net->phi = (float)(Propagate->GetEuler(ePhi)); // roll (radians)
540 net->theta = (float)(Propagate->GetEuler(eTht)); // pitch (radians)
541 net->psi = (float)(Propagate->GetEuler(ePsi)); // yaw or true heading (radians)
543 net->alpha = (float)(Auxiliary->Getalpha()); // angle of attack (radians)
544 net->beta = (float)(Auxiliary->Getbeta()); // side slip angle (radians)
547 net->phidot = (float)(Auxiliary->GetEulerRates(ePhi)); // roll rate (radians/sec)
548 net->thetadot = (float)(Auxiliary->GetEulerRates(eTht)); // pitch rate (radians/sec)
549 net->psidot = (float)(Auxiliary->GetEulerRates(ePsi)); // yaw rate (radians/sec)
550 net->vcas = (float)(Auxiliary->GetVcalibratedFPS()); // VCAS, ft/sec
551 net->climb_rate = (float)(Propagate->Gethdot()); // altitude rate, ft/sec
552 net->v_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED frame, fps
553 net->v_east = (float)(Propagate->GetVel(eEast)); // east vel in NED frame, fps
554 net->v_down = (float)(Propagate->GetVel(eDown)); // down vel in NED frame, fps
555 //---ADD METHOD TO CALCULATE THESE TERMS---
556 net->v_wind_body_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED relative to airmass, fps
557 net->v_wind_body_east = (float)(Propagate->GetVel(eEast)); // east vel in NED relative to airmass, fps
558 net->v_wind_body_down = (float)(Propagate->GetVel(eDown)); // down vel in NED relative to airmass, fps
561 net->A_X_pilot = (float)(Auxiliary->GetPilotAccel(1)); // X body accel, ft/s/s
562 net->A_Y_pilot = (float)(Auxiliary->GetPilotAccel(2)); // Y body accel, ft/s/s
563 net->A_Z_pilot = (float)(Auxiliary->GetPilotAccel(3)); // Z body accel, ft/s/s
566 net->stall_warning = 0.0; // 0.0 - 1.0 indicating the amount of stall
567 net->slip_deg = (float)(Auxiliary->Getbeta(inDegrees)); // slip ball deflection, deg
570 net->num_engines = Propulsion->GetNumEngines(); // Number of valid engines
572 for (i=0; i<net->num_engines; i++) {
573 if (Propulsion->GetEngine(i)->GetRunning())
574 net->eng_state[i] = 2; // Engine state running
575 else if (Propulsion->GetEngine(i)->GetCranking())
576 net->eng_state[i] = 1; // Engine state cranking
578 net->eng_state[i] = 0; // Engine state off
580 switch (Propulsion->GetEngine(i)->GetType()) {
581 case (FGEngine::etRocket):
583 case (FGEngine::etPiston):
584 net->rpm[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getRPM());
585 net->fuel_flow[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getFuelFlow_gph());
586 net->fuel_px[i] = 0; // Fuel pressure, psi (N/A in current model)
587 net->egt[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->GetEGT());
588 net->cht[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getCylinderHeadTemp_degF());
589 net->mp_osi[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getManifoldPressure_inHg());
590 net->oil_temp[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilTemp_degF());
591 net->oil_px[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilPressure_psi());
592 net->tit[i] = 0; // Turbine Inlet Temperature (N/A for piston)
594 case (FGEngine::etTurbine):
596 case (FGEngine::etTurboprop):
598 case (FGEngine::etElectric):
600 case (FGEngine::etUnknown):
606 net->num_tanks = Propulsion->GetNumTanks(); // Max number of fuel tanks
608 for (i=0; i<net->num_tanks; i++) {
609 net->fuel_quantity[i] = (float)(((FGTank *)Propulsion->GetTank(i))->GetContents());
613 net->num_wheels = GroundReactions->GetNumGearUnits();
615 for (i=0; i<net->num_wheels; i++) {
616 net->wow[i] = GroundReactions->GetGearUnit(i)->GetWOW();
617 if (GroundReactions->GetGearUnit(i)->GetGearUnitDown())
618 net->gear_pos[i] = 1; //gear down, using FCS convention
620 net->gear_pos[i] = 0; //gear up, using FCS convention
621 net->gear_steer[i] = (float)(GroundReactions->GetGearUnit(i)->GetSteerNorm());
622 net->gear_compression[i] = (float)(GroundReactions->GetGearUnit(i)->GetCompLen());
626 net->cur_time = (long int)1234567890; // Friday, Feb 13, 2009, 23:31:30 UTC (not processed by FGFS anyway)
627 net->warp = 0; // offset in seconds to unix time
628 net->visibility = 25000.0; // visibility in meters (for env. effects)
630 // Control surface positions (normalized values)
631 net->elevator = (float)(FCS->GetDePos(ofNorm)); // Norm Elevator Pos, --
632 net->elevator_trim_tab = (float)(FCS->GetPitchTrimCmd()); // Norm Elev Trim Tab Pos, --
633 net->left_flap = (float)(FCS->GetDfPos(ofNorm)); // Norm Flap Pos, --
634 net->right_flap = (float)(FCS->GetDfPos(ofNorm)); // Norm Flap Pos, --
635 net->left_aileron = (float)(FCS->GetDaLPos(ofNorm)); // Norm L Aileron Pos, --
636 net->right_aileron = (float)(FCS->GetDaRPos(ofNorm)); // Norm R Aileron Pos, --
637 net->rudder = (float)(FCS->GetDrPos(ofNorm)); // Norm Rudder Pos, --
638 net->nose_wheel = (float)(FCS->GetDrPos(ofNorm)); // *** FIX *** Using Rudder Pos for NWS, --
639 net->speedbrake = (float)(FCS->GetDsbPos(ofNorm)); // Norm Speedbrake Pos, --
640 net->spoilers = (float)(FCS->GetDspPos(ofNorm)); // Norm Spoiler Pos, --
642 // Convert the net buffer to network format
643 if ( isLittleEndian ) {
644 net->version = htonl(net->version);
646 htond(net->longitude);
647 htond(net->latitude);
648 htond(net->altitude);
657 htonf(net->thetadot);
660 htonf(net->climb_rate);
664 htonf(net->v_wind_body_north);
665 htonf(net->v_wind_body_east);
666 htonf(net->v_wind_body_down);
668 htonf(net->A_X_pilot);
669 htonf(net->A_Y_pilot);
670 htonf(net->A_Z_pilot);
672 htonf(net->stall_warning);
673 htonf(net->slip_deg);
675 for (i=0; i<net->num_engines; ++i ) {
676 net->eng_state[i] = htonl(net->eng_state[i]);
678 htonf(net->fuel_flow[i]);
679 htonf(net->fuel_px[i]);
682 htonf(net->mp_osi[i]);
684 htonf(net->oil_temp[i]);
685 htonf(net->oil_px[i]);
687 net->num_engines = htonl(net->num_engines);
689 for (i=0; i<net->num_tanks; ++i ) {
690 htonf(net->fuel_quantity[i]);
692 net->num_tanks = htonl(net->num_tanks);
694 for (i=0; i<net->num_wheels; ++i ) {
695 net->wow[i] = htonl(net->wow[i]);
696 htonf(net->gear_pos[i]);
697 htonf(net->gear_steer[i]);
698 htonf(net->gear_compression[i]);
700 net->num_wheels = htonl(net->num_wheels);
702 net->cur_time = htonl( net->cur_time );
703 net->warp = htonl( net->warp );
704 htonf(net->visibility);
706 htonf(net->elevator);
707 htonf(net->elevator_trim_tab);
708 htonf(net->left_flap);
709 htonf(net->right_flap);
710 htonf(net->left_aileron);
711 htonf(net->right_aileron);
713 htonf(net->nose_wheel);
714 htonf(net->speedbrake);
715 htonf(net->spoilers);
719 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
721 void FGOutput::FlightGearSocketOutput(void)
723 int length = sizeof(fgSockBuf);
725 if (socket == NULL) return;
726 if (!socket->GetConnectStatus()) return;
728 SocketDataFill(&fgSockBuf);
729 socket->Send((char *)&fgSockBuf, length);
732 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
734 void FGOutput::SocketOutput(void)
736 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
737 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
738 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
739 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
740 const FGPropagate* Propagate = FDMExec->GetPropagate();
741 const FGAccelerations* Accelerations = FDMExec->GetAccelerations();
742 const FGFCS* FCS = FDMExec->GetFCS();
743 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
744 const FGWinds* Winds = FDMExec->GetWinds();
745 const FGAircraft* Aircraft = FDMExec->GetAircraft();
746 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
748 string asciiData, scratch;
750 if (socket == NULL) return;
751 if (!socket->GetConnectStatus()) return;
755 socket->Clear("<LABELS>");
756 socket->Append("Time");
758 if (SubSystems & ssAerosurfaces) {
759 socket->Append("Aileron Command");
760 socket->Append("Elevator Command");
761 socket->Append("Rudder Command");
762 socket->Append("Flap Command");
763 socket->Append("Left Aileron Position");
764 socket->Append("Right Aileron Position");
765 socket->Append("Elevator Position");
766 socket->Append("Rudder Position");
767 socket->Append("Flap Position");
770 if (SubSystems & ssRates) {
774 socket->Append("PDot");
775 socket->Append("QDot");
776 socket->Append("RDot");
779 if (SubSystems & ssVelocities) {
780 socket->Append("QBar");
781 socket->Append("Vtotal");
782 socket->Append("UBody");
783 socket->Append("VBody");
784 socket->Append("WBody");
785 socket->Append("UAero");
786 socket->Append("VAero");
787 socket->Append("WAero");
788 socket->Append("Vn");
789 socket->Append("Ve");
790 socket->Append("Vd");
792 if (SubSystems & ssForces) {
793 socket->Append("F_Drag");
794 socket->Append("F_Side");
795 socket->Append("F_Lift");
796 socket->Append("LoD");
797 socket->Append("Fx");
798 socket->Append("Fy");
799 socket->Append("Fz");
801 if (SubSystems & ssMoments) {
806 if (SubSystems & ssAtmosphere) {
807 socket->Append("Rho");
808 socket->Append("SL pressure");
809 socket->Append("Ambient pressure");
810 socket->Append("Turbulence Magnitude");
811 socket->Append("Turbulence Direction X");
812 socket->Append("Turbulence Direction Y");
813 socket->Append("Turbulence Direction Z");
814 socket->Append("NWind");
815 socket->Append("EWind");
816 socket->Append("DWind");
818 if (SubSystems & ssMassProps) {
819 socket->Append("Ixx");
820 socket->Append("Ixy");
821 socket->Append("Ixz");
822 socket->Append("Iyx");
823 socket->Append("Iyy");
824 socket->Append("Iyz");
825 socket->Append("Izx");
826 socket->Append("Izy");
827 socket->Append("Izz");
828 socket->Append("Mass");
829 socket->Append("Xcg");
830 socket->Append("Ycg");
831 socket->Append("Zcg");
833 if (SubSystems & ssPropagate) {
834 socket->Append("Altitude");
835 socket->Append("Phi (deg)");
836 socket->Append("Tht (deg)");
837 socket->Append("Psi (deg)");
838 socket->Append("Alpha (deg)");
839 socket->Append("Beta (deg)");
840 socket->Append("Latitude (deg)");
841 socket->Append("Longitude (deg)");
843 if (SubSystems & ssAeroFunctions) {
844 scratch = Aerodynamics->GetAeroFunctionStrings(",");
845 if (scratch.length() != 0) socket->Append(scratch);
847 if (SubSystems & ssFCS) {
848 scratch = FCS->GetComponentStrings(",");
849 if (scratch.length() != 0) socket->Append(scratch);
851 if (SubSystems & ssGroundReactions) {
852 socket->Append(GroundReactions->GetGroundReactionStrings(","));
854 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
855 socket->Append(Propulsion->GetPropulsionStrings(","));
857 if (OutputProperties.size() > 0) {
858 for (unsigned int i=0;i<OutputProperties.size();i++) {
859 socket->Append(OutputProperties[i]->GetPrintableName());
868 socket->Append(FDMExec->GetSimTime());
870 if (SubSystems & ssAerosurfaces) {
871 socket->Append(FCS->GetDaCmd());
872 socket->Append(FCS->GetDeCmd());
873 socket->Append(FCS->GetDrCmd());
874 socket->Append(FCS->GetDfCmd());
875 socket->Append(FCS->GetDaLPos());
876 socket->Append(FCS->GetDaRPos());
877 socket->Append(FCS->GetDePos());
878 socket->Append(FCS->GetDrPos());
879 socket->Append(FCS->GetDfPos());
881 if (SubSystems & ssRates) {
882 socket->Append(radtodeg*Propagate->GetPQR(eP));
883 socket->Append(radtodeg*Propagate->GetPQR(eQ));
884 socket->Append(radtodeg*Propagate->GetPQR(eR));
885 socket->Append(radtodeg*Accelerations->GetPQRdot(eP));
886 socket->Append(radtodeg*Accelerations->GetPQRdot(eQ));
887 socket->Append(radtodeg*Accelerations->GetPQRdot(eR));
889 if (SubSystems & ssVelocities) {
890 socket->Append(Auxiliary->Getqbar());
891 socket->Append(Auxiliary->GetVt());
892 socket->Append(Propagate->GetUVW(eU));
893 socket->Append(Propagate->GetUVW(eV));
894 socket->Append(Propagate->GetUVW(eW));
895 socket->Append(Auxiliary->GetAeroUVW(eU));
896 socket->Append(Auxiliary->GetAeroUVW(eV));
897 socket->Append(Auxiliary->GetAeroUVW(eW));
898 socket->Append(Propagate->GetVel(eNorth));
899 socket->Append(Propagate->GetVel(eEast));
900 socket->Append(Propagate->GetVel(eDown));
902 if (SubSystems & ssForces) {
903 socket->Append(Aerodynamics->GetvFw()(eDrag));
904 socket->Append(Aerodynamics->GetvFw()(eSide));
905 socket->Append(Aerodynamics->GetvFw()(eLift));
906 socket->Append(Aerodynamics->GetLoD());
907 socket->Append(Aircraft->GetForces(eX));
908 socket->Append(Aircraft->GetForces(eY));
909 socket->Append(Aircraft->GetForces(eZ));
911 if (SubSystems & ssMoments) {
912 socket->Append(Aircraft->GetMoments(eL));
913 socket->Append(Aircraft->GetMoments(eM));
914 socket->Append(Aircraft->GetMoments(eN));
916 if (SubSystems & ssAtmosphere) {
917 socket->Append(Atmosphere->GetDensity());
918 socket->Append(Atmosphere->GetPressureSL());
919 socket->Append(Atmosphere->GetPressure());
920 socket->Append(Winds->GetTurbMagnitude());
921 socket->Append(Winds->GetTurbDirection().Dump(","));
922 socket->Append(Winds->GetTotalWindNED().Dump(","));
924 if (SubSystems & ssMassProps) {
925 socket->Append(MassBalance->GetJ()(1,1));
926 socket->Append(MassBalance->GetJ()(1,2));
927 socket->Append(MassBalance->GetJ()(1,3));
928 socket->Append(MassBalance->GetJ()(2,1));
929 socket->Append(MassBalance->GetJ()(2,2));
930 socket->Append(MassBalance->GetJ()(2,3));
931 socket->Append(MassBalance->GetJ()(3,1));
932 socket->Append(MassBalance->GetJ()(3,2));
933 socket->Append(MassBalance->GetJ()(3,3));
934 socket->Append(MassBalance->GetMass());
935 socket->Append(MassBalance->GetXYZcg()(eX));
936 socket->Append(MassBalance->GetXYZcg()(eY));
937 socket->Append(MassBalance->GetXYZcg()(eZ));
939 if (SubSystems & ssPropagate) {
940 socket->Append(Propagate->GetAltitudeASL());
941 socket->Append(radtodeg*Propagate->GetEuler(ePhi));
942 socket->Append(radtodeg*Propagate->GetEuler(eTht));
943 socket->Append(radtodeg*Propagate->GetEuler(ePsi));
944 socket->Append(Auxiliary->Getalpha(inDegrees));
945 socket->Append(Auxiliary->Getbeta(inDegrees));
946 socket->Append(Propagate->GetLocation().GetLatitudeDeg());
947 socket->Append(Propagate->GetLocation().GetLongitudeDeg());
949 if (SubSystems & ssAeroFunctions) {
950 scratch = Aerodynamics->GetAeroFunctionValues(",");
951 if (scratch.length() != 0) socket->Append(scratch);
953 if (SubSystems & ssFCS) {
954 scratch = FCS->GetComponentValues(",");
955 if (scratch.length() != 0) socket->Append(scratch);
957 if (SubSystems & ssGroundReactions) {
958 socket->Append(GroundReactions->GetGroundReactionValues(","));
960 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
961 socket->Append(Propulsion->GetPropulsionValues(","));
964 for (unsigned int i=0;i<OutputProperties.size();i++) {
965 socket->Append(OutputProperties[i]->getDoubleValue());
971 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
973 void FGOutput::SocketStatusOutput(const string& out_str)
977 if (socket == NULL) return;
980 asciiData = string("<STATUS>") + out_str;
981 socket->Append(asciiData.c_str());
985 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
987 bool FGOutput::Load(Element* element)
991 double OutRate = 0.0;
993 Element *property_element;
995 string separator = "/";
997 if (!DirectivesFile.empty()) { // A directives filename from the command line overrides
998 output_file_name = DirectivesFile; // one found in the config file.
999 document = LoadXMLDocument(output_file_name);
1000 } else if (!element->GetAttributeValue("file").empty()) {
1001 output_file_name = FDMExec->GetRootDir() + element->GetAttributeValue("file");
1002 document = LoadXMLDocument(output_file_name);
1007 if (!document) return false;
1009 name = FDMExec->GetRootDir() + document->GetAttributeValue("name");
1010 SetType(document->GetAttributeValue("type"));
1011 Port = document->GetAttributeValue("port");
1012 if (!Port.empty() && (Type == otSocket || Type == otFlightGear)) {
1013 port = atoi(Port.c_str());
1014 SetProtocol(document->GetAttributeValue("protocol"));
1015 socket = new FGfdmSocket(name, port, Protocol);
1017 BaseFilename = Filename = name;
1019 if (!document->GetAttributeValue("rate").empty()) {
1020 OutRate = document->GetAttributeValueAsNumber("rate");
1025 if (document->FindElementValue("simulation") == string("ON"))
1026 SubSystems += ssSimulation;
1027 if (document->FindElementValue("aerosurfaces") == string("ON"))
1028 SubSystems += ssAerosurfaces;
1029 if (document->FindElementValue("rates") == string("ON"))
1030 SubSystems += ssRates;
1031 if (document->FindElementValue("velocities") == string("ON"))
1032 SubSystems += ssVelocities;
1033 if (document->FindElementValue("forces") == string("ON"))
1034 SubSystems += ssForces;
1035 if (document->FindElementValue("moments") == string("ON"))
1036 SubSystems += ssMoments;
1037 if (document->FindElementValue("atmosphere") == string("ON"))
1038 SubSystems += ssAtmosphere;
1039 if (document->FindElementValue("massprops") == string("ON"))
1040 SubSystems += ssMassProps;
1041 if (document->FindElementValue("position") == string("ON"))
1042 SubSystems += ssPropagate;
1043 if (document->FindElementValue("coefficients") == string("ON"))
1044 SubSystems += ssAeroFunctions;
1045 if (document->FindElementValue("ground_reactions") == string("ON"))
1046 SubSystems += ssGroundReactions;
1047 if (document->FindElementValue("fcs") == string("ON"))
1048 SubSystems += ssFCS;
1049 if (document->FindElementValue("propulsion") == string("ON"))
1050 SubSystems += ssPropulsion;
1051 property_element = document->FindElement("property");
1052 while (property_element) {
1053 string property_str = property_element->GetDataLine();
1054 FGPropertyManager* node = PropertyManager->GetNode(property_str);
1056 cerr << fgred << highint << endl << " No property by the name "
1057 << property_str << " has been defined. This property will " << endl
1058 << " not be logged. You should check your configuration file."
1061 OutputProperties.push_back(node);
1063 property_element = document->FindNextElement("property");
1073 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1075 void FGOutput::SetRate(double rtHz)
1077 rtHz = rtHz>1000?1000:(rtHz<0?0:rtHz);
1079 rate = (int)(0.5 + 1.0/(FDMExec->GetDeltaT()*rtHz));
1087 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1088 // The bitmasked value choices are as follows:
1089 // unset: In this case (the default) JSBSim would only print
1090 // out the normally expected messages, essentially echoing
1091 // the config files as they are read. If the environment
1092 // variable is not set, debug_lvl is set to 1 internally
1093 // 0: This requests JSBSim not to output any messages
1095 // 1: This value explicity requests the normal JSBSim
1097 // 2: This value asks for a message to be printed out when
1098 // a class is instantiated
1099 // 4: When this value is set, a message is displayed when a
1100 // FGModel object executes its Run() method
1101 // 8: When this value is set, various runtime state variables
1102 // are printed out periodically
1103 // 16: When set various parameters are sanity checked and
1104 // a message is printed out when they go out of bounds
1106 void FGOutput::Debug(int from)
1110 if (debug_lvl <= 0) return;
1112 if (debug_lvl & 1) { // Standard console startup message output
1113 if (from == 0) { // Constructor
1117 if (output_file_name.empty())
1118 cout << " " << "Output parameters read inline" << endl;
1120 cout << " Output parameters read from file: " << output_file_name << endl;
1122 if (Filename == "cout" || Filename == "COUT") {
1123 scratch = " Log output goes to screen console";
1124 } else if (!Filename.empty()) {
1125 scratch = " Log output goes to file: " + Filename;
1129 cout << scratch << " in CSV format output at rate " << 1/(FDMExec->GetDeltaT()*rate) << " Hz" << endl;
1133 cout << " No log output" << endl;
1137 if (SubSystems & ssSimulation) cout << " Simulation parameters logged" << endl;
1138 if (SubSystems & ssAerosurfaces) cout << " Aerosurface parameters logged" << endl;
1139 if (SubSystems & ssRates) cout << " Rate parameters logged" << endl;
1140 if (SubSystems & ssVelocities) cout << " Velocity parameters logged" << endl;
1141 if (SubSystems & ssForces) cout << " Force parameters logged" << endl;
1142 if (SubSystems & ssMoments) cout << " Moments parameters logged" << endl;
1143 if (SubSystems & ssAtmosphere) cout << " Atmosphere parameters logged" << endl;
1144 if (SubSystems & ssMassProps) cout << " Mass parameters logged" << endl;
1145 if (SubSystems & ssAeroFunctions) cout << " Coefficient parameters logged" << endl;
1146 if (SubSystems & ssPropagate) cout << " Propagate parameters logged" << endl;
1147 if (SubSystems & ssGroundReactions) cout << " Ground parameters logged" << endl;
1148 if (SubSystems & ssFCS) cout << " FCS parameters logged" << endl;
1149 if (SubSystems & ssPropulsion) cout << " Propulsion parameters logged" << endl;
1150 if (OutputProperties.size() > 0) cout << " Properties logged:" << endl;
1151 for (unsigned int i=0;i<OutputProperties.size();i++) {
1152 cout << " - " << OutputProperties[i]->GetName() << endl;
1156 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
1157 if (from == 0) cout << "Instantiated: FGOutput" << endl;
1158 if (from == 1) cout << "Destroyed: FGOutput" << endl;
1160 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
1162 if (debug_lvl & 8 ) { // Runtime state variables
1164 if (debug_lvl & 16) { // Sanity checking
1166 if (debug_lvl & 64) {
1167 if (from == 0) { // Constructor
1168 cout << IdSrc << endl;
1169 cout << IdHdr << endl;