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.55 2011/05/20 03:18:36 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 (Filename.size() > 0 && StartNewFile) {
162 string::size_type dot = BaseFilename.find_last_of('.');
163 if (dot != string::npos) {
164 buf << BaseFilename.substr(0, dot) << '_' << runID_postfix++ << BaseFilename.substr(dot);
166 buf << BaseFilename << '_' << runID_postfix++;
168 Filename = buf.str();
170 StartNewFile = false;
177 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 bool FGOutput::Run(bool Holding)
181 if (FGModel::Run(Holding)) return true;
183 if (enabled && !FDMExec->IntegrationSuspended() && !Holding) {
191 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193 void FGOutput::Print(void)
195 if (Type == otSocket) {
197 } else if (Type == otFlightGear) {
198 FlightGearSocketOutput();
199 } else if (Type == otCSV || Type == otTab) {
200 DelimitedOutput(Filename);
201 } else if (Type == otTerminal) {
203 } else if (Type == otNone) {
206 // Not a valid type of output
210 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212 void FGOutput::SetType(const string& type)
217 } else if (type == "TABULAR") {
220 } else if (type == "SOCKET") {
222 } else if (type == "FLIGHTGEAR") {
224 } else if (type == "TERMINAL") {
226 } else if (type != string("NONE")) {
228 cerr << "Unknown type of output specified in config file" << endl;
232 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234 void FGOutput::SetProtocol(const string& protocol)
236 if (protocol == "UDP") Protocol = FGfdmSocket::ptUDP;
237 else if (protocol == "TCP") Protocol = FGfdmSocket::ptTCP;
238 else Protocol = FGfdmSocket::ptTCP; // Default to TCP
241 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243 void FGOutput::DelimitedOutput(const string& fname)
245 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
246 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
247 const FGAircraft* Aircraft = FDMExec->GetAircraft();
248 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
249 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
250 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
251 const FGPropagate* Propagate = FDMExec->GetPropagate();
252 const FGFCS* FCS = FDMExec->GetFCS();
253 const FGInertial* Inertial = FDMExec->GetInertial();
254 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
255 const FGExternalReactions* ExternalReactions = FDMExec->GetExternalReactions();
256 const FGBuoyantForces* BuoyantForces = FDMExec->GetBuoyantForces();
261 if (fname == "COUT" || fname == "cout") {
262 buffer = cout.rdbuf();
264 if (!datafile.is_open()) datafile.open(fname.c_str());
265 buffer = datafile.rdbuf();
268 ostream outstream(buffer);
270 outstream.precision(10);
274 if (SubSystems & ssSimulation) {
277 if (SubSystems & ssAerosurfaces) {
278 outstream << delimeter;
279 outstream << "Aileron Command (norm)" + delimeter;
280 outstream << "Elevator Command (norm)" + delimeter;
281 outstream << "Rudder Command (norm)" + delimeter;
282 outstream << "Flap Command (norm)" + delimeter;
283 outstream << "Left Aileron Position (deg)" + delimeter;
284 outstream << "Right Aileron Position (deg)" + delimeter;
285 outstream << "Elevator Position (deg)" + delimeter;
286 outstream << "Rudder Position (deg)" + delimeter;
287 outstream << "Flap Position (deg)";
289 if (SubSystems & ssRates) {
290 outstream << delimeter;
291 outstream << "P (deg/s)" + delimeter + "Q (deg/s)" + delimeter + "R (deg/s)" + delimeter;
292 outstream << "P dot (deg/s^2)" + delimeter + "Q dot (deg/s^2)" + delimeter + "R dot (deg/s^2)" + delimeter;
293 outstream << "P_{inertial} (deg/s)" + delimeter + "Q_{inertial} (deg/s)" + delimeter + "R_{inertial} (deg/s)";
295 if (SubSystems & ssVelocities) {
296 outstream << delimeter;
297 outstream << "q bar (psf)" + delimeter;
298 outstream << "Reynolds Number" + delimeter;
299 outstream << "V_{Total} (ft/s)" + delimeter;
300 outstream << "V_{Inertial} (ft/s)" + delimeter;
301 outstream << "UBody" + delimeter + "VBody" + delimeter + "WBody" + delimeter;
302 outstream << "Aero V_{X Body} (ft/s)" + delimeter + "Aero V_{Y Body} (ft/s)" + delimeter + "Aero V_{Z Body} (ft/s)" + delimeter;
303 outstream << "V_{X_{inertial}} (ft/s)" + delimeter + "V_{Y_{inertial}} (ft/s)" + delimeter + "V_{Z_{inertial}} (ft/s)" + delimeter;
304 outstream << "V_{X_{ecef}} (ft/s)" + delimeter + "V_{Y_{ecef}} (ft/s)" + delimeter + "V_{Z_{ecef}} (ft/s)" + delimeter;
305 outstream << "V_{North} (ft/s)" + delimeter + "V_{East} (ft/s)" + delimeter + "V_{Down} (ft/s)";
307 if (SubSystems & ssForces) {
308 outstream << delimeter;
309 outstream << "F_{Drag} (lbs)" + delimeter + "F_{Side} (lbs)" + delimeter + "F_{Lift} (lbs)" + delimeter;
310 outstream << "L/D" + delimeter;
311 outstream << "F_{Aero x} (lbs)" + delimeter + "F_{Aero y} (lbs)" + delimeter + "F_{Aero z} (lbs)" + delimeter;
312 outstream << "F_{Prop x} (lbs)" + delimeter + "F_{Prop y} (lbs)" + delimeter + "F_{Prop z} (lbs)" + delimeter;
313 outstream << "F_{Gear x} (lbs)" + delimeter + "F_{Gear y} (lbs)" + delimeter + "F_{Gear z} (lbs)" + delimeter;
314 outstream << "F_{Ext x} (lbs)" + delimeter + "F_{Ext y} (lbs)" + delimeter + "F_{Ext z} (lbs)" + delimeter;
315 outstream << "F_{Buoyant x} (lbs)" + delimeter + "F_{Buoyant y} (lbs)" + delimeter + "F_{Buoyant z} (lbs)" + delimeter;
316 outstream << "F_{Total x} (lbs)" + delimeter + "F_{Total y} (lbs)" + delimeter + "F_{Total z} (lbs)";
318 if (SubSystems & ssMoments) {
319 outstream << delimeter;
320 outstream << "L_{Aero} (ft-lbs)" + delimeter + "M_{Aero} ( ft-lbs)" + delimeter + "N_{Aero} (ft-lbs)" + delimeter;
321 outstream << "L_{Prop} (ft-lbs)" + delimeter + "M_{Prop} (ft-lbs)" + delimeter + "N_{Prop} (ft-lbs)" + delimeter;
322 outstream << "L_{Gear} (ft-lbs)" + delimeter + "M_{Gear} (ft-lbs)" + delimeter + "N_{Gear} (ft-lbs)" + delimeter;
323 outstream << "L_{ext} (ft-lbs)" + delimeter + "M_{ext} (ft-lbs)" + delimeter + "N_{ext} (ft-lbs)" + delimeter;
324 outstream << "L_{Buoyant} (ft-lbs)" + delimeter + "M_{Buoyant} (ft-lbs)" + delimeter + "N_{Buoyant} (ft-lbs)" + delimeter;
325 outstream << "L_{Total} (ft-lbs)" + delimeter + "M_{Total} (ft-lbs)" + delimeter + "N_{Total} (ft-lbs)";
327 if (SubSystems & ssAtmosphere) {
328 outstream << delimeter;
329 outstream << "Rho (slugs/ft^3)" + delimeter;
330 outstream << "Absolute Viscosity" + delimeter;
331 outstream << "Kinematic Viscosity" + delimeter;
332 outstream << "Temperature (R)" + delimeter;
333 outstream << "P_{SL} (psf)" + delimeter;
334 outstream << "P_{Ambient} (psf)" + delimeter;
335 outstream << "Turbulence Magnitude (ft/sec)" + delimeter;
336 outstream << "Turbulence X Direction (rad)" + delimeter + "Turbulence Y Direction (rad)" + delimeter + "Turbulence Z Direction (rad)" + delimeter;
337 outstream << "Wind V_{North} (ft/s)" + delimeter + "Wind V_{East} (ft/s)" + delimeter + "Wind V_{Down} (ft/s)";
339 if (SubSystems & ssMassProps) {
340 outstream << delimeter;
341 outstream << "I_{xx}" + delimeter;
342 outstream << "I_{xy}" + delimeter;
343 outstream << "I_{xz}" + delimeter;
344 outstream << "I_{yx}" + delimeter;
345 outstream << "I_{yy}" + delimeter;
346 outstream << "I_{yz}" + delimeter;
347 outstream << "I_{zx}" + delimeter;
348 outstream << "I_{zy}" + delimeter;
349 outstream << "I_{zz}" + delimeter;
350 outstream << "Mass" + delimeter;
351 outstream << "X_{cg}" + delimeter + "Y_{cg}" + delimeter + "Z_{cg}";
353 if (SubSystems & ssPropagate) {
354 outstream << delimeter;
355 outstream << "Altitude ASL (ft)" + delimeter;
356 outstream << "Altitude AGL (ft)" + delimeter;
357 outstream << "Phi (deg)" + delimeter + "Theta (deg)" + delimeter + "Psi (deg)" + delimeter;
358 outstream << "Alpha (deg)" + delimeter;
359 outstream << "Beta (deg)" + delimeter;
360 outstream << "Latitude (deg)" + delimeter;
361 outstream << "Longitude (deg)" + delimeter;
362 outstream << "X_{ECI} (ft)" + delimeter + "Y_{ECI} (ft)" + delimeter + "Z_{ECI} (ft)" + delimeter;
363 outstream << "X_{ECEF} (ft)" + delimeter + "Y_{ECEF} (ft)" + delimeter + "Z_{ECEF} (ft)" + delimeter;
364 outstream << "Earth Position Angle (deg)" + delimeter;
365 outstream << "Distance AGL (ft)" + delimeter;
366 outstream << "Terrain Elevation (ft)";
368 if (SubSystems & ssAeroFunctions) {
369 scratch = Aerodynamics->GetAeroFunctionStrings(delimeter);
370 if (scratch.length() != 0) outstream << delimeter << scratch;
372 if (SubSystems & ssFCS) {
373 scratch = FCS->GetComponentStrings(delimeter);
374 if (scratch.length() != 0) outstream << delimeter << scratch;
376 if (SubSystems & ssGroundReactions) {
377 outstream << delimeter;
378 outstream << GroundReactions->GetGroundReactionStrings(delimeter);
380 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
381 outstream << delimeter;
382 outstream << Propulsion->GetPropulsionStrings(delimeter);
384 if (OutputProperties.size() > 0) {
385 for (unsigned int i=0;i<OutputProperties.size();i++) {
386 outstream << delimeter << OutputProperties[i]->GetPrintableName();
394 outstream << FDMExec->GetSimTime();
395 if (SubSystems & ssSimulation) {
397 if (SubSystems & ssAerosurfaces) {
398 outstream << delimeter;
399 outstream << FCS->GetDaCmd() << delimeter;
400 outstream << FCS->GetDeCmd() << delimeter;
401 outstream << FCS->GetDrCmd() << delimeter;
402 outstream << FCS->GetDfCmd() << delimeter;
403 outstream << FCS->GetDaLPos(ofDeg) << delimeter;
404 outstream << FCS->GetDaRPos(ofDeg) << delimeter;
405 outstream << FCS->GetDePos(ofDeg) << delimeter;
406 outstream << FCS->GetDrPos(ofDeg) << delimeter;
407 outstream << FCS->GetDfPos(ofDeg);
409 if (SubSystems & ssRates) {
410 outstream << delimeter;
411 outstream << (radtodeg*Propagate->GetPQR()).Dump(delimeter) << delimeter;
412 outstream << (radtodeg*Propagate->GetPQRdot()).Dump(delimeter) << delimeter;
413 outstream << (radtodeg*Propagate->GetPQRi()).Dump(delimeter);
415 if (SubSystems & ssVelocities) {
416 outstream << delimeter;
417 outstream << Auxiliary->Getqbar() << delimeter;
418 outstream << Auxiliary->GetReynoldsNumber() << delimeter;
419 outstream << setprecision(12) << Auxiliary->GetVt() << delimeter;
420 outstream << Propagate->GetInertialVelocityMagnitude() << delimeter;
421 outstream << setprecision(12) << Propagate->GetUVW().Dump(delimeter) << delimeter;
422 outstream << Auxiliary->GetAeroUVW().Dump(delimeter) << delimeter;
423 outstream << Propagate->GetInertialVelocity().Dump(delimeter) << delimeter;
424 outstream << Propagate->GetECEFVelocity().Dump(delimeter) << delimeter;
425 outstream << Propagate->GetVel().Dump(delimeter);
426 outstream.precision(10);
428 if (SubSystems & ssForces) {
429 outstream << delimeter;
430 outstream << Aerodynamics->GetvFw().Dump(delimeter) << delimeter;
431 outstream << Aerodynamics->GetLoD() << delimeter;
432 outstream << Aerodynamics->GetForces().Dump(delimeter) << delimeter;
433 outstream << Propulsion->GetForces().Dump(delimeter) << delimeter;
434 outstream << GroundReactions->GetForces().Dump(delimeter) << delimeter;
435 outstream << ExternalReactions->GetForces().Dump(delimeter) << delimeter;
436 outstream << BuoyantForces->GetForces().Dump(delimeter) << delimeter;
437 outstream << Aircraft->GetForces().Dump(delimeter);
439 if (SubSystems & ssMoments) {
440 outstream << delimeter;
441 outstream << Aerodynamics->GetMoments().Dump(delimeter) << delimeter;
442 outstream << Propulsion->GetMoments().Dump(delimeter) << delimeter;
443 outstream << GroundReactions->GetMoments().Dump(delimeter) << delimeter;
444 outstream << ExternalReactions->GetMoments().Dump(delimeter) << delimeter;
445 outstream << BuoyantForces->GetMoments().Dump(delimeter) << delimeter;
446 outstream << Aircraft->GetMoments().Dump(delimeter);
448 if (SubSystems & ssAtmosphere) {
449 outstream << delimeter;
450 outstream << Atmosphere->GetDensity() << delimeter;
451 outstream << Atmosphere->GetAbsoluteViscosity() << delimeter;
452 outstream << Atmosphere->GetKinematicViscosity() << delimeter;
453 outstream << Atmosphere->GetTemperature() << delimeter;
454 outstream << Atmosphere->GetPressureSL() << delimeter;
455 outstream << Atmosphere->GetPressure() << delimeter;
456 outstream << Atmosphere->GetTurbMagnitude() << delimeter;
457 outstream << Atmosphere->GetTurbDirection().Dump(delimeter) << delimeter;
458 outstream << Atmosphere->GetTotalWindNED().Dump(delimeter);
460 if (SubSystems & ssMassProps) {
461 outstream << delimeter;
462 outstream << MassBalance->GetJ().Dump(delimeter) << delimeter;
463 outstream << MassBalance->GetMass() << delimeter;
464 outstream << MassBalance->GetXYZcg().Dump(delimeter);
466 if (SubSystems & ssPropagate) {
467 outstream.precision(14);
468 outstream << delimeter;
469 outstream << Propagate->GetAltitudeASL() << delimeter;
470 outstream << Propagate->GetDistanceAGL() << delimeter;
471 outstream << (radtodeg*Propagate->GetEuler()).Dump(delimeter) << delimeter;
472 outstream << Auxiliary->Getalpha(inDegrees) << delimeter;
473 outstream << Auxiliary->Getbeta(inDegrees) << delimeter;
474 outstream << Propagate->GetLocation().GetLatitudeDeg() << delimeter;
475 outstream << Propagate->GetLocation().GetLongitudeDeg() << delimeter;
476 outstream.precision(18);
477 outstream << ((FGColumnVector3)Propagate->GetInertialPosition()).Dump(delimeter) << delimeter;
478 outstream << ((FGColumnVector3)Propagate->GetLocation()).Dump(delimeter) << delimeter;
479 outstream.precision(14);
480 outstream << Inertial->GetEarthPositionAngleDeg() << delimeter;
481 outstream << Propagate->GetDistanceAGL() << delimeter;
482 outstream << Propagate->GetTerrainElevation();
483 outstream.precision(10);
485 if (SubSystems & ssAeroFunctions) {
486 scratch = Aerodynamics->GetAeroFunctionValues(delimeter);
487 if (scratch.length() != 0) outstream << delimeter << scratch;
489 if (SubSystems & ssFCS) {
490 scratch = FCS->GetComponentValues(delimeter);
491 if (scratch.length() != 0) outstream << delimeter << scratch;
493 if (SubSystems & ssGroundReactions) {
494 outstream << delimeter;
495 outstream << GroundReactions->GetGroundReactionValues(delimeter);
497 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
498 outstream << delimeter;
499 outstream << Propulsion->GetPropulsionValues(delimeter);
502 outstream.precision(18);
503 for (unsigned int i=0;i<OutputProperties.size();i++) {
504 outstream << delimeter << OutputProperties[i]->getDoubleValue();
506 outstream.precision(10);
512 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
514 void FGOutput::SocketDataFill(FGNetFDM* net)
516 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
517 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
518 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
519 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
520 const FGPropagate* Propagate = FDMExec->GetPropagate();
521 const FGFCS* FCS = FDMExec->GetFCS();
522 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
526 net->version = FG_NET_FDM_VERSION;
529 net->longitude = Propagate->GetLocation().GetLongitude(); // geodetic (radians)
530 net->latitude = Propagate->GetLocation().GetLatitude(); // geodetic (radians)
531 net->altitude = Propagate->GetAltitudeASL()*0.3048; // altitude, above sea level (meters)
532 net->agl = (float)(Propagate->GetDistanceAGL()*0.3048); // altitude, above ground level (meters)
534 net->phi = (float)(Propagate->GetEuler(ePhi)); // roll (radians)
535 net->theta = (float)(Propagate->GetEuler(eTht)); // pitch (radians)
536 net->psi = (float)(Propagate->GetEuler(ePsi)); // yaw or true heading (radians)
538 net->alpha = (float)(Auxiliary->Getalpha()); // angle of attack (radians)
539 net->beta = (float)(Auxiliary->Getbeta()); // side slip angle (radians)
542 net->phidot = (float)(Auxiliary->GetEulerRates(ePhi)); // roll rate (radians/sec)
543 net->thetadot = (float)(Auxiliary->GetEulerRates(eTht)); // pitch rate (radians/sec)
544 net->psidot = (float)(Auxiliary->GetEulerRates(ePsi)); // yaw rate (radians/sec)
545 net->vcas = (float)(Auxiliary->GetVcalibratedFPS()); // VCAS, ft/sec
546 net->climb_rate = (float)(Propagate->Gethdot()); // altitude rate, ft/sec
547 net->v_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED frame, fps
548 net->v_east = (float)(Propagate->GetVel(eEast)); // east vel in NED frame, fps
549 net->v_down = (float)(Propagate->GetVel(eDown)); // down vel in NED frame, fps
550 //---ADD METHOD TO CALCULATE THESE TERMS---
551 net->v_wind_body_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED relative to airmass, fps
552 net->v_wind_body_east = (float)(Propagate->GetVel(eEast)); // east vel in NED relative to airmass, fps
553 net->v_wind_body_down = (float)(Propagate->GetVel(eDown)); // down vel in NED relative to airmass, fps
556 net->A_X_pilot = (float)(Auxiliary->GetPilotAccel(1)); // X body accel, ft/s/s
557 net->A_Y_pilot = (float)(Auxiliary->GetPilotAccel(2)); // Y body accel, ft/s/s
558 net->A_Z_pilot = (float)(Auxiliary->GetPilotAccel(3)); // Z body accel, ft/s/s
561 net->stall_warning = 0.0; // 0.0 - 1.0 indicating the amount of stall
562 net->slip_deg = (float)(Auxiliary->Getbeta(inDegrees)); // slip ball deflection, deg
565 net->num_engines = Propulsion->GetNumEngines(); // Number of valid engines
567 for (i=0; i<net->num_engines; i++) {
568 if (Propulsion->GetEngine(i)->GetRunning())
569 net->eng_state[i] = 2; // Engine state running
570 else if (Propulsion->GetEngine(i)->GetCranking())
571 net->eng_state[i] = 1; // Engine state cranking
573 net->eng_state[i] = 0; // Engine state off
575 switch (Propulsion->GetEngine(i)->GetType()) {
576 case (FGEngine::etRocket):
578 case (FGEngine::etPiston):
579 net->rpm[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getRPM());
580 net->fuel_flow[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getFuelFlow_gph());
581 net->fuel_px[i] = 0; // Fuel pressure, psi (N/A in current model)
582 net->egt[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->GetEGT());
583 net->cht[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getCylinderHeadTemp_degF());
584 net->mp_osi[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getManifoldPressure_inHg());
585 net->oil_temp[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilTemp_degF());
586 net->oil_px[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilPressure_psi());
587 net->tit[i] = 0; // Turbine Inlet Temperature (N/A for piston)
589 case (FGEngine::etTurbine):
591 case (FGEngine::etTurboprop):
593 case (FGEngine::etElectric):
595 case (FGEngine::etUnknown):
601 net->num_tanks = Propulsion->GetNumTanks(); // Max number of fuel tanks
603 for (i=0; i<net->num_tanks; i++) {
604 net->fuel_quantity[i] = (float)(((FGTank *)Propulsion->GetTank(i))->GetContents());
608 net->num_wheels = GroundReactions->GetNumGearUnits();
610 for (i=0; i<net->num_wheels; i++) {
611 net->wow[i] = GroundReactions->GetGearUnit(i)->GetWOW();
612 if (GroundReactions->GetGearUnit(i)->GetGearUnitDown())
613 net->gear_pos[i] = 1; //gear down, using FCS convention
615 net->gear_pos[i] = 0; //gear up, using FCS convention
616 net->gear_steer[i] = (float)(GroundReactions->GetGearUnit(i)->GetSteerNorm());
617 net->gear_compression[i] = (float)(GroundReactions->GetGearUnit(i)->GetCompLen());
621 net->cur_time = (long int)1234567890; // Friday, Feb 13, 2009, 23:31:30 UTC (not processed by FGFS anyway)
622 net->warp = 0; // offset in seconds to unix time
623 net->visibility = 25000.0; // visibility in meters (for env. effects)
625 // Control surface positions (normalized values)
626 net->elevator = (float)(FCS->GetDePos(ofNorm)); // Norm Elevator Pos, --
627 net->elevator_trim_tab = (float)(FCS->GetPitchTrimCmd()); // Norm Elev Trim Tab Pos, --
628 net->left_flap = (float)(FCS->GetDfPos(ofNorm)); // Norm Flap Pos, --
629 net->right_flap = (float)(FCS->GetDfPos(ofNorm)); // Norm Flap Pos, --
630 net->left_aileron = (float)(FCS->GetDaLPos(ofNorm)); // Norm L Aileron Pos, --
631 net->right_aileron = (float)(FCS->GetDaRPos(ofNorm)); // Norm R Aileron Pos, --
632 net->rudder = (float)(FCS->GetDrPos(ofNorm)); // Norm Rudder Pos, --
633 net->nose_wheel = (float)(FCS->GetDrPos(ofNorm)); // *** FIX *** Using Rudder Pos for NWS, --
634 net->speedbrake = (float)(FCS->GetDsbPos(ofNorm)); // Norm Speedbrake Pos, --
635 net->spoilers = (float)(FCS->GetDspPos(ofNorm)); // Norm Spoiler Pos, --
637 // Convert the net buffer to network format
638 if ( isLittleEndian ) {
639 net->version = htonl(net->version);
641 htond(net->longitude);
642 htond(net->latitude);
643 htond(net->altitude);
652 htonf(net->thetadot);
655 htonf(net->climb_rate);
659 htonf(net->v_wind_body_north);
660 htonf(net->v_wind_body_east);
661 htonf(net->v_wind_body_down);
663 htonf(net->A_X_pilot);
664 htonf(net->A_Y_pilot);
665 htonf(net->A_Z_pilot);
667 htonf(net->stall_warning);
668 htonf(net->slip_deg);
670 for (i=0; i<net->num_engines; ++i ) {
671 net->eng_state[i] = htonl(net->eng_state[i]);
673 htonf(net->fuel_flow[i]);
674 htonf(net->fuel_px[i]);
677 htonf(net->mp_osi[i]);
679 htonf(net->oil_temp[i]);
680 htonf(net->oil_px[i]);
682 net->num_engines = htonl(net->num_engines);
684 for (i=0; i<net->num_tanks; ++i ) {
685 htonf(net->fuel_quantity[i]);
687 net->num_tanks = htonl(net->num_tanks);
689 for (i=0; i<net->num_wheels; ++i ) {
690 net->wow[i] = htonl(net->wow[i]);
691 htonf(net->gear_pos[i]);
692 htonf(net->gear_steer[i]);
693 htonf(net->gear_compression[i]);
695 net->num_wheels = htonl(net->num_wheels);
697 net->cur_time = htonl( net->cur_time );
698 net->warp = htonl( net->warp );
699 htonf(net->visibility);
701 htonf(net->elevator);
702 htonf(net->elevator_trim_tab);
703 htonf(net->left_flap);
704 htonf(net->right_flap);
705 htonf(net->left_aileron);
706 htonf(net->right_aileron);
708 htonf(net->nose_wheel);
709 htonf(net->speedbrake);
710 htonf(net->spoilers);
714 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
716 void FGOutput::FlightGearSocketOutput(void)
718 int length = sizeof(fgSockBuf);
720 if (socket == NULL) return;
721 if (!socket->GetConnectStatus()) return;
723 SocketDataFill(&fgSockBuf);
724 socket->Send((char *)&fgSockBuf, length);
727 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
729 void FGOutput::SocketOutput(void)
731 const FGAerodynamics* Aerodynamics = FDMExec->GetAerodynamics();
732 const FGAuxiliary* Auxiliary = FDMExec->GetAuxiliary();
733 const FGPropulsion* Propulsion = FDMExec->GetPropulsion();
734 const FGMassBalance* MassBalance = FDMExec->GetMassBalance();
735 const FGPropagate* Propagate = FDMExec->GetPropagate();
736 const FGFCS* FCS = FDMExec->GetFCS();
737 const FGAtmosphere* Atmosphere = FDMExec->GetAtmosphere();
738 const FGAircraft* Aircraft = FDMExec->GetAircraft();
739 const FGGroundReactions* GroundReactions = FDMExec->GetGroundReactions();
741 string asciiData, scratch;
743 if (socket == NULL) return;
744 if (!socket->GetConnectStatus()) return;
748 socket->Clear("<LABELS>");
749 socket->Append("Time");
751 if (SubSystems & ssAerosurfaces) {
752 socket->Append("Aileron Command");
753 socket->Append("Elevator Command");
754 socket->Append("Rudder Command");
755 socket->Append("Flap Command");
756 socket->Append("Left Aileron Position");
757 socket->Append("Right Aileron Position");
758 socket->Append("Elevator Position");
759 socket->Append("Rudder Position");
760 socket->Append("Flap Position");
763 if (SubSystems & ssRates) {
767 socket->Append("PDot");
768 socket->Append("QDot");
769 socket->Append("RDot");
772 if (SubSystems & ssVelocities) {
773 socket->Append("QBar");
774 socket->Append("Vtotal");
775 socket->Append("UBody");
776 socket->Append("VBody");
777 socket->Append("WBody");
778 socket->Append("UAero");
779 socket->Append("VAero");
780 socket->Append("WAero");
781 socket->Append("Vn");
782 socket->Append("Ve");
783 socket->Append("Vd");
785 if (SubSystems & ssForces) {
786 socket->Append("F_Drag");
787 socket->Append("F_Side");
788 socket->Append("F_Lift");
789 socket->Append("LoD");
790 socket->Append("Fx");
791 socket->Append("Fy");
792 socket->Append("Fz");
794 if (SubSystems & ssMoments) {
799 if (SubSystems & ssAtmosphere) {
800 socket->Append("Rho");
801 socket->Append("SL pressure");
802 socket->Append("Ambient pressure");
803 socket->Append("Turbulence Magnitude");
804 socket->Append("Turbulence Direction X");
805 socket->Append("Turbulence Direction Y");
806 socket->Append("Turbulence Direction Z");
807 socket->Append("NWind");
808 socket->Append("EWind");
809 socket->Append("DWind");
811 if (SubSystems & ssMassProps) {
812 socket->Append("Ixx");
813 socket->Append("Ixy");
814 socket->Append("Ixz");
815 socket->Append("Iyx");
816 socket->Append("Iyy");
817 socket->Append("Iyz");
818 socket->Append("Izx");
819 socket->Append("Izy");
820 socket->Append("Izz");
821 socket->Append("Mass");
822 socket->Append("Xcg");
823 socket->Append("Ycg");
824 socket->Append("Zcg");
826 if (SubSystems & ssPropagate) {
827 socket->Append("Altitude");
828 socket->Append("Phi (deg)");
829 socket->Append("Tht (deg)");
830 socket->Append("Psi (deg)");
831 socket->Append("Alpha (deg)");
832 socket->Append("Beta (deg)");
833 socket->Append("Latitude (deg)");
834 socket->Append("Longitude (deg)");
836 if (SubSystems & ssAeroFunctions) {
837 scratch = Aerodynamics->GetAeroFunctionStrings(",");
838 if (scratch.length() != 0) socket->Append(scratch);
840 if (SubSystems & ssFCS) {
841 scratch = FCS->GetComponentStrings(",");
842 if (scratch.length() != 0) socket->Append(scratch);
844 if (SubSystems & ssGroundReactions) {
845 socket->Append(GroundReactions->GetGroundReactionStrings(","));
847 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
848 socket->Append(Propulsion->GetPropulsionStrings(","));
850 if (OutputProperties.size() > 0) {
851 for (unsigned int i=0;i<OutputProperties.size();i++) {
852 socket->Append(OutputProperties[i]->GetPrintableName());
861 socket->Append(FDMExec->GetSimTime());
863 if (SubSystems & ssAerosurfaces) {
864 socket->Append(FCS->GetDaCmd());
865 socket->Append(FCS->GetDeCmd());
866 socket->Append(FCS->GetDrCmd());
867 socket->Append(FCS->GetDfCmd());
868 socket->Append(FCS->GetDaLPos());
869 socket->Append(FCS->GetDaRPos());
870 socket->Append(FCS->GetDePos());
871 socket->Append(FCS->GetDrPos());
872 socket->Append(FCS->GetDfPos());
874 if (SubSystems & ssRates) {
875 socket->Append(radtodeg*Propagate->GetPQR(eP));
876 socket->Append(radtodeg*Propagate->GetPQR(eQ));
877 socket->Append(radtodeg*Propagate->GetPQR(eR));
878 socket->Append(radtodeg*Propagate->GetPQRdot(eP));
879 socket->Append(radtodeg*Propagate->GetPQRdot(eQ));
880 socket->Append(radtodeg*Propagate->GetPQRdot(eR));
882 if (SubSystems & ssVelocities) {
883 socket->Append(Auxiliary->Getqbar());
884 socket->Append(Auxiliary->GetVt());
885 socket->Append(Propagate->GetUVW(eU));
886 socket->Append(Propagate->GetUVW(eV));
887 socket->Append(Propagate->GetUVW(eW));
888 socket->Append(Auxiliary->GetAeroUVW(eU));
889 socket->Append(Auxiliary->GetAeroUVW(eV));
890 socket->Append(Auxiliary->GetAeroUVW(eW));
891 socket->Append(Propagate->GetVel(eNorth));
892 socket->Append(Propagate->GetVel(eEast));
893 socket->Append(Propagate->GetVel(eDown));
895 if (SubSystems & ssForces) {
896 socket->Append(Aerodynamics->GetvFw()(eDrag));
897 socket->Append(Aerodynamics->GetvFw()(eSide));
898 socket->Append(Aerodynamics->GetvFw()(eLift));
899 socket->Append(Aerodynamics->GetLoD());
900 socket->Append(Aircraft->GetForces(eX));
901 socket->Append(Aircraft->GetForces(eY));
902 socket->Append(Aircraft->GetForces(eZ));
904 if (SubSystems & ssMoments) {
905 socket->Append(Aircraft->GetMoments(eL));
906 socket->Append(Aircraft->GetMoments(eM));
907 socket->Append(Aircraft->GetMoments(eN));
909 if (SubSystems & ssAtmosphere) {
910 socket->Append(Atmosphere->GetDensity());
911 socket->Append(Atmosphere->GetPressureSL());
912 socket->Append(Atmosphere->GetPressure());
913 socket->Append(Atmosphere->GetTurbMagnitude());
914 socket->Append(Atmosphere->GetTurbDirection().Dump(","));
915 socket->Append(Atmosphere->GetTotalWindNED().Dump(","));
917 if (SubSystems & ssMassProps) {
918 socket->Append(MassBalance->GetJ()(1,1));
919 socket->Append(MassBalance->GetJ()(1,2));
920 socket->Append(MassBalance->GetJ()(1,3));
921 socket->Append(MassBalance->GetJ()(2,1));
922 socket->Append(MassBalance->GetJ()(2,2));
923 socket->Append(MassBalance->GetJ()(2,3));
924 socket->Append(MassBalance->GetJ()(3,1));
925 socket->Append(MassBalance->GetJ()(3,2));
926 socket->Append(MassBalance->GetJ()(3,3));
927 socket->Append(MassBalance->GetMass());
928 socket->Append(MassBalance->GetXYZcg()(eX));
929 socket->Append(MassBalance->GetXYZcg()(eY));
930 socket->Append(MassBalance->GetXYZcg()(eZ));
932 if (SubSystems & ssPropagate) {
933 socket->Append(Propagate->GetAltitudeASL());
934 socket->Append(radtodeg*Propagate->GetEuler(ePhi));
935 socket->Append(radtodeg*Propagate->GetEuler(eTht));
936 socket->Append(radtodeg*Propagate->GetEuler(ePsi));
937 socket->Append(Auxiliary->Getalpha(inDegrees));
938 socket->Append(Auxiliary->Getbeta(inDegrees));
939 socket->Append(Propagate->GetLocation().GetLatitudeDeg());
940 socket->Append(Propagate->GetLocation().GetLongitudeDeg());
942 if (SubSystems & ssAeroFunctions) {
943 scratch = Aerodynamics->GetAeroFunctionValues(",");
944 if (scratch.length() != 0) socket->Append(scratch);
946 if (SubSystems & ssFCS) {
947 scratch = FCS->GetComponentValues(",");
948 if (scratch.length() != 0) socket->Append(scratch);
950 if (SubSystems & ssGroundReactions) {
951 socket->Append(GroundReactions->GetGroundReactionValues(","));
953 if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
954 socket->Append(Propulsion->GetPropulsionValues(","));
957 for (unsigned int i=0;i<OutputProperties.size();i++) {
958 socket->Append(OutputProperties[i]->getDoubleValue());
964 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
966 void FGOutput::SocketStatusOutput(const string& out_str)
970 if (socket == NULL) return;
973 asciiData = string("<STATUS>") + out_str;
974 socket->Append(asciiData.c_str());
978 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
980 bool FGOutput::Load(Element* element)
984 double OutRate = 0.0;
986 Element *property_element;
988 string separator = "/";
990 if (!DirectivesFile.empty()) { // A directives filename from the command line overrides
991 output_file_name = DirectivesFile; // one found in the config file.
992 document = LoadXMLDocument(output_file_name);
993 } else if (!element->GetAttributeValue("file").empty()) {
994 output_file_name = FDMExec->GetRootDir() + element->GetAttributeValue("file");
995 document = LoadXMLDocument(output_file_name);
1000 if (!document) return false;
1002 name = FDMExec->GetRootDir() + document->GetAttributeValue("name");
1003 SetType(document->GetAttributeValue("type"));
1004 Port = document->GetAttributeValue("port");
1005 if (!Port.empty() && (Type == otSocket || Type == otFlightGear)) {
1006 port = atoi(Port.c_str());
1007 SetProtocol(document->GetAttributeValue("protocol"));
1008 socket = new FGfdmSocket(name, port, Protocol);
1010 BaseFilename = Filename = name;
1012 if (!document->GetAttributeValue("rate").empty()) {
1013 OutRate = document->GetAttributeValueAsNumber("rate");
1018 if (document->FindElementValue("simulation") == string("ON"))
1019 SubSystems += ssSimulation;
1020 if (document->FindElementValue("aerosurfaces") == string("ON"))
1021 SubSystems += ssAerosurfaces;
1022 if (document->FindElementValue("rates") == string("ON"))
1023 SubSystems += ssRates;
1024 if (document->FindElementValue("velocities") == string("ON"))
1025 SubSystems += ssVelocities;
1026 if (document->FindElementValue("forces") == string("ON"))
1027 SubSystems += ssForces;
1028 if (document->FindElementValue("moments") == string("ON"))
1029 SubSystems += ssMoments;
1030 if (document->FindElementValue("atmosphere") == string("ON"))
1031 SubSystems += ssAtmosphere;
1032 if (document->FindElementValue("massprops") == string("ON"))
1033 SubSystems += ssMassProps;
1034 if (document->FindElementValue("position") == string("ON"))
1035 SubSystems += ssPropagate;
1036 if (document->FindElementValue("coefficients") == string("ON"))
1037 SubSystems += ssAeroFunctions;
1038 if (document->FindElementValue("ground_reactions") == string("ON"))
1039 SubSystems += ssGroundReactions;
1040 if (document->FindElementValue("fcs") == string("ON"))
1041 SubSystems += ssFCS;
1042 if (document->FindElementValue("propulsion") == string("ON"))
1043 SubSystems += ssPropulsion;
1044 property_element = document->FindElement("property");
1045 while (property_element) {
1046 string property_str = property_element->GetDataLine();
1047 FGPropertyManager* node = PropertyManager->GetNode(property_str);
1049 cerr << fgred << highint << endl << " No property by the name "
1050 << property_str << " has been defined. This property will " << endl
1051 << " not be logged. You should check your configuration file."
1054 OutputProperties.push_back(node);
1056 property_element = document->FindNextElement("property");
1066 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1068 void FGOutput::SetRate(double rtHz)
1070 rtHz = rtHz>1000?1000:(rtHz<0?0:rtHz);
1072 rate = (int)(0.5 + 1.0/(FDMExec->GetDeltaT()*rtHz));
1080 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1081 // The bitmasked value choices are as follows:
1082 // unset: In this case (the default) JSBSim would only print
1083 // out the normally expected messages, essentially echoing
1084 // the config files as they are read. If the environment
1085 // variable is not set, debug_lvl is set to 1 internally
1086 // 0: This requests JSBSim not to output any messages
1088 // 1: This value explicity requests the normal JSBSim
1090 // 2: This value asks for a message to be printed out when
1091 // a class is instantiated
1092 // 4: When this value is set, a message is displayed when a
1093 // FGModel object executes its Run() method
1094 // 8: When this value is set, various runtime state variables
1095 // are printed out periodically
1096 // 16: When set various parameters are sanity checked and
1097 // a message is printed out when they go out of bounds
1099 void FGOutput::Debug(int from)
1103 if (debug_lvl <= 0) return;
1105 if (debug_lvl & 1) { // Standard console startup message output
1106 if (from == 0) { // Constructor
1110 if (output_file_name.empty())
1111 cout << " " << "Output parameters read inline" << endl;
1113 cout << " Output parameters read from file: " << output_file_name << endl;
1115 if (Filename == "cout" || Filename == "COUT") {
1116 scratch = " Log output goes to screen console";
1117 } else if (!Filename.empty()) {
1118 scratch = " Log output goes to file: " + Filename;
1122 cout << scratch << " in CSV format output at rate " << 1/(FDMExec->GetDeltaT()*rate) << " Hz" << endl;
1126 cout << " No log output" << endl;
1130 if (SubSystems & ssSimulation) cout << " Simulation parameters logged" << endl;
1131 if (SubSystems & ssAerosurfaces) cout << " Aerosurface parameters logged" << endl;
1132 if (SubSystems & ssRates) cout << " Rate parameters logged" << endl;
1133 if (SubSystems & ssVelocities) cout << " Velocity parameters logged" << endl;
1134 if (SubSystems & ssForces) cout << " Force parameters logged" << endl;
1135 if (SubSystems & ssMoments) cout << " Moments parameters logged" << endl;
1136 if (SubSystems & ssAtmosphere) cout << " Atmosphere parameters logged" << endl;
1137 if (SubSystems & ssMassProps) cout << " Mass parameters logged" << endl;
1138 if (SubSystems & ssAeroFunctions) cout << " Coefficient parameters logged" << endl;
1139 if (SubSystems & ssPropagate) cout << " Propagate parameters logged" << endl;
1140 if (SubSystems & ssGroundReactions) cout << " Ground parameters logged" << endl;
1141 if (SubSystems & ssFCS) cout << " FCS parameters logged" << endl;
1142 if (SubSystems & ssPropulsion) cout << " Propulsion parameters logged" << endl;
1143 if (OutputProperties.size() > 0) cout << " Properties logged:" << endl;
1144 for (unsigned int i=0;i<OutputProperties.size();i++) {
1145 cout << " - " << OutputProperties[i]->GetName() << endl;
1149 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
1150 if (from == 0) cout << "Instantiated: FGOutput" << endl;
1151 if (from == 1) cout << "Destroyed: FGOutput" << endl;
1153 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
1155 if (debug_lvl & 8 ) { // Runtime state variables
1157 if (debug_lvl & 16) { // Sanity checking
1159 if (debug_lvl & 64) {
1160 if (from == 0) { // Constructor
1161 cout << IdSrc << endl;
1162 cout << IdHdr << endl;