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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
43 #include "FGFDMExec.h"
44 #include "FGAtmosphere.h"
46 #include "FGAerodynamics.h"
47 #include "FGGroundReactions.h"
48 #include "FGExternalReactions.h"
49 #include "FGBuoyantForces.h"
50 #include "FGAircraft.h"
51 #include "FGMassBalance.h"
52 #include "FGPropagate.h"
53 #include "FGAuxiliary.h"
54 #include "FGInertial.h"
55 #include "FGPropulsion.h"
56 #include "models/propulsion/FGEngine.h"
57 #include "models/propulsion/FGTank.h"
58 #include "models/propulsion/FGPiston.h"
64 #if defined(WIN32) && !defined(__CYGWIN__)
67 # include <netinet/in.h> // htonl() ntohl()
70 static const int endianTest = 1;
71 #define isLittleEndian (*((char *) &endianTest ) != 0)
77 static const char *IdSrc = "$Id: FGOutput.cpp,v 1.54 2011/03/11 13:02:26 jberndt Exp $";
78 static const char *IdHdr = ID_OUTPUT;
80 // (stolen from FGFS native_fdm.cxx)
81 // The function htond is defined this way due to the way some
82 // processors and OSes treat floating point values. Some will raise
83 // an exception whenever a "bad" floating point value is loaded into a
84 // floating point register. Solaris is notorious for this, but then
85 // so is LynxOS on the PowerPC. By translating the data in place,
86 // there is no need to load a FP register with the "corruped" floating
87 // point value. By doing the BIG_ENDIAN test, I can optimize the
88 // routine for big-endian processors so it can be as efficient as
90 static void htond (double &x)
92 if ( isLittleEndian ) {
96 Double_Overlay = (int *) &x;
97 Holding_Buffer = Double_Overlay [0];
99 Double_Overlay [0] = htonl (Double_Overlay [1]);
100 Double_Overlay [1] = htonl (Holding_Buffer);
107 static void htonf (float &x)
109 if ( isLittleEndian ) {
113 Float_Overlay = (int *) &x;
114 Holding_Buffer = Float_Overlay [0];
116 Float_Overlay [0] = htonl (Holding_Buffer);
123 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
127 FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex)
130 sFirstPass = dFirstPass = true;
136 StartNewFile = false;
138 BaseFilename = Filename = "";
140 output_file_name = "";
142 memset(&fgSockBuf, 0x00, sizeof(fgSockBuf));
147 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149 FGOutput::~FGOutput()
152 OutputProperties.clear();
156 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 bool FGOutput::InitModel(void)
160 if (!FGModel::InitModel()) return false;
162 if (Filename.size() > 0 && StartNewFile) {
164 string::size_type dot = BaseFilename.find_last_of('.');
165 if (dot != string::npos) {
166 buf << BaseFilename.substr(0, dot) << '_' << runID_postfix++ << BaseFilename.substr(dot);
168 buf << BaseFilename << '_' << runID_postfix++;
170 Filename = buf.str();
172 StartNewFile = false;
179 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 bool FGOutput::Run(void)
183 if (FGModel::Run()) return true;
185 if (enabled && !FDMExec->IntegrationSuspended() && !FDMExec->Holding()) {
193 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195 void FGOutput::Print(void)
197 if (Type == otSocket) {
199 } else if (Type == otFlightGear) {
200 FlightGearSocketOutput();
201 } else if (Type == otCSV || Type == otTab) {
202 DelimitedOutput(Filename);
203 } else if (Type == otTerminal) {
205 } else if (Type == otNone) {
208 // Not a valid type of output
212 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214 void FGOutput::SetType(const string& type)
219 } else if (type == "TABULAR") {
222 } else if (type == "SOCKET") {
224 } else if (type == "FLIGHTGEAR") {
226 } else if (type == "TERMINAL") {
228 } else if (type != string("NONE")) {
230 cerr << "Unknown type of output specified in config file" << endl;
234 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236 void FGOutput::SetProtocol(const string& protocol)
238 if (protocol == "UDP") Protocol = FGfdmSocket::ptUDP;
239 else if (protocol == "TCP") Protocol = FGfdmSocket::ptTCP;
240 else Protocol = FGfdmSocket::ptTCP; // Default to TCP
243 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
245 void FGOutput::DelimitedOutput(const string& fname)
247 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
248 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
249 const FGAircraft* Aircraft = FDMExec->GetAircraft();
250 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
251 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
252 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
253 const FGPropagate* Propagate = FDMExec->GetPropagate();
254 const FGFCS* FCS = FDMExec->GetFCS();
255 const FGInertial* Inertial = FDMExec->GetInertial();
256 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
257 const FGExternalReactions* ExternalReactions = FDMExec->GetExternalReactions();
258 const FGBuoyantForces* BuoyantForces = FDMExec->GetBuoyantForces();
263 if (fname == "COUT" || fname == "cout") {
264 buffer = cout.rdbuf();
266 if (!datafile.is_open()) datafile.open(fname.c_str());
267 buffer = datafile.rdbuf();
270 ostream outstream(buffer);
272 outstream.precision(10);
276 if (SubSystems & ssSimulation) {
279 if (SubSystems & ssAerosurfaces) {
280 outstream << delimeter;
281 outstream << "Aileron Command (norm)" + delimeter;
282 outstream << "Elevator Command (norm)" + delimeter;
283 outstream << "Rudder Command (norm)" + delimeter;
284 outstream << "Flap Command (norm)" + delimeter;
285 outstream << "Left Aileron Position (deg)" + delimeter;
286 outstream << "Right Aileron Position (deg)" + delimeter;
287 outstream << "Elevator Position (deg)" + delimeter;
288 outstream << "Rudder Position (deg)" + delimeter;
289 outstream << "Flap Position (deg)";
291 if (SubSystems & ssRates) {
292 outstream << delimeter;
293 outstream << "P (deg/s)" + delimeter + "Q (deg/s)" + delimeter + "R (deg/s)" + delimeter;
294 outstream << "P dot (deg/s^2)" + delimeter + "Q dot (deg/s^2)" + delimeter + "R dot (deg/s^2)" + delimeter;
295 outstream << "P_{inertial} (deg/s)" + delimeter + "Q_{inertial} (deg/s)" + delimeter + "R_{inertial} (deg/s)";
297 if (SubSystems & ssVelocities) {
298 outstream << delimeter;
299 outstream << "q bar (psf)" + delimeter;
300 outstream << "Reynolds Number" + delimeter;
301 outstream << "V_{Total} (ft/s)" + delimeter;
302 outstream << "V_{Inertial} (ft/s)" + delimeter;
303 outstream << "UBody" + delimeter + "VBody" + delimeter + "WBody" + delimeter;
304 outstream << "Aero V_{X Body} (ft/s)" + delimeter + "Aero V_{Y Body} (ft/s)" + delimeter + "Aero V_{Z Body} (ft/s)" + delimeter;
305 outstream << "V_{X_{inertial}} (ft/s)" + delimeter + "V_{Y_{inertial}} (ft/s)" + delimeter + "V_{Z_{inertial}} (ft/s)" + delimeter;
306 outstream << "V_{X_{ecef}} (ft/s)" + delimeter + "V_{Y_{ecef}} (ft/s)" + delimeter + "V_{Z_{ecef}} (ft/s)" + delimeter;
307 outstream << "V_{North} (ft/s)" + delimeter + "V_{East} (ft/s)" + delimeter + "V_{Down} (ft/s)";
309 if (SubSystems & ssForces) {
310 outstream << delimeter;
311 outstream << "F_{Drag} (lbs)" + delimeter + "F_{Side} (lbs)" + delimeter + "F_{Lift} (lbs)" + delimeter;
312 outstream << "L/D" + delimeter;
313 outstream << "F_{Aero x} (lbs)" + delimeter + "F_{Aero y} (lbs)" + delimeter + "F_{Aero z} (lbs)" + delimeter;
314 outstream << "F_{Prop x} (lbs)" + delimeter + "F_{Prop y} (lbs)" + delimeter + "F_{Prop z} (lbs)" + delimeter;
315 outstream << "F_{Gear x} (lbs)" + delimeter + "F_{Gear y} (lbs)" + delimeter + "F_{Gear z} (lbs)" + delimeter;
316 outstream << "F_{Ext x} (lbs)" + delimeter + "F_{Ext y} (lbs)" + delimeter + "F_{Ext z} (lbs)" + delimeter;
317 outstream << "F_{Buoyant x} (lbs)" + delimeter + "F_{Buoyant y} (lbs)" + delimeter + "F_{Buoyant z} (lbs)" + delimeter;
318 outstream << "F_{Total x} (lbs)" + delimeter + "F_{Total y} (lbs)" + delimeter + "F_{Total z} (lbs)";
320 if (SubSystems & ssMoments) {
321 outstream << delimeter;
322 outstream << "L_{Aero} (ft-lbs)" + delimeter + "M_{Aero} ( ft-lbs)" + delimeter + "N_{Aero} (ft-lbs)" + delimeter;
323 outstream << "L_{Prop} (ft-lbs)" + delimeter + "M_{Prop} (ft-lbs)" + delimeter + "N_{Prop} (ft-lbs)" + delimeter;
324 outstream << "L_{Gear} (ft-lbs)" + delimeter + "M_{Gear} (ft-lbs)" + delimeter + "N_{Gear} (ft-lbs)" + delimeter;
325 outstream << "L_{ext} (ft-lbs)" + delimeter + "M_{ext} (ft-lbs)" + delimeter + "N_{ext} (ft-lbs)" + delimeter;
326 outstream << "L_{Buoyant} (ft-lbs)" + delimeter + "M_{Buoyant} (ft-lbs)" + delimeter + "N_{Buoyant} (ft-lbs)" + delimeter;
327 outstream << "L_{Total} (ft-lbs)" + delimeter + "M_{Total} (ft-lbs)" + delimeter + "N_{Total} (ft-lbs)";
329 if (SubSystems & ssAtmosphere) {
330 outstream << delimeter;
331 outstream << "Rho (slugs/ft^3)" + delimeter;
332 outstream << "Absolute Viscosity" + delimeter;
333 outstream << "Kinematic Viscosity" + delimeter;
334 outstream << "Temperature (R)" + delimeter;
335 outstream << "P_{SL} (psf)" + delimeter;
336 outstream << "P_{Ambient} (psf)" + delimeter;
337 outstream << "Turbulence Magnitude (ft/sec)" + delimeter;
338 outstream << "Turbulence X Direction (rad)" + delimeter + "Turbulence Y Direction (rad)" + delimeter + "Turbulence Z Direction (rad)" + delimeter;
339 outstream << "Wind V_{North} (ft/s)" + delimeter + "Wind V_{East} (ft/s)" + delimeter + "Wind V_{Down} (ft/s)";
341 if (SubSystems & ssMassProps) {
342 outstream << delimeter;
343 outstream << "I_{xx}" + delimeter;
344 outstream << "I_{xy}" + delimeter;
345 outstream << "I_{xz}" + delimeter;
346 outstream << "I_{yx}" + delimeter;
347 outstream << "I_{yy}" + delimeter;
348 outstream << "I_{yz}" + delimeter;
349 outstream << "I_{zx}" + delimeter;
350 outstream << "I_{zy}" + delimeter;
351 outstream << "I_{zz}" + delimeter;
352 outstream << "Mass" + delimeter;
353 outstream << "X_{cg}" + delimeter + "Y_{cg}" + delimeter + "Z_{cg}";
355 if (SubSystems & ssPropagate) {
356 outstream << delimeter;
357 outstream << "Altitude ASL (ft)" + delimeter;
358 outstream << "Altitude AGL (ft)" + delimeter;
359 outstream << "Phi (deg)" + delimeter + "Theta (deg)" + delimeter + "Psi (deg)" + delimeter;
360 outstream << "Alpha (deg)" + delimeter;
361 outstream << "Beta (deg)" + delimeter;
362 outstream << "Latitude (deg)" + delimeter;
363 outstream << "Longitude (deg)" + delimeter;
364 outstream << "X_{ECI} (ft)" + delimeter + "Y_{ECI} (ft)" + delimeter + "Z_{ECI} (ft)" + delimeter;
365 outstream << "X_{ECEF} (ft)" + delimeter + "Y_{ECEF} (ft)" + delimeter + "Z_{ECEF} (ft)" + delimeter;
366 outstream << "Earth Position Angle (deg)" + delimeter;
367 outstream << "Distance AGL (ft)" + delimeter;
368 outstream << "Terrain Elevation (ft)";
370 if (SubSystems & ssAeroFunctions) {
371 scratch = Aerodynamics->GetAeroFunctionStrings(delimeter);
372 if (scratch.length() != 0) outstream << delimeter << scratch;
374 if (SubSystems & ssFCS) {
375 scratch = FCS->GetComponentStrings(delimeter);
376 if (scratch.length() != 0) outstream << delimeter << scratch;
378 if (SubSystems & ssGroundReactions) {
379 outstream << delimeter;
380 outstream << GroundReactions->GetGroundReactionStrings(delimeter);
382 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
383 outstream << delimeter;
384 outstream << Propulsion->GetPropulsionStrings(delimeter);
386 if (OutputProperties.size() > 0) {
387 for (unsigned int i=0;i<OutputProperties.size();i++) {
388 outstream << delimeter << OutputProperties[i]->GetPrintableName();
396 outstream << FDMExec->GetSimTime();
397 if (SubSystems & ssSimulation) {
399 if (SubSystems & ssAerosurfaces) {
400 outstream << delimeter;
401 outstream << FCS->GetDaCmd() << delimeter;
402 outstream << FCS->GetDeCmd() << delimeter;
403 outstream << FCS->GetDrCmd() << delimeter;
404 outstream << FCS->GetDfCmd() << delimeter;
405 outstream << FCS->GetDaLPos(ofDeg) << delimeter;
406 outstream << FCS->GetDaRPos(ofDeg) << delimeter;
407 outstream << FCS->GetDePos(ofDeg) << delimeter;
408 outstream << FCS->GetDrPos(ofDeg) << delimeter;
409 outstream << FCS->GetDfPos(ofDeg);
411 if (SubSystems & ssRates) {
412 outstream << delimeter;
413 outstream << (radtodeg*Propagate->GetPQR()).Dump(delimeter) << delimeter;
414 outstream << (radtodeg*Propagate->GetPQRdot()).Dump(delimeter) << delimeter;
415 outstream << (radtodeg*Propagate->GetPQRi()).Dump(delimeter);
417 if (SubSystems & ssVelocities) {
418 outstream << delimeter;
419 outstream << Auxiliary->Getqbar() << delimeter;
420 outstream << Auxiliary->GetReynoldsNumber() << delimeter;
421 outstream << setprecision(12) << Auxiliary->GetVt() << delimeter;
422 outstream << Propagate->GetInertialVelocityMagnitude() << delimeter;
423 outstream << setprecision(12) << Propagate->GetUVW().Dump(delimeter) << delimeter;
424 outstream << Auxiliary->GetAeroUVW().Dump(delimeter) << delimeter;
425 outstream << Propagate->GetInertialVelocity().Dump(delimeter) << delimeter;
426 outstream << Propagate->GetECEFVelocity().Dump(delimeter) << delimeter;
427 outstream << Propagate->GetVel().Dump(delimeter);
428 outstream.precision(10);
430 if (SubSystems & ssForces) {
431 outstream << delimeter;
432 outstream << Aerodynamics->GetvFw().Dump(delimeter) << delimeter;
433 outstream << Aerodynamics->GetLoD() << delimeter;
434 outstream << Aerodynamics->GetForces().Dump(delimeter) << delimeter;
435 outstream << Propulsion->GetForces().Dump(delimeter) << delimeter;
436 outstream << GroundReactions->GetForces().Dump(delimeter) << delimeter;
437 outstream << ExternalReactions->GetForces().Dump(delimeter) << delimeter;
438 outstream << BuoyantForces->GetForces().Dump(delimeter) << delimeter;
439 outstream << Aircraft->GetForces().Dump(delimeter);
441 if (SubSystems & ssMoments) {
442 outstream << delimeter;
443 outstream << Aerodynamics->GetMoments().Dump(delimeter) << delimeter;
444 outstream << Propulsion->GetMoments().Dump(delimeter) << delimeter;
445 outstream << GroundReactions->GetMoments().Dump(delimeter) << delimeter;
446 outstream << ExternalReactions->GetMoments().Dump(delimeter) << delimeter;
447 outstream << BuoyantForces->GetMoments().Dump(delimeter) << delimeter;
448 outstream << Aircraft->GetMoments().Dump(delimeter);
450 if (SubSystems & ssAtmosphere) {
451 outstream << delimeter;
452 outstream << Atmosphere->GetDensity() << delimeter;
453 outstream << Atmosphere->GetAbsoluteViscosity() << delimeter;
454 outstream << Atmosphere->GetKinematicViscosity() << delimeter;
455 outstream << Atmosphere->GetTemperature() << delimeter;
456 outstream << Atmosphere->GetPressureSL() << delimeter;
457 outstream << Atmosphere->GetPressure() << delimeter;
458 outstream << Atmosphere->GetTurbMagnitude() << delimeter;
459 outstream << Atmosphere->GetTurbDirection().Dump(delimeter) << delimeter;
460 outstream << Atmosphere->GetTotalWindNED().Dump(delimeter);
462 if (SubSystems & ssMassProps) {
463 outstream << delimeter;
464 outstream << MassBalance->GetJ().Dump(delimeter) << delimeter;
465 outstream << MassBalance->GetMass() << delimeter;
466 outstream << MassBalance->GetXYZcg().Dump(delimeter);
468 if (SubSystems & ssPropagate) {
469 outstream.precision(14);
470 outstream << delimeter;
471 outstream << Propagate->GetAltitudeASL() << delimeter;
472 outstream << Propagate->GetDistanceAGL() << delimeter;
473 outstream << (radtodeg*Propagate->GetEuler()).Dump(delimeter) << delimeter;
474 outstream << Auxiliary->Getalpha(inDegrees) << delimeter;
475 outstream << Auxiliary->Getbeta(inDegrees) << delimeter;
476 outstream << Propagate->GetLocation().GetLatitudeDeg() << delimeter;
477 outstream << Propagate->GetLocation().GetLongitudeDeg() << delimeter;
478 outstream.precision(18);
479 outstream << ((FGColumnVector3)Propagate->GetInertialPosition()).Dump(delimeter) << delimeter;
480 outstream << ((FGColumnVector3)Propagate->GetLocation()).Dump(delimeter) << delimeter;
481 outstream.precision(14);
482 outstream << Inertial->GetEarthPositionAngleDeg() << delimeter;
483 outstream << Propagate->GetDistanceAGL() << delimeter;
484 outstream << Propagate->GetTerrainElevation();
485 outstream.precision(10);
487 if (SubSystems & ssAeroFunctions) {
488 scratch = Aerodynamics->GetAeroFunctionValues(delimeter);
489 if (scratch.length() != 0) outstream << delimeter << scratch;
491 if (SubSystems & ssFCS) {
492 scratch = FCS->GetComponentValues(delimeter);
493 if (scratch.length() != 0) outstream << delimeter << scratch;
495 if (SubSystems & ssGroundReactions) {
496 outstream << delimeter;
497 outstream << GroundReactions->GetGroundReactionValues(delimeter);
499 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
500 outstream << delimeter;
501 outstream << Propulsion->GetPropulsionValues(delimeter);
504 outstream.precision(18);
505 for (unsigned int i=0;i<OutputProperties.size();i++) {
506 outstream << delimeter << OutputProperties[i]->getDoubleValue();
508 outstream.precision(10);
514 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
516 void FGOutput::SocketDataFill(FGNetFDM* net)
518 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
519 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
520 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
521 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
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 FGFCS* FCS = FDMExec->GetFCS();
739 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
740 const FGAircraft* Aircraft = FDMExec->GetAircraft();
741 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
743 string asciiData, scratch;
745 if (socket == NULL) return;
746 if (!socket->GetConnectStatus()) return;
750 socket->Clear("<LABELS>");
751 socket->Append("Time");
753 if (SubSystems & ssAerosurfaces) {
754 socket->Append("Aileron Command");
755 socket->Append("Elevator Command");
756 socket->Append("Rudder Command");
757 socket->Append("Flap Command");
758 socket->Append("Left Aileron Position");
759 socket->Append("Right Aileron Position");
760 socket->Append("Elevator Position");
761 socket->Append("Rudder Position");
762 socket->Append("Flap Position");
765 if (SubSystems & ssRates) {
769 socket->Append("PDot");
770 socket->Append("QDot");
771 socket->Append("RDot");
774 if (SubSystems & ssVelocities) {
775 socket->Append("QBar");
776 socket->Append("Vtotal");
777 socket->Append("UBody");
778 socket->Append("VBody");
779 socket->Append("WBody");
780 socket->Append("UAero");
781 socket->Append("VAero");
782 socket->Append("WAero");
783 socket->Append("Vn");
784 socket->Append("Ve");
785 socket->Append("Vd");
787 if (SubSystems & ssForces) {
788 socket->Append("F_Drag");
789 socket->Append("F_Side");
790 socket->Append("F_Lift");
791 socket->Append("LoD");
792 socket->Append("Fx");
793 socket->Append("Fy");
794 socket->Append("Fz");
796 if (SubSystems & ssMoments) {
801 if (SubSystems & ssAtmosphere) {
802 socket->Append("Rho");
803 socket->Append("SL pressure");
804 socket->Append("Ambient pressure");
805 socket->Append("Turbulence Magnitude");
806 socket->Append("Turbulence Direction X");
807 socket->Append("Turbulence Direction Y");
808 socket->Append("Turbulence Direction Z");
809 socket->Append("NWind");
810 socket->Append("EWind");
811 socket->Append("DWind");
813 if (SubSystems & ssMassProps) {
814 socket->Append("Ixx");
815 socket->Append("Ixy");
816 socket->Append("Ixz");
817 socket->Append("Iyx");
818 socket->Append("Iyy");
819 socket->Append("Iyz");
820 socket->Append("Izx");
821 socket->Append("Izy");
822 socket->Append("Izz");
823 socket->Append("Mass");
824 socket->Append("Xcg");
825 socket->Append("Ycg");
826 socket->Append("Zcg");
828 if (SubSystems & ssPropagate) {
829 socket->Append("Altitude");
830 socket->Append("Phi (deg)");
831 socket->Append("Tht (deg)");
832 socket->Append("Psi (deg)");
833 socket->Append("Alpha (deg)");
834 socket->Append("Beta (deg)");
835 socket->Append("Latitude (deg)");
836 socket->Append("Longitude (deg)");
838 if (SubSystems & ssAeroFunctions) {
839 scratch = Aerodynamics->GetAeroFunctionStrings(",");
840 if (scratch.length() != 0) socket->Append(scratch);
842 if (SubSystems & ssFCS) {
843 scratch = FCS->GetComponentStrings(",");
844 if (scratch.length() != 0) socket->Append(scratch);
846 if (SubSystems & ssGroundReactions) {
847 socket->Append(GroundReactions->GetGroundReactionStrings(","));
849 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
850 socket->Append(Propulsion->GetPropulsionStrings(","));
852 if (OutputProperties.size() > 0) {
853 for (unsigned int i=0;i<OutputProperties.size();i++) {
854 socket->Append(OutputProperties[i]->GetPrintableName());
863 socket->Append(FDMExec->GetSimTime());
865 if (SubSystems & ssAerosurfaces) {
866 socket->Append(FCS->GetDaCmd());
867 socket->Append(FCS->GetDeCmd());
868 socket->Append(FCS->GetDrCmd());
869 socket->Append(FCS->GetDfCmd());
870 socket->Append(FCS->GetDaLPos());
871 socket->Append(FCS->GetDaRPos());
872 socket->Append(FCS->GetDePos());
873 socket->Append(FCS->GetDrPos());
874 socket->Append(FCS->GetDfPos());
876 if (SubSystems & ssRates) {
877 socket->Append(radtodeg*Propagate->GetPQR(eP));
878 socket->Append(radtodeg*Propagate->GetPQR(eQ));
879 socket->Append(radtodeg*Propagate->GetPQR(eR));
880 socket->Append(radtodeg*Propagate->GetPQRdot(eP));
881 socket->Append(radtodeg*Propagate->GetPQRdot(eQ));
882 socket->Append(radtodeg*Propagate->GetPQRdot(eR));
884 if (SubSystems & ssVelocities) {
885 socket->Append(Auxiliary->Getqbar());
886 socket->Append(Auxiliary->GetVt());
887 socket->Append(Propagate->GetUVW(eU));
888 socket->Append(Propagate->GetUVW(eV));
889 socket->Append(Propagate->GetUVW(eW));
890 socket->Append(Auxiliary->GetAeroUVW(eU));
891 socket->Append(Auxiliary->GetAeroUVW(eV));
892 socket->Append(Auxiliary->GetAeroUVW(eW));
893 socket->Append(Propagate->GetVel(eNorth));
894 socket->Append(Propagate->GetVel(eEast));
895 socket->Append(Propagate->GetVel(eDown));
897 if (SubSystems & ssForces) {
898 socket->Append(Aerodynamics->GetvFw()(eDrag));
899 socket->Append(Aerodynamics->GetvFw()(eSide));
900 socket->Append(Aerodynamics->GetvFw()(eLift));
901 socket->Append(Aerodynamics->GetLoD());
902 socket->Append(Aircraft->GetForces(eX));
903 socket->Append(Aircraft->GetForces(eY));
904 socket->Append(Aircraft->GetForces(eZ));
906 if (SubSystems & ssMoments) {
907 socket->Append(Aircraft->GetMoments(eL));
908 socket->Append(Aircraft->GetMoments(eM));
909 socket->Append(Aircraft->GetMoments(eN));
911 if (SubSystems & ssAtmosphere) {
912 socket->Append(Atmosphere->GetDensity());
913 socket->Append(Atmosphere->GetPressureSL());
914 socket->Append(Atmosphere->GetPressure());
915 socket->Append(Atmosphere->GetTurbMagnitude());
916 socket->Append(Atmosphere->GetTurbDirection().Dump(","));
917 socket->Append(Atmosphere->GetTotalWindNED().Dump(","));
919 if (SubSystems & ssMassProps) {
920 socket->Append(MassBalance->GetJ()(1,1));
921 socket->Append(MassBalance->GetJ()(1,2));
922 socket->Append(MassBalance->GetJ()(1,3));
923 socket->Append(MassBalance->GetJ()(2,1));
924 socket->Append(MassBalance->GetJ()(2,2));
925 socket->Append(MassBalance->GetJ()(2,3));
926 socket->Append(MassBalance->GetJ()(3,1));
927 socket->Append(MassBalance->GetJ()(3,2));
928 socket->Append(MassBalance->GetJ()(3,3));
929 socket->Append(MassBalance->GetMass());
930 socket->Append(MassBalance->GetXYZcg()(eX));
931 socket->Append(MassBalance->GetXYZcg()(eY));
932 socket->Append(MassBalance->GetXYZcg()(eZ));
934 if (SubSystems & ssPropagate) {
935 socket->Append(Propagate->GetAltitudeASL());
936 socket->Append(radtodeg*Propagate->GetEuler(ePhi));
937 socket->Append(radtodeg*Propagate->GetEuler(eTht));
938 socket->Append(radtodeg*Propagate->GetEuler(ePsi));
939 socket->Append(Auxiliary->Getalpha(inDegrees));
940 socket->Append(Auxiliary->Getbeta(inDegrees));
941 socket->Append(Propagate->GetLocation().GetLatitudeDeg());
942 socket->Append(Propagate->GetLocation().GetLongitudeDeg());
944 if (SubSystems & ssAeroFunctions) {
945 scratch = Aerodynamics->GetAeroFunctionValues(",");
946 if (scratch.length() != 0) socket->Append(scratch);
948 if (SubSystems & ssFCS) {
949 scratch = FCS->GetComponentValues(",");
950 if (scratch.length() != 0) socket->Append(scratch);
952 if (SubSystems & ssGroundReactions) {
953 socket->Append(GroundReactions->GetGroundReactionValues(","));
955 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
956 socket->Append(Propulsion->GetPropulsionValues(","));
959 for (unsigned int i=0;i<OutputProperties.size();i++) {
960 socket->Append(OutputProperties[i]->getDoubleValue());
966 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
968 void FGOutput::SocketStatusOutput(const string& out_str)
972 if (socket == NULL) return;
975 asciiData = string("<STATUS>") + out_str;
976 socket->Append(asciiData.c_str());
980 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
982 bool FGOutput::Load(Element* element)
986 double OutRate = 0.0;
988 Element *property_element;
990 string separator = "/";
992 if (!DirectivesFile.empty()) { // A directives filename from the command line overrides
993 output_file_name = DirectivesFile; // one found in the config file.
994 document = LoadXMLDocument(output_file_name);
995 } else if (!element->GetAttributeValue("file").empty()) {
996 output_file_name = FDMExec->GetRootDir() + element->GetAttributeValue("file");
997 document = LoadXMLDocument(output_file_name);
1002 if (!document) return false;
1004 name = FDMExec->GetRootDir() + document->GetAttributeValue("name");
1005 SetType(document->GetAttributeValue("type"));
1006 Port = document->GetAttributeValue("port");
1007 if (!Port.empty() && (Type == otSocket || Type == otFlightGear)) {
1008 port = atoi(Port.c_str());
1009 SetProtocol(document->GetAttributeValue("protocol"));
1010 socket = new FGfdmSocket(name, port, Protocol);
1012 BaseFilename = Filename = name;
1014 if (!document->GetAttributeValue("rate").empty()) {
1015 OutRate = document->GetAttributeValueAsNumber("rate");
1020 if (document->FindElementValue("simulation") == string("ON"))
1021 SubSystems += ssSimulation;
1022 if (document->FindElementValue("aerosurfaces") == string("ON"))
1023 SubSystems += ssAerosurfaces;
1024 if (document->FindElementValue("rates") == string("ON"))
1025 SubSystems += ssRates;
1026 if (document->FindElementValue("velocities") == string("ON"))
1027 SubSystems += ssVelocities;
1028 if (document->FindElementValue("forces") == string("ON"))
1029 SubSystems += ssForces;
1030 if (document->FindElementValue("moments") == string("ON"))
1031 SubSystems += ssMoments;
1032 if (document->FindElementValue("atmosphere") == string("ON"))
1033 SubSystems += ssAtmosphere;
1034 if (document->FindElementValue("massprops") == string("ON"))
1035 SubSystems += ssMassProps;
1036 if (document->FindElementValue("position") == string("ON"))
1037 SubSystems += ssPropagate;
1038 if (document->FindElementValue("coefficients") == string("ON"))
1039 SubSystems += ssAeroFunctions;
1040 if (document->FindElementValue("ground_reactions") == string("ON"))
1041 SubSystems += ssGroundReactions;
1042 if (document->FindElementValue("fcs") == string("ON"))
1043 SubSystems += ssFCS;
1044 if (document->FindElementValue("propulsion") == string("ON"))
1045 SubSystems += ssPropulsion;
1046 property_element = document->FindElement("property");
1047 while (property_element) {
1048 string property_str = property_element->GetDataLine();
1049 FGPropertyManager* node = PropertyManager->GetNode(property_str);
1051 cerr << fgred << highint << endl << " No property by the name "
1052 << property_str << " has been defined. This property will " << endl
1053 << " not be logged. You should check your configuration file."
1056 OutputProperties.push_back(node);
1058 property_element = document->FindNextElement("property");
1068 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1070 void FGOutput::SetRate(double rtHz)
1072 rtHz = rtHz>1000?1000:(rtHz<0?0:rtHz);
1074 rate = (int)(0.5 + 1.0/(FDMExec->GetDeltaT()*rtHz));
1082 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1083 // The bitmasked value choices are as follows:
1084 // unset: In this case (the default) JSBSim would only print
1085 // out the normally expected messages, essentially echoing
1086 // the config files as they are read. If the environment
1087 // variable is not set, debug_lvl is set to 1 internally
1088 // 0: This requests JSBSim not to output any messages
1090 // 1: This value explicity requests the normal JSBSim
1092 // 2: This value asks for a message to be printed out when
1093 // a class is instantiated
1094 // 4: When this value is set, a message is displayed when a
1095 // FGModel object executes its Run() method
1096 // 8: When this value is set, various runtime state variables
1097 // are printed out periodically
1098 // 16: When set various parameters are sanity checked and
1099 // a message is printed out when they go out of bounds
1101 void FGOutput::Debug(int from)
1105 if (debug_lvl <= 0) return;
1107 if (debug_lvl & 1) { // Standard console startup message output
1108 if (from == 0) { // Constructor
1112 if (output_file_name.empty())
1113 cout << " " << "Output parameters read inline" << endl;
1115 cout << " Output parameters read from file: " << output_file_name << endl;
1117 if (Filename == "cout" || Filename == "COUT") {
1118 scratch = " Log output goes to screen console";
1119 } else if (!Filename.empty()) {
1120 scratch = " Log output goes to file: " + Filename;
1124 cout << scratch << " in CSV format output at rate " << 1/(FDMExec->GetDeltaT()*rate) << " Hz" << endl;
1128 cout << " No log output" << endl;
1132 if (SubSystems & ssSimulation) cout << " Simulation parameters logged" << endl;
1133 if (SubSystems & ssAerosurfaces) cout << " Aerosurface parameters logged" << endl;
1134 if (SubSystems & ssRates) cout << " Rate parameters logged" << endl;
1135 if (SubSystems & ssVelocities) cout << " Velocity parameters logged" << endl;
1136 if (SubSystems & ssForces) cout << " Force parameters logged" << endl;
1137 if (SubSystems & ssMoments) cout << " Moments parameters logged" << endl;
1138 if (SubSystems & ssAtmosphere) cout << " Atmosphere parameters logged" << endl;
1139 if (SubSystems & ssMassProps) cout << " Mass parameters logged" << endl;
1140 if (SubSystems & ssAeroFunctions) cout << " Coefficient parameters logged" << endl;
1141 if (SubSystems & ssPropagate) cout << " Propagate parameters logged" << endl;
1142 if (SubSystems & ssGroundReactions) cout << " Ground parameters logged" << endl;
1143 if (SubSystems & ssFCS) cout << " FCS parameters logged" << endl;
1144 if (SubSystems & ssPropulsion) cout << " Propulsion parameters logged" << endl;
1145 if (OutputProperties.size() > 0) cout << " Properties logged:" << endl;
1146 for (unsigned int i=0;i<OutputProperties.size();i++) {
1147 cout << " - " << OutputProperties[i]->GetName() << endl;
1151 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
1152 if (from == 0) cout << "Instantiated: FGOutput" << endl;
1153 if (from == 1) cout << "Destroyed: FGOutput" << endl;
1155 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
1157 if (debug_lvl & 8 ) { // Runtime state variables
1159 if (debug_lvl & 16) { // Sanity checking
1161 if (debug_lvl & 64) {
1162 if (from == 0) { // Constructor
1163 cout << IdSrc << endl;
1164 cout << IdHdr << endl;