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.67 2012/04/27 12:14: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 FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
259 const FGExternalReactions* ExternalReactions = FDMExec->GetExternalReactions();
260 const FGBuoyantForces* BuoyantForces = FDMExec->GetBuoyantForces();
265 if (fname == "COUT" || fname == "cout") {
266 buffer = cout.rdbuf();
268 if (!datafile.is_open()) datafile.open(fname.c_str());
269 buffer = datafile.rdbuf();
272 ostream outstream(buffer);
274 outstream.precision(10);
278 if (SubSystems & ssSimulation) {
281 if (SubSystems & ssAerosurfaces) {
282 outstream << delimeter;
283 outstream << "Aileron Command (norm)" + delimeter;
284 outstream << "Elevator Command (norm)" + delimeter;
285 outstream << "Rudder Command (norm)" + delimeter;
286 outstream << "Flap Command (norm)" + delimeter;
287 outstream << "Left Aileron Position (deg)" + delimeter;
288 outstream << "Right Aileron Position (deg)" + delimeter;
289 outstream << "Elevator Position (deg)" + delimeter;
290 outstream << "Rudder Position (deg)" + delimeter;
291 outstream << "Flap Position (deg)";
293 if (SubSystems & ssRates) {
294 outstream << delimeter;
295 outstream << "P (deg/s)" + delimeter + "Q (deg/s)" + delimeter + "R (deg/s)" + delimeter;
296 outstream << "P dot (deg/s^2)" + delimeter + "Q dot (deg/s^2)" + delimeter + "R dot (deg/s^2)" + delimeter;
297 outstream << "P_{inertial} (deg/s)" + delimeter + "Q_{inertial} (deg/s)" + delimeter + "R_{inertial} (deg/s)";
299 if (SubSystems & ssVelocities) {
300 outstream << delimeter;
301 outstream << "q bar (psf)" + delimeter;
302 outstream << "Reynolds Number" + delimeter;
303 outstream << "V_{Total} (ft/s)" + delimeter;
304 outstream << "V_{Inertial} (ft/s)" + delimeter;
305 outstream << "UBody" + delimeter + "VBody" + delimeter + "WBody" + delimeter;
306 outstream << "Aero V_{X Body} (ft/s)" + delimeter + "Aero V_{Y Body} (ft/s)" + delimeter + "Aero V_{Z Body} (ft/s)" + delimeter;
307 outstream << "V_{X_{inertial}} (ft/s)" + delimeter + "V_{Y_{inertial}} (ft/s)" + delimeter + "V_{Z_{inertial}} (ft/s)" + delimeter;
308 outstream << "V_{X_{ecef}} (ft/s)" + delimeter + "V_{Y_{ecef}} (ft/s)" + delimeter + "V_{Z_{ecef}} (ft/s)" + delimeter;
309 outstream << "V_{North} (ft/s)" + delimeter + "V_{East} (ft/s)" + delimeter + "V_{Down} (ft/s)";
311 if (SubSystems & ssForces) {
312 outstream << delimeter;
313 outstream << "F_{Drag} (lbs)" + delimeter + "F_{Side} (lbs)" + delimeter + "F_{Lift} (lbs)" + delimeter;
314 outstream << "L/D" + delimeter;
315 outstream << "F_{Aero x} (lbs)" + delimeter + "F_{Aero y} (lbs)" + delimeter + "F_{Aero z} (lbs)" + delimeter;
316 outstream << "F_{Prop x} (lbs)" + delimeter + "F_{Prop y} (lbs)" + delimeter + "F_{Prop z} (lbs)" + delimeter;
317 outstream << "F_{Gear x} (lbs)" + delimeter + "F_{Gear y} (lbs)" + delimeter + "F_{Gear z} (lbs)" + delimeter;
318 outstream << "F_{Ext x} (lbs)" + delimeter + "F_{Ext y} (lbs)" + delimeter + "F_{Ext z} (lbs)" + delimeter;
319 outstream << "F_{Buoyant x} (lbs)" + delimeter + "F_{Buoyant y} (lbs)" + delimeter + "F_{Buoyant z} (lbs)" + delimeter;
320 outstream << "F_{Total x} (lbs)" + delimeter + "F_{Total y} (lbs)" + delimeter + "F_{Total z} (lbs)";
322 if (SubSystems & ssMoments) {
323 outstream << delimeter;
324 outstream << "L_{Aero} (ft-lbs)" + delimeter + "M_{Aero} (ft-lbs)" + delimeter + "N_{Aero} (ft-lbs)" + delimeter;
325 outstream << "L_{Prop} (ft-lbs)" + delimeter + "M_{Prop} (ft-lbs)" + delimeter + "N_{Prop} (ft-lbs)" + delimeter;
326 outstream << "L_{Gear} (ft-lbs)" + delimeter + "M_{Gear} (ft-lbs)" + delimeter + "N_{Gear} (ft-lbs)" + delimeter;
327 outstream << "L_{ext} (ft-lbs)" + delimeter + "M_{ext} (ft-lbs)" + delimeter + "N_{ext} (ft-lbs)" + delimeter;
328 outstream << "L_{Buoyant} (ft-lbs)" + delimeter + "M_{Buoyant} (ft-lbs)" + delimeter + "N_{Buoyant} (ft-lbs)" + delimeter;
329 outstream << "L_{Total} (ft-lbs)" + delimeter + "M_{Total} (ft-lbs)" + delimeter + "N_{Total} (ft-lbs)";
331 if (SubSystems & ssAtmosphere) {
332 outstream << delimeter;
333 outstream << "Rho (slugs/ft^3)" + delimeter;
334 outstream << "Absolute Viscosity" + delimeter;
335 outstream << "Kinematic Viscosity" + delimeter;
336 outstream << "Temperature (R)" + delimeter;
337 outstream << "P_{SL} (psf)" + delimeter;
338 outstream << "P_{Ambient} (psf)" + delimeter;
339 outstream << "Turbulence Magnitude (ft/sec)" + delimeter;
340 outstream << "Turbulence X Direction (rad)" + delimeter + "Turbulence Y Direction (rad)" + delimeter + "Turbulence Z Direction (rad)" + delimeter;
341 outstream << "Wind V_{North} (ft/s)" + delimeter + "Wind V_{East} (ft/s)" + delimeter + "Wind V_{Down} (ft/s)";
343 if (SubSystems & ssMassProps) {
344 outstream << delimeter;
345 outstream << "I_{xx}" + delimeter;
346 outstream << "I_{xy}" + delimeter;
347 outstream << "I_{xz}" + delimeter;
348 outstream << "I_{yx}" + delimeter;
349 outstream << "I_{yy}" + delimeter;
350 outstream << "I_{yz}" + delimeter;
351 outstream << "I_{zx}" + delimeter;
352 outstream << "I_{zy}" + delimeter;
353 outstream << "I_{zz}" + delimeter;
354 outstream << "Mass" + delimeter;
355 outstream << "X_{cg}" + delimeter + "Y_{cg}" + delimeter + "Z_{cg}";
357 if (SubSystems & ssPropagate) {
358 outstream << delimeter;
359 outstream << "Altitude ASL (ft)" + delimeter;
360 outstream << "Altitude AGL (ft)" + delimeter;
361 outstream << "Phi (deg)" + delimeter + "Theta (deg)" + delimeter + "Psi (deg)" + delimeter;
362 outstream << "Alpha (deg)" + delimeter;
363 outstream << "Beta (deg)" + delimeter;
364 outstream << "Latitude (deg)" + delimeter;
365 outstream << "Longitude (deg)" + delimeter;
366 outstream << "X_{ECI} (ft)" + delimeter + "Y_{ECI} (ft)" + delimeter + "Z_{ECI} (ft)" + delimeter;
367 outstream << "X_{ECEF} (ft)" + delimeter + "Y_{ECEF} (ft)" + delimeter + "Z_{ECEF} (ft)" + delimeter;
368 outstream << "Earth Position Angle (deg)" + delimeter;
369 outstream << "Distance AGL (ft)" + delimeter;
370 outstream << "Terrain Elevation (ft)";
372 if (SubSystems & ssAeroFunctions) {
373 scratch = Aerodynamics->GetAeroFunctionStrings(delimeter);
374 if (scratch.length() != 0) outstream << delimeter << scratch;
376 if (SubSystems & ssFCS) {
377 scratch = FCS->GetComponentStrings(delimeter);
378 if (scratch.length() != 0) outstream << delimeter << scratch;
380 if (SubSystems & ssGroundReactions) {
381 outstream << delimeter;
382 outstream << GroundReactions->GetGroundReactionStrings(delimeter);
384 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
385 outstream << delimeter;
386 outstream << Propulsion->GetPropulsionStrings(delimeter);
388 if (OutputProperties.size() > 0) {
389 for (unsigned int i=0;i<OutputProperties.size();i++) {
390 outstream << delimeter << OutputProperties[i]->GetPrintableName();
398 outstream << FDMExec->GetSimTime();
399 if (SubSystems & ssSimulation) {
401 if (SubSystems & ssAerosurfaces) {
402 outstream << delimeter;
403 outstream << FCS->GetDaCmd() << delimeter;
404 outstream << FCS->GetDeCmd() << delimeter;
405 outstream << FCS->GetDrCmd() << delimeter;
406 outstream << FCS->GetDfCmd() << delimeter;
407 outstream << FCS->GetDaLPos(ofDeg) << delimeter;
408 outstream << FCS->GetDaRPos(ofDeg) << delimeter;
409 outstream << FCS->GetDePos(ofDeg) << delimeter;
410 outstream << FCS->GetDrPos(ofDeg) << delimeter;
411 outstream << FCS->GetDfPos(ofDeg);
413 if (SubSystems & ssRates) {
414 outstream << delimeter;
415 outstream << (radtodeg*Propagate->GetPQR()).Dump(delimeter) << delimeter;
416 outstream << (radtodeg*Accelerations->GetPQRdot()).Dump(delimeter) << delimeter;
417 outstream << (radtodeg*Propagate->GetPQRi()).Dump(delimeter);
419 if (SubSystems & ssVelocities) {
420 outstream << delimeter;
421 outstream << Auxiliary->Getqbar() << delimeter;
422 outstream << Auxiliary->GetReynoldsNumber() << delimeter;
423 outstream << setprecision(12) << Auxiliary->GetVt() << delimeter;
424 outstream << Propagate->GetInertialVelocityMagnitude() << delimeter;
425 outstream << setprecision(12) << Propagate->GetUVW().Dump(delimeter) << delimeter;
426 outstream << Auxiliary->GetAeroUVW().Dump(delimeter) << delimeter;
427 outstream << Propagate->GetInertialVelocity().Dump(delimeter) << delimeter;
428 outstream << Propagate->GetECEFVelocity().Dump(delimeter) << delimeter;
429 outstream << Propagate->GetVel().Dump(delimeter);
430 outstream.precision(10);
432 if (SubSystems & ssForces) {
433 outstream << delimeter;
434 outstream << Aerodynamics->GetvFw().Dump(delimeter) << delimeter;
435 outstream << Aerodynamics->GetLoD() << delimeter;
436 outstream << Aerodynamics->GetForces().Dump(delimeter) << delimeter;
437 outstream << Propulsion->GetForces().Dump(delimeter) << delimeter;
438 outstream << GroundReactions->GetForces().Dump(delimeter) << delimeter;
439 outstream << ExternalReactions->GetForces().Dump(delimeter) << delimeter;
440 outstream << BuoyantForces->GetForces().Dump(delimeter) << delimeter;
441 outstream << Aircraft->GetForces().Dump(delimeter);
443 if (SubSystems & ssMoments) {
444 outstream << delimeter;
445 outstream << Aerodynamics->GetMoments().Dump(delimeter) << delimeter;
446 outstream << Propulsion->GetMoments().Dump(delimeter) << delimeter;
447 outstream << GroundReactions->GetMoments().Dump(delimeter) << delimeter;
448 outstream << ExternalReactions->GetMoments().Dump(delimeter) << delimeter;
449 outstream << BuoyantForces->GetMoments().Dump(delimeter) << delimeter;
450 outstream << Aircraft->GetMoments().Dump(delimeter);
452 if (SubSystems & ssAtmosphere) {
453 outstream << delimeter;
454 outstream << Atmosphere->GetDensity() << delimeter;
455 outstream << Atmosphere->GetAbsoluteViscosity() << delimeter;
456 outstream << Atmosphere->GetKinematicViscosity() << delimeter;
457 outstream << Atmosphere->GetTemperature() << delimeter;
458 outstream << Atmosphere->GetPressureSL() << delimeter;
459 outstream << Atmosphere->GetPressure() << delimeter;
460 outstream << Winds->GetTurbMagnitude() << delimeter;
461 outstream << Winds->GetTurbDirection().Dump(delimeter) << delimeter;
462 outstream << Winds->GetTotalWindNED().Dump(delimeter);
464 if (SubSystems & ssMassProps) {
465 outstream << delimeter;
466 outstream << MassBalance->GetJ().Dump(delimeter) << delimeter;
467 outstream << MassBalance->GetMass() << delimeter;
468 outstream << MassBalance->GetXYZcg().Dump(delimeter);
470 if (SubSystems & ssPropagate) {
471 outstream.precision(14);
472 outstream << delimeter;
473 outstream << Propagate->GetAltitudeASL() << delimeter;
474 outstream << Propagate->GetDistanceAGL() << delimeter;
475 outstream << (radtodeg*Propagate->GetEuler()).Dump(delimeter) << delimeter;
476 outstream << Auxiliary->Getalpha(inDegrees) << delimeter;
477 outstream << Auxiliary->Getbeta(inDegrees) << delimeter;
478 outstream << Propagate->GetLocation().GetLatitudeDeg() << delimeter;
479 outstream << Propagate->GetLocation().GetLongitudeDeg() << delimeter;
480 outstream.precision(18);
481 outstream << ((FGColumnVector3)Propagate->GetInertialPosition()).Dump(delimeter) << delimeter;
482 outstream << ((FGColumnVector3)Propagate->GetLocation()).Dump(delimeter) << delimeter;
483 outstream.precision(14);
484 outstream << Propagate->GetEarthPositionAngleDeg() << delimeter;
485 outstream << Propagate->GetDistanceAGL() << delimeter;
486 outstream << Propagate->GetTerrainElevation();
487 outstream.precision(10);
489 if (SubSystems & ssAeroFunctions) {
490 scratch = Aerodynamics->GetAeroFunctionValues(delimeter);
491 if (scratch.length() != 0) outstream << delimeter << scratch;
493 if (SubSystems & ssFCS) {
494 scratch = FCS->GetComponentValues(delimeter);
495 if (scratch.length() != 0) outstream << delimeter << scratch;
497 if (SubSystems & ssGroundReactions) {
498 outstream << delimeter;
499 outstream << GroundReactions->GetGroundReactionValues(delimeter);
501 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
502 outstream << delimeter;
503 outstream << Propulsion->GetPropulsionValues(delimeter);
506 outstream.precision(18);
507 for (unsigned int i=0;i<OutputProperties.size();i++) {
508 outstream << delimeter << OutputProperties[i]->getDoubleValue();
510 outstream.precision(10);
516 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
518 void FGOutput::SocketDataFill(FGNetFDM* net)
520 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
521 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
522 const FGPropagate* Propagate = FDMExec->GetPropagate();
523 const FGFCS* FCS = FDMExec->GetFCS();
524 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
528 net->version = FG_NET_FDM_VERSION;
531 net->longitude = Propagate->GetLocation().GetLongitude(); // geodetic (radians)
532 net->latitude = Propagate->GetLocation().GetLatitude(); // geodetic (radians)
533 net->altitude = Propagate->GetAltitudeASL()*0.3048; // altitude, above sea level (meters)
534 net->agl = (float)(Propagate->GetDistanceAGL()*0.3048); // altitude, above ground level (meters)
536 net->phi = (float)(Propagate->GetEuler(ePhi)); // roll (radians)
537 net->theta = (float)(Propagate->GetEuler(eTht)); // pitch (radians)
538 net->psi = (float)(Propagate->GetEuler(ePsi)); // yaw or true heading (radians)
540 net->alpha = (float)(Auxiliary->Getalpha()); // angle of attack (radians)
541 net->beta = (float)(Auxiliary->Getbeta()); // side slip angle (radians)
544 net->phidot = (float)(Auxiliary->GetEulerRates(ePhi)); // roll rate (radians/sec)
545 net->thetadot = (float)(Auxiliary->GetEulerRates(eTht)); // pitch rate (radians/sec)
546 net->psidot = (float)(Auxiliary->GetEulerRates(ePsi)); // yaw rate (radians/sec)
547 net->vcas = (float)(Auxiliary->GetVcalibratedFPS()); // VCAS, ft/sec
548 net->climb_rate = (float)(Propagate->Gethdot()); // altitude rate, ft/sec
549 net->v_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED frame, fps
550 net->v_east = (float)(Propagate->GetVel(eEast)); // east vel in NED frame, fps
551 net->v_down = (float)(Propagate->GetVel(eDown)); // down vel in NED frame, fps
552 //---ADD METHOD TO CALCULATE THESE TERMS---
553 net->v_wind_body_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED relative to airmass, fps
554 net->v_wind_body_east = (float)(Propagate->GetVel(eEast)); // east vel in NED relative to airmass, fps
555 net->v_wind_body_down = (float)(Propagate->GetVel(eDown)); // down vel in NED relative to airmass, fps
558 net->A_X_pilot = (float)(Auxiliary->GetPilotAccel(1)); // X body accel, ft/s/s
559 net->A_Y_pilot = (float)(Auxiliary->GetPilotAccel(2)); // Y body accel, ft/s/s
560 net->A_Z_pilot = (float)(Auxiliary->GetPilotAccel(3)); // Z body accel, ft/s/s
563 net->stall_warning = 0.0; // 0.0 - 1.0 indicating the amount of stall
564 net->slip_deg = (float)(Auxiliary->Getbeta(inDegrees)); // slip ball deflection, deg
567 net->num_engines = Propulsion->GetNumEngines(); // Number of valid engines
569 for (i=0; i<net->num_engines; i++) {
570 if (Propulsion->GetEngine(i)->GetRunning())
571 net->eng_state[i] = 2; // Engine state running
572 else if (Propulsion->GetEngine(i)->GetCranking())
573 net->eng_state[i] = 1; // Engine state cranking
575 net->eng_state[i] = 0; // Engine state off
577 switch (Propulsion->GetEngine(i)->GetType()) {
578 case (FGEngine::etRocket):
580 case (FGEngine::etPiston):
581 net->rpm[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getRPM());
582 net->fuel_flow[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getFuelFlow_gph());
583 net->fuel_px[i] = 0; // Fuel pressure, psi (N/A in current model)
584 net->egt[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->GetEGT());
585 net->cht[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getCylinderHeadTemp_degF());
586 net->mp_osi[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getManifoldPressure_inHg());
587 net->oil_temp[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilTemp_degF());
588 net->oil_px[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilPressure_psi());
589 net->tit[i] = 0; // Turbine Inlet Temperature (N/A for piston)
591 case (FGEngine::etTurbine):
593 case (FGEngine::etTurboprop):
595 case (FGEngine::etElectric):
597 case (FGEngine::etUnknown):
603 net->num_tanks = Propulsion->GetNumTanks(); // Max number of fuel tanks
605 for (i=0; i<net->num_tanks; i++) {
606 net->fuel_quantity[i] = (float)(((FGTank *)Propulsion->GetTank(i))->GetContents());
610 net->num_wheels = GroundReactions->GetNumGearUnits();
612 for (i=0; i<net->num_wheels; i++) {
613 net->wow[i] = GroundReactions->GetGearUnit(i)->GetWOW();
614 if (GroundReactions->GetGearUnit(i)->GetGearUnitDown())
615 net->gear_pos[i] = 1; //gear down, using FCS convention
617 net->gear_pos[i] = 0; //gear up, using FCS convention
618 net->gear_steer[i] = (float)(GroundReactions->GetGearUnit(i)->GetSteerNorm());
619 net->gear_compression[i] = (float)(GroundReactions->GetGearUnit(i)->GetCompLen());
623 net->cur_time = (long int)1234567890; // Friday, Feb 13, 2009, 23:31:30 UTC (not processed by FGFS anyway)
624 net->warp = 0; // offset in seconds to unix time
625 net->visibility = 25000.0; // visibility in meters (for env. effects)
627 // Control surface positions (normalized values)
628 net->elevator = (float)(FCS->GetDePos(ofNorm)); // Norm Elevator Pos, --
629 net->elevator_trim_tab = (float)(FCS->GetPitchTrimCmd()); // Norm Elev Trim Tab Pos, --
630 net->left_flap = (float)(FCS->GetDfPos(ofNorm)); // Norm Flap Pos, --
631 net->right_flap = (float)(FCS->GetDfPos(ofNorm)); // Norm Flap Pos, --
632 net->left_aileron = (float)(FCS->GetDaLPos(ofNorm)); // Norm L Aileron Pos, --
633 net->right_aileron = (float)(FCS->GetDaRPos(ofNorm)); // Norm R Aileron Pos, --
634 net->rudder = (float)(FCS->GetDrPos(ofNorm)); // Norm Rudder Pos, --
635 net->nose_wheel = (float)(FCS->GetDrPos(ofNorm)); // *** FIX *** Using Rudder Pos for NWS, --
636 net->speedbrake = (float)(FCS->GetDsbPos(ofNorm)); // Norm Speedbrake Pos, --
637 net->spoilers = (float)(FCS->GetDspPos(ofNorm)); // Norm Spoiler Pos, --
639 // Convert the net buffer to network format
640 if ( isLittleEndian ) {
641 net->version = htonl(net->version);
643 htond(net->longitude);
644 htond(net->latitude);
645 htond(net->altitude);
654 htonf(net->thetadot);
657 htonf(net->climb_rate);
661 htonf(net->v_wind_body_north);
662 htonf(net->v_wind_body_east);
663 htonf(net->v_wind_body_down);
665 htonf(net->A_X_pilot);
666 htonf(net->A_Y_pilot);
667 htonf(net->A_Z_pilot);
669 htonf(net->stall_warning);
670 htonf(net->slip_deg);
672 for (i=0; i<net->num_engines; ++i ) {
673 net->eng_state[i] = htonl(net->eng_state[i]);
675 htonf(net->fuel_flow[i]);
676 htonf(net->fuel_px[i]);
679 htonf(net->mp_osi[i]);
681 htonf(net->oil_temp[i]);
682 htonf(net->oil_px[i]);
684 net->num_engines = htonl(net->num_engines);
686 for (i=0; i<net->num_tanks; ++i ) {
687 htonf(net->fuel_quantity[i]);
689 net->num_tanks = htonl(net->num_tanks);
691 for (i=0; i<net->num_wheels; ++i ) {
692 net->wow[i] = htonl(net->wow[i]);
693 htonf(net->gear_pos[i]);
694 htonf(net->gear_steer[i]);
695 htonf(net->gear_compression[i]);
697 net->num_wheels = htonl(net->num_wheels);
699 net->cur_time = htonl( net->cur_time );
700 net->warp = htonl( net->warp );
701 htonf(net->visibility);
703 htonf(net->elevator);
704 htonf(net->elevator_trim_tab);
705 htonf(net->left_flap);
706 htonf(net->right_flap);
707 htonf(net->left_aileron);
708 htonf(net->right_aileron);
710 htonf(net->nose_wheel);
711 htonf(net->speedbrake);
712 htonf(net->spoilers);
716 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
718 void FGOutput::FlightGearSocketOutput(void)
720 int length = sizeof(fgSockBuf);
722 if (socket == NULL) return;
723 if (!socket->GetConnectStatus()) return;
725 SocketDataFill(&fgSockBuf);
726 socket->Send((char *)&fgSockBuf, length);
729 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
731 void FGOutput::SocketOutput(void)
733 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
734 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
735 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
736 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
737 const FGPropagate* Propagate = FDMExec->GetPropagate();
738 const FGAccelerations* Accelerations = FDMExec->GetAccelerations();
739 const FGFCS* FCS = FDMExec->GetFCS();
740 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
741 const FGWinds* Winds = FDMExec->GetWinds();
742 const FGAircraft* Aircraft = FDMExec->GetAircraft();
743 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
745 string asciiData, scratch;
747 if (socket == NULL) return;
748 if (!socket->GetConnectStatus()) return;
752 socket->Clear("<LABELS>");
753 socket->Append("Time");
755 if (SubSystems & ssAerosurfaces) {
756 socket->Append("Aileron Command");
757 socket->Append("Elevator Command");
758 socket->Append("Rudder Command");
759 socket->Append("Flap Command");
760 socket->Append("Left Aileron Position");
761 socket->Append("Right Aileron Position");
762 socket->Append("Elevator Position");
763 socket->Append("Rudder Position");
764 socket->Append("Flap Position");
767 if (SubSystems & ssRates) {
771 socket->Append("PDot");
772 socket->Append("QDot");
773 socket->Append("RDot");
776 if (SubSystems & ssVelocities) {
777 socket->Append("QBar");
778 socket->Append("Vtotal");
779 socket->Append("UBody");
780 socket->Append("VBody");
781 socket->Append("WBody");
782 socket->Append("UAero");
783 socket->Append("VAero");
784 socket->Append("WAero");
785 socket->Append("Vn");
786 socket->Append("Ve");
787 socket->Append("Vd");
789 if (SubSystems & ssForces) {
790 socket->Append("F_Drag");
791 socket->Append("F_Side");
792 socket->Append("F_Lift");
793 socket->Append("LoD");
794 socket->Append("Fx");
795 socket->Append("Fy");
796 socket->Append("Fz");
798 if (SubSystems & ssMoments) {
803 if (SubSystems & ssAtmosphere) {
804 socket->Append("Rho");
805 socket->Append("SL pressure");
806 socket->Append("Ambient pressure");
807 socket->Append("Turbulence Magnitude");
808 socket->Append("Turbulence Direction X");
809 socket->Append("Turbulence Direction Y");
810 socket->Append("Turbulence Direction Z");
811 socket->Append("NWind");
812 socket->Append("EWind");
813 socket->Append("DWind");
815 if (SubSystems & ssMassProps) {
816 socket->Append("Ixx");
817 socket->Append("Ixy");
818 socket->Append("Ixz");
819 socket->Append("Iyx");
820 socket->Append("Iyy");
821 socket->Append("Iyz");
822 socket->Append("Izx");
823 socket->Append("Izy");
824 socket->Append("Izz");
825 socket->Append("Mass");
826 socket->Append("Xcg");
827 socket->Append("Ycg");
828 socket->Append("Zcg");
830 if (SubSystems & ssPropagate) {
831 socket->Append("Altitude");
832 socket->Append("Phi (deg)");
833 socket->Append("Tht (deg)");
834 socket->Append("Psi (deg)");
835 socket->Append("Alpha (deg)");
836 socket->Append("Beta (deg)");
837 socket->Append("Latitude (deg)");
838 socket->Append("Longitude (deg)");
840 if (SubSystems & ssAeroFunctions) {
841 scratch = Aerodynamics->GetAeroFunctionStrings(",");
842 if (scratch.length() != 0) socket->Append(scratch);
844 if (SubSystems & ssFCS) {
845 scratch = FCS->GetComponentStrings(",");
846 if (scratch.length() != 0) socket->Append(scratch);
848 if (SubSystems & ssGroundReactions) {
849 socket->Append(GroundReactions->GetGroundReactionStrings(","));
851 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
852 socket->Append(Propulsion->GetPropulsionStrings(","));
854 if (OutputProperties.size() > 0) {
855 for (unsigned int i=0;i<OutputProperties.size();i++) {
856 socket->Append(OutputProperties[i]->GetPrintableName());
865 socket->Append(FDMExec->GetSimTime());
867 if (SubSystems & ssAerosurfaces) {
868 socket->Append(FCS->GetDaCmd());
869 socket->Append(FCS->GetDeCmd());
870 socket->Append(FCS->GetDrCmd());
871 socket->Append(FCS->GetDfCmd());
872 socket->Append(FCS->GetDaLPos());
873 socket->Append(FCS->GetDaRPos());
874 socket->Append(FCS->GetDePos());
875 socket->Append(FCS->GetDrPos());
876 socket->Append(FCS->GetDfPos());
878 if (SubSystems & ssRates) {
879 socket->Append(radtodeg*Propagate->GetPQR(eP));
880 socket->Append(radtodeg*Propagate->GetPQR(eQ));
881 socket->Append(radtodeg*Propagate->GetPQR(eR));
882 socket->Append(radtodeg*Accelerations->GetPQRdot(eP));
883 socket->Append(radtodeg*Accelerations->GetPQRdot(eQ));
884 socket->Append(radtodeg*Accelerations->GetPQRdot(eR));
886 if (SubSystems & ssVelocities) {
887 socket->Append(Auxiliary->Getqbar());
888 socket->Append(Auxiliary->GetVt());
889 socket->Append(Propagate->GetUVW(eU));
890 socket->Append(Propagate->GetUVW(eV));
891 socket->Append(Propagate->GetUVW(eW));
892 socket->Append(Auxiliary->GetAeroUVW(eU));
893 socket->Append(Auxiliary->GetAeroUVW(eV));
894 socket->Append(Auxiliary->GetAeroUVW(eW));
895 socket->Append(Propagate->GetVel(eNorth));
896 socket->Append(Propagate->GetVel(eEast));
897 socket->Append(Propagate->GetVel(eDown));
899 if (SubSystems & ssForces) {
900 socket->Append(Aerodynamics->GetvFw()(eDrag));
901 socket->Append(Aerodynamics->GetvFw()(eSide));
902 socket->Append(Aerodynamics->GetvFw()(eLift));
903 socket->Append(Aerodynamics->GetLoD());
904 socket->Append(Aircraft->GetForces(eX));
905 socket->Append(Aircraft->GetForces(eY));
906 socket->Append(Aircraft->GetForces(eZ));
908 if (SubSystems & ssMoments) {
909 socket->Append(Aircraft->GetMoments(eL));
910 socket->Append(Aircraft->GetMoments(eM));
911 socket->Append(Aircraft->GetMoments(eN));
913 if (SubSystems & ssAtmosphere) {
914 socket->Append(Atmosphere->GetDensity());
915 socket->Append(Atmosphere->GetPressureSL());
916 socket->Append(Atmosphere->GetPressure());
917 socket->Append(Winds->GetTurbMagnitude());
918 socket->Append(Winds->GetTurbDirection().Dump(","));
919 socket->Append(Winds->GetTotalWindNED().Dump(","));
921 if (SubSystems & ssMassProps) {
922 socket->Append(MassBalance->GetJ()(1,1));
923 socket->Append(MassBalance->GetJ()(1,2));
924 socket->Append(MassBalance->GetJ()(1,3));
925 socket->Append(MassBalance->GetJ()(2,1));
926 socket->Append(MassBalance->GetJ()(2,2));
927 socket->Append(MassBalance->GetJ()(2,3));
928 socket->Append(MassBalance->GetJ()(3,1));
929 socket->Append(MassBalance->GetJ()(3,2));
930 socket->Append(MassBalance->GetJ()(3,3));
931 socket->Append(MassBalance->GetMass());
932 socket->Append(MassBalance->GetXYZcg()(eX));
933 socket->Append(MassBalance->GetXYZcg()(eY));
934 socket->Append(MassBalance->GetXYZcg()(eZ));
936 if (SubSystems & ssPropagate) {
937 socket->Append(Propagate->GetAltitudeASL());
938 socket->Append(radtodeg*Propagate->GetEuler(ePhi));
939 socket->Append(radtodeg*Propagate->GetEuler(eTht));
940 socket->Append(radtodeg*Propagate->GetEuler(ePsi));
941 socket->Append(Auxiliary->Getalpha(inDegrees));
942 socket->Append(Auxiliary->Getbeta(inDegrees));
943 socket->Append(Propagate->GetLocation().GetLatitudeDeg());
944 socket->Append(Propagate->GetLocation().GetLongitudeDeg());
946 if (SubSystems & ssAeroFunctions) {
947 scratch = Aerodynamics->GetAeroFunctionValues(",");
948 if (scratch.length() != 0) socket->Append(scratch);
950 if (SubSystems & ssFCS) {
951 scratch = FCS->GetComponentValues(",");
952 if (scratch.length() != 0) socket->Append(scratch);
954 if (SubSystems & ssGroundReactions) {
955 socket->Append(GroundReactions->GetGroundReactionValues(","));
957 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
958 socket->Append(Propulsion->GetPropulsionValues(","));
961 for (unsigned int i=0;i<OutputProperties.size();i++) {
962 socket->Append(OutputProperties[i]->getDoubleValue());
968 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
970 void FGOutput::SocketStatusOutput(const string& out_str)
974 if (socket == NULL) return;
977 asciiData = string("<STATUS>") + out_str;
978 socket->Append(asciiData.c_str());
982 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
984 bool FGOutput::Load(int subSystems, std::string protocol, std::string type, std::string port, std::string name, double outRate, std::vector<FGPropertyManager *> & outputProperties)
988 SubSystems = subSystems;
989 OutputProperties = outputProperties;
991 if (((Type == otCSV) || (Type == otTab)) && (name != "cout") && (name !="COUT"))
992 name = FDMExec->GetRootDir() + name;
994 if (!port.empty() && (Type == otSocket || Type == otFlightGear)) {
995 SetProtocol(protocol);
996 socket = new FGfdmSocket(name, atoi(port.c_str()), Protocol);
998 BaseFilename = Filename = name;
1005 bool FGOutput::Load(Element* element)
1008 Element *property_element;
1009 std::vector<FGPropertyManager *> outputProperties;
1011 if (!DirectivesFile.empty()) { // A directives filename from the command line overrides
1012 output_file_name = DirectivesFile; // one found in the config file.
1013 document = LoadXMLDocument(output_file_name);
1014 } else if (!element->GetAttributeValue("file").empty()) {
1015 output_file_name = FDMExec->GetRootDir() + element->GetAttributeValue("file");
1016 document = LoadXMLDocument(output_file_name);
1021 if (!document) return false;
1023 string type = document->GetAttributeValue("type");
1024 string name = document->GetAttributeValue("name");
1025 string port = document->GetAttributeValue("port");
1026 string protocol = document->GetAttributeValue("protocol");
1027 if (!document->GetAttributeValue("rate").empty()) {
1028 rate = document->GetAttributeValueAsNumber("rate");
1033 if (document->FindElementValue("simulation") == string("ON"))
1034 subSystems += ssSimulation;
1035 if (document->FindElementValue("aerosurfaces") == string("ON"))
1036 subSystems += ssAerosurfaces;
1037 if (document->FindElementValue("rates") == string("ON"))
1038 subSystems += ssRates;
1039 if (document->FindElementValue("velocities") == string("ON"))
1040 subSystems += ssVelocities;
1041 if (document->FindElementValue("forces") == string("ON"))
1042 subSystems += ssForces;
1043 if (document->FindElementValue("moments") == string("ON"))
1044 subSystems += ssMoments;
1045 if (document->FindElementValue("atmosphere") == string("ON"))
1046 subSystems += ssAtmosphere;
1047 if (document->FindElementValue("massprops") == string("ON"))
1048 subSystems += ssMassProps;
1049 if (document->FindElementValue("position") == string("ON"))
1050 subSystems += ssPropagate;
1051 if (document->FindElementValue("coefficients") == string("ON") || document->FindElementValue("aerodynamics") == string("ON"))
1052 subSystems += ssAeroFunctions;
1053 if (document->FindElementValue("ground_reactions") == string("ON"))
1054 subSystems += ssGroundReactions;
1055 if (document->FindElementValue("fcs") == string("ON"))
1056 subSystems += ssFCS;
1057 if (document->FindElementValue("propulsion") == string("ON"))
1058 subSystems += ssPropulsion;
1059 property_element = document->FindElement("property");
1060 while (property_element) {
1061 string property_str = property_element->GetDataLine();
1062 FGPropertyManager* node = PropertyManager->GetNode(property_str);
1064 cerr << fgred << highint << endl << " No property by the name "
1065 << property_str << " has been defined. This property will " << endl
1066 << " not be logged. You should check your configuration file."
1069 outputProperties.push_back(node);
1071 property_element = document->FindNextElement("property");
1074 return Load(subSystems, protocol, type, port, name, rate, outputProperties);
1079 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1081 void FGOutput::SetRate(double rtHz)
1083 rtHz = rtHz>1000?1000:(rtHz<0?0:rtHz);
1085 rate = (int)(0.5 + 1.0/(FDMExec->GetDeltaT()*rtHz));
1093 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1094 // The bitmasked value choices are as follows:
1095 // unset: In this case (the default) JSBSim would only print
1096 // out the normally expected messages, essentially echoing
1097 // the config files as they are read. If the environment
1098 // variable is not set, debug_lvl is set to 1 internally
1099 // 0: This requests JSBSim not to output any messages
1101 // 1: This value explicity requests the normal JSBSim
1103 // 2: This value asks for a message to be printed out when
1104 // a class is instantiated
1105 // 4: When this value is set, a message is displayed when a
1106 // FGModel object executes its Run() method
1107 // 8: When this value is set, various runtime state variables
1108 // are printed out periodically
1109 // 16: When set various parameters are sanity checked and
1110 // a message is printed out when they go out of bounds
1112 void FGOutput::Debug(int from)
1116 if (debug_lvl <= 0) return;
1118 if (debug_lvl & 1) { // Standard console startup message output
1119 if (from == 0) { // Constructor
1123 if (output_file_name.empty())
1124 cout << " " << "Output parameters read inline" << endl;
1126 cout << " Output parameters read from file: " << output_file_name << endl;
1128 if (Filename == "cout" || Filename == "COUT") {
1129 scratch = " Log output goes to screen console";
1130 } else if (!Filename.empty()) {
1131 scratch = " Log output goes to file: " + Filename;
1135 cout << scratch << " in CSV format output at rate " << 1/(FDMExec->GetDeltaT()*rate) << " Hz" << endl;
1139 cout << " No log output" << endl;
1143 if (SubSystems & ssSimulation) cout << " Simulation parameters logged" << endl;
1144 if (SubSystems & ssAerosurfaces) cout << " Aerosurface parameters logged" << endl;
1145 if (SubSystems & ssRates) cout << " Rate parameters logged" << endl;
1146 if (SubSystems & ssVelocities) cout << " Velocity parameters logged" << endl;
1147 if (SubSystems & ssForces) cout << " Force parameters logged" << endl;
1148 if (SubSystems & ssMoments) cout << " Moments parameters logged" << endl;
1149 if (SubSystems & ssAtmosphere) cout << " Atmosphere parameters logged" << endl;
1150 if (SubSystems & ssMassProps) cout << " Mass parameters logged" << endl;
1151 if (SubSystems & ssAeroFunctions) cout << " Coefficient parameters logged" << endl;
1152 if (SubSystems & ssPropagate) cout << " Propagate parameters logged" << endl;
1153 if (SubSystems & ssGroundReactions) cout << " Ground parameters logged" << endl;
1154 if (SubSystems & ssFCS) cout << " FCS parameters logged" << endl;
1155 if (SubSystems & ssPropulsion) cout << " Propulsion parameters logged" << endl;
1156 if (OutputProperties.size() > 0) cout << " Properties logged:" << endl;
1157 for (unsigned int i=0;i<OutputProperties.size();i++) {
1158 cout << " - " << OutputProperties[i]->GetName() << endl;
1162 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
1163 if (from == 0) cout << "Instantiated: FGOutput" << endl;
1164 if (from == 1) cout << "Destroyed: FGOutput" << endl;
1166 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
1168 if (debug_lvl & 8 ) { // Runtime state variables
1170 if (debug_lvl & 16) { // Sanity checking
1172 if (debug_lvl & 64) {
1173 if (from == 0) { // Constructor
1174 cout << IdSrc << endl;
1175 cout << IdHdr << endl;