LCOV - code coverage report
Current view: top level - models - FGOutput.cpp (source / functions) Hit Total Coverage
Test: JSBSim-Coverage-Statistics Lines: 295 724 40.7 %
Date: 2010-08-24 Functions: 12 20 60.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 120 418 28.7 %

           Branch data     Line data    Source code
       1                 :            : /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       2                 :            : 
       3                 :            :  Module:       FGOutput.cpp
       4                 :            :  Author:       Jon Berndt
       5                 :            :  Date started: 12/02/98
       6                 :            :  Purpose:      Manage output of sim parameters to file or stdout
       7                 :            :  Called by:    FGSimExec
       8                 :            : 
       9                 :            :  ------------- Copyright (C) 1999  Jon S. Berndt (jon@jsbsim.org) -------------
      10                 :            : 
      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
      14                 :            :  version.
      15                 :            : 
      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
      19                 :            :  details.
      20                 :            : 
      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.
      24                 :            : 
      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.
      27                 :            : 
      28                 :            : FUNCTIONAL DESCRIPTION
      29                 :            : --------------------------------------------------------------------------------
      30                 :            : This is the place where you create output routines to dump data for perusal
      31                 :            : later.
      32                 :            : 
      33                 :            : HISTORY
      34                 :            : --------------------------------------------------------------------------------
      35                 :            : 12/02/98   JSB   Created
      36                 :            : 11/09/07   HDW   Added FlightGear Socket Interface
      37                 :            : 
      38                 :            : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      39                 :            : INCLUDES
      40                 :            : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
      41                 :            : 
      42                 :            : #include "FGOutput.h"
      43                 :            : #include "FGFDMExec.h"
      44                 :            : #include "FGAtmosphere.h"
      45                 :            : #include "FGFCS.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"
      59                 :            : #include <sstream>
      60                 :            : #include <iomanip>
      61                 :            : #include <cstring>
      62                 :            : #include <cstdlib>
      63                 :            : 
      64                 :            : #include "input_output/net_fdm.hxx"
      65                 :            : #include "input_output/FGfdmSocket.h"
      66                 :            : 
      67                 :            : #if defined(WIN32) && !defined(__CYGWIN__)
      68                 :            : #  include <windows.h>
      69                 :            : #else
      70                 :            : #  include <netinet/in.h>       // htonl() ntohl()
      71                 :            : #endif
      72                 :            : 
      73                 :            : static const int endianTest = 1;
      74                 :            : #define isLittleEndian (*((char *) &endianTest ) != 0)
      75                 :            : 
      76                 :            : using namespace std;
      77                 :            : 
      78                 :            : namespace JSBSim {
      79                 :            : 
      80                 :            : static const char *IdSrc = "$Id: FGOutput.cpp,v 1.48 2010/04/12 12:25:19 jberndt Exp $";
      81                 :            : static const char *IdHdr = ID_OUTPUT;
      82                 :            : 
      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
      92                 :            : // possible
      93                 :          0 : static void htond (double &x)
      94                 :            : {
      95         [ #  # ]:          0 :     if ( isLittleEndian ) {
      96                 :            :         int    *Double_Overlay;
      97                 :            :         int     Holding_Buffer;
      98                 :            : 
      99                 :          0 :         Double_Overlay = (int *) &x;
     100                 :          0 :         Holding_Buffer = Double_Overlay [0];
     101                 :            : 
     102         [ #  # ]:          0 :         Double_Overlay [0] = htonl (Double_Overlay [1]);
     103         [ #  # ]:          0 :         Double_Overlay [1] = htonl (Holding_Buffer);
     104                 :            :     } else {
     105                 :          0 :         return;
     106                 :            :     }
     107                 :            : }
     108                 :            : 
     109                 :            : // Float version
     110                 :          0 : static void htonf (float &x)
     111                 :            : {
     112         [ #  # ]:          0 :     if ( isLittleEndian ) {
     113                 :            :         int    *Float_Overlay;
     114                 :            :         int     Holding_Buffer;
     115                 :            : 
     116                 :          0 :         Float_Overlay = (int *) &x;
     117                 :          0 :         Holding_Buffer = Float_Overlay [0];
     118                 :            : 
     119         [ #  # ]:          0 :         Float_Overlay [0] = htonl (Holding_Buffer);
     120                 :            :     } else {
     121                 :          0 :         return;
     122                 :            :     }
     123                 :            : }
     124                 :            : 
     125                 :            : 
     126                 :            : /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     127                 :            : CLASS IMPLEMENTATION
     128                 :            : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
     129                 :            : 
     130                 :          2 : FGOutput::FGOutput(FGFDMExec* fdmex) : FGModel(fdmex)
     131                 :            : {
     132                 :          1 :   Name = "FGOutput";
     133                 :          1 :   sFirstPass = dFirstPass = true;
     134                 :          1 :   socket = 0;
     135                 :          1 :   flightGearSocket = 0;
     136                 :          1 :   runID_postfix = 0;
     137                 :          1 :   Type = otNone;
     138                 :          1 :   SubSystems = 0;
     139                 :          1 :   enabled = true;
     140                 :          1 :   StartNewFile = false;
     141                 :          1 :   delimeter = ", ";
     142                 :          2 :   BaseFilename = Filename = "";
     143                 :          1 :   DirectivesFile = "";
     144                 :          1 :   output_file_name = "";
     145                 :            : 
     146                 :          1 :   memset(&fgSockBuf, 0x00, sizeof(fgSockBuf));
     147                 :            : 
     148                 :          1 :   Debug(0);
     149                 :          1 : }
     150                 :            : 
     151                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     152                 :            : 
     153                 :          1 : FGOutput::~FGOutput()
     154                 :            : {
     155 [ -  + ][ #  # ]:          1 :   delete socket;
     156 [ -  + ][ #  # ]:          1 :   delete flightGearSocket;
     157                 :          1 :   OutputProperties.clear();
     158                 :          1 :   Debug(1);
     159                 :          2 : }
     160                 :            : 
     161                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     162                 :            : 
     163                 :          1 : bool FGOutput::InitModel(void)
     164                 :            : {
     165         [ -  + ]:          1 :   if (!FGModel::InitModel()) return false;
     166                 :            : 
     167 [ -  + ][ #  # ]:          1 :   if (Filename.size() > 0 && StartNewFile) {
                 [ -  + ]
     168                 :          0 :     ostringstream buf;
     169                 :          0 :     string::size_type dot = BaseFilename.find_last_of('.');
     170         [ #  # ]:          0 :     if (dot != string::npos) {
     171                 :          0 :       buf << BaseFilename.substr(0, dot) << '_' << runID_postfix++ << BaseFilename.substr(dot);
     172                 :            :     } else {
     173                 :          0 :       buf << BaseFilename << '_' << runID_postfix++;
     174                 :            :     }
     175                 :          0 :     Filename = buf.str();
     176                 :          0 :     datafile.close();
     177                 :          0 :     StartNewFile = false;
     178                 :          0 :     dFirstPass = true;
     179                 :            :   }
     180                 :            : 
     181                 :          1 :   return true;
     182                 :            : }
     183                 :            : 
     184                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     185                 :            : 
     186                 :      54005 : bool FGOutput::Run(void)
     187                 :            : {
     188         [ +  + ]:      54005 :   if (FGModel::Run()) return true;
     189                 :            : 
     190 [ +  - ][ +  + ]:       4910 :   if (enabled && !FDMExec->IntegrationSuspended()&& !FDMExec->Holding()) {
         [ +  - ][ +  + ]
     191                 :       4909 :     RunPreFunctions();
     192         [ -  + ]:       4909 :     if (Type == otSocket) {
     193                 :          0 :       SocketOutput();
     194         [ -  + ]:       4909 :     } else if (Type == otFlightGear) {
     195                 :          0 :       FlightGearSocketOutput();
     196         [ +  - ]:       4909 :     } else if (Type == otCSV || Type == otTab) {
     197                 :       4909 :       DelimitedOutput(Filename);
     198         [ #  # ]:          0 :     } else if (Type == otTerminal) {
     199                 :            :       // Not done yet
     200                 :          0 :     } else if (Type == otNone) {
     201                 :            :       // Do nothing
     202                 :            :     } else {
     203                 :            :       // Not a valid type of output
     204                 :            :     }
     205                 :       4909 :     RunPostFunctions();
     206                 :            :   }
     207                 :      54005 :   return false;
     208                 :            : }
     209                 :            : 
     210                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     211                 :            : 
     212                 :          1 : void FGOutput::SetType(const string& type)
     213                 :            : {
     214         [ +  - ]:          1 :   if (type == "CSV") {
     215                 :          1 :     Type = otCSV;
     216                 :          1 :     delimeter = ", ";
     217         [ #  # ]:          0 :   } else if (type == "TABULAR") {
     218                 :          0 :     Type = otTab;
     219                 :          0 :     delimeter = "\t";
     220         [ #  # ]:          0 :   } else if (type == "SOCKET") {
     221                 :          0 :     Type = otSocket;
     222         [ #  # ]:          0 :   } else if (type == "FLIGHTGEAR") {
     223                 :          0 :     Type = otFlightGear;
     224         [ #  # ]:          0 :   } else if (type == "TERMINAL") {
     225                 :          0 :     Type = otTerminal;
     226         [ #  # ]:          0 :   } else if (type != string("NONE")) {
     227                 :          0 :     Type = otUnknown;
     228                 :          0 :     cerr << "Unknown type of output specified in config file" << endl;
     229                 :            :   }
     230                 :          1 : }
     231                 :            : 
     232                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     233                 :            : 
     234                 :       4909 : void FGOutput::DelimitedOutput(const string& fname)
     235                 :            : {
     236                 :            :   streambuf* buffer;
     237                 :       4909 :   string scratch = "";
     238                 :            : 
     239   [ +  -  -  + ]:       9818 :   if (fname == "COUT" || fname == "cout") {
                 [ -  + ]
     240                 :          0 :     buffer = cout.rdbuf();
     241                 :            :   } else {
     242         [ +  + ]:       4909 :     if (!datafile.is_open()) datafile.open(fname.c_str());
     243                 :       4909 :     buffer = datafile.rdbuf();
     244                 :            :   }
     245                 :            : 
     246                 :       4909 :   ostream outstream(buffer);
     247                 :            : 
     248                 :            :   outstream.precision(10);
     249                 :            : 
     250         [ +  + ]:       4909 :   if (dFirstPass) {
     251                 :          1 :     outstream << "Time";
     252                 :          1 :     if (SubSystems & ssSimulation) {
     253                 :            :       // Nothing here, yet
     254                 :            :     }
     255         [ -  + ]:          1 :     if (SubSystems & ssAerosurfaces) {
     256                 :          0 :       outstream << delimeter;
     257                 :          0 :       outstream << "Aileron Command (norm)" + delimeter;
     258                 :          0 :       outstream << "Elevator Command (norm)" + delimeter;
     259                 :          0 :       outstream << "Rudder Command (norm)" + delimeter;
     260                 :          0 :       outstream << "Flap Command (norm)" + delimeter;
     261                 :          0 :       outstream << "Left Aileron Position (deg)" + delimeter;
     262                 :          0 :       outstream << "Right Aileron Position (deg)" + delimeter;
     263                 :          0 :       outstream << "Elevator Position (deg)" + delimeter;
     264                 :          0 :       outstream << "Rudder Position (deg)" + delimeter;
     265                 :          0 :       outstream << "Flap Position (deg)";
     266                 :            :     }
     267         [ +  - ]:          1 :     if (SubSystems & ssRates) {
     268                 :          1 :       outstream << delimeter;
     269                 :          1 :       outstream << "P (deg/s)" + delimeter + "Q (deg/s)" + delimeter + "R (deg/s)" + delimeter;
     270                 :          1 :       outstream << "P dot (deg/s^2)" + delimeter + "Q dot (deg/s^2)" + delimeter + "R dot (deg/s^2)" + delimeter;
     271                 :          1 :       outstream << "P_{inertial} (deg/s)" + delimeter + "Q_{inertial} (deg/s)" + delimeter + "R_{inertial} (deg/s)";
     272                 :            :     }
     273         [ +  - ]:          1 :     if (SubSystems & ssVelocities) {
     274                 :          1 :       outstream << delimeter;
     275                 :          1 :       outstream << "q bar (psf)" + delimeter;
     276                 :          1 :       outstream << "Reynolds Number" + delimeter;
     277                 :          1 :       outstream << "V_{Total} (ft/s)" + delimeter;
     278                 :          1 :       outstream << "V_{Inertial} (ft/s)" + delimeter;
     279                 :          1 :       outstream << "UBody" + delimeter + "VBody" + delimeter + "WBody" + delimeter;
     280                 :          1 :       outstream << "Aero V_{X Body} (ft/s)" + delimeter + "Aero V_{Y Body} (ft/s)" + delimeter + "Aero V_{Z Body} (ft/s)" + delimeter;
     281                 :          1 :       outstream << "V_{X_{inertial}} (ft/s)" + delimeter + "V_{Y_{inertial}} (ft/s)" + delimeter + "V_{Z_{inertial}} (ft/s)" + delimeter;
     282                 :          1 :       outstream << "V_{North} (ft/s)" + delimeter + "V_{East} (ft/s)" + delimeter + "V_{Down} (ft/s)";
     283                 :            :     }
     284         [ +  - ]:          1 :     if (SubSystems & ssForces) {
     285                 :          1 :       outstream << delimeter;
     286                 :          1 :       outstream << "F_{Drag} (lbs)" + delimeter + "F_{Side} (lbs)" + delimeter + "F_{Lift} (lbs)" + delimeter;
     287                 :          1 :       outstream << "L/D" + delimeter;
     288                 :          1 :       outstream << "F_{Aero x} (lbs)" + delimeter + "F_{Aero y} (lbs)" + delimeter + "F_{Aero z} (lbs)" + delimeter;
     289                 :          1 :       outstream << "F_{Prop x} (lbs)" + delimeter + "F_{Prop y} (lbs)" + delimeter + "F_{Prop z} (lbs)" + delimeter;
     290                 :          1 :       outstream << "F_{Gear x} (lbs)" + delimeter + "F_{Gear y} (lbs)" + delimeter + "F_{Gear z} (lbs)" + delimeter;
     291                 :          1 :       outstream << "F_{Ext x} (lbs)" + delimeter + "F_{Ext y} (lbs)" + delimeter + "F_{Ext z} (lbs)" + delimeter;
     292                 :          1 :       outstream << "F_{Buoyant x} (lbs)" + delimeter + "F_{Buoyant y} (lbs)" + delimeter + "F_{Buoyant z} (lbs)" + delimeter;
     293                 :          1 :       outstream << "F_{Total x} (lbs)" + delimeter + "F_{Total y} (lbs)" + delimeter + "F_{Total z} (lbs)";
     294                 :            :     }
     295         [ +  - ]:          1 :     if (SubSystems & ssMoments) {
     296                 :          1 :       outstream << delimeter;
     297                 :          1 :       outstream << "L_{Aero} (ft-lbs)" + delimeter + "M_{Aero} ( ft-lbs)" + delimeter + "N_{Aero} (ft-lbs)" + delimeter;
     298                 :          1 :       outstream << "L_{Prop} (ft-lbs)" + delimeter + "M_{Prop} (ft-lbs)" + delimeter + "N_{Prop} (ft-lbs)" + delimeter;
     299                 :          1 :       outstream << "L_{Gear} (ft-lbs)" + delimeter + "M_{Gear} (ft-lbs)" + delimeter + "N_{Gear} (ft-lbs)" + delimeter;
     300                 :          1 :       outstream << "L_{ext} (ft-lbs)" + delimeter + "M_{ext} (ft-lbs)" + delimeter + "N_{ext} (ft-lbs)" + delimeter;
     301                 :          1 :       outstream << "L_{Buoyant} (ft-lbs)" + delimeter + "M_{Buoyant} (ft-lbs)" + delimeter + "N_{Buoyant} (ft-lbs)" + delimeter;
     302                 :          1 :       outstream << "L_{Total} (ft-lbs)" + delimeter + "M_{Total} (ft-lbs)" + delimeter + "N_{Total} (ft-lbs)";
     303                 :            :     }
     304         [ +  - ]:          1 :     if (SubSystems & ssAtmosphere) {
     305                 :          1 :       outstream << delimeter;
     306                 :          1 :       outstream << "Rho (slugs/ft^3)" + delimeter;
     307                 :          1 :       outstream << "Absolute Viscosity" + delimeter;
     308                 :          1 :       outstream << "Kinematic Viscosity" + delimeter;
     309                 :          1 :       outstream << "Temperature (R)" + delimeter;
     310                 :          1 :       outstream << "P_{SL} (psf)" + delimeter;
     311                 :          1 :       outstream << "P_{Ambient} (psf)" + delimeter;
     312                 :          1 :       outstream << "Turbulence Magnitude (ft/sec)" + delimeter;
     313                 :          1 :       outstream << "Turbulence X Direction (rad)" + delimeter + "Turbulence Y Direction (rad)" + delimeter + "Turbulence Z Direction (rad)" + delimeter;
     314                 :          1 :       outstream << "Wind V_{North} (ft/s)" + delimeter + "Wind V_{East} (ft/s)" + delimeter + "Wind V_{Down} (ft/s)";
     315                 :            :     }
     316         [ +  - ]:          1 :     if (SubSystems & ssMassProps) {
     317                 :          1 :       outstream << delimeter;
     318                 :          1 :       outstream << "I_{xx}" + delimeter;
     319                 :          1 :       outstream << "I_{xy}" + delimeter;
     320                 :          1 :       outstream << "I_{xz}" + delimeter;
     321                 :          1 :       outstream << "I_{yx}" + delimeter;
     322                 :          1 :       outstream << "I_{yy}" + delimeter;
     323                 :          1 :       outstream << "I_{yz}" + delimeter;
     324                 :          1 :       outstream << "I_{zx}" + delimeter;
     325                 :          1 :       outstream << "I_{zy}" + delimeter;
     326                 :          1 :       outstream << "I_{zz}" + delimeter;
     327                 :          1 :       outstream << "Mass" + delimeter;
     328                 :          1 :       outstream << "X_{cg}" + delimeter + "Y_{cg}" + delimeter + "Z_{cg}";
     329                 :            :     }
     330         [ +  - ]:          1 :     if (SubSystems & ssPropagate) {
     331                 :          1 :       outstream << delimeter;
     332                 :          1 :       outstream << "Altitude ASL (ft)" + delimeter;
     333                 :          1 :       outstream << "Altitude AGL (ft)" + delimeter;
     334                 :          1 :       outstream << "Phi (deg)" + delimeter + "Theta (deg)" + delimeter + "Psi (deg)" + delimeter;
     335                 :          1 :       outstream << "Alpha (deg)" + delimeter;
     336                 :          1 :       outstream << "Beta (deg)" + delimeter;
     337                 :          1 :       outstream << "Latitude (deg)" + delimeter;
     338                 :          1 :       outstream << "Longitude (deg)" + delimeter;
     339                 :          1 :       outstream << "X_{ECI} (ft)" + delimeter + "Y_{ECI} (ft)" + delimeter + "Z_{ECI} (ft)" + delimeter;
     340                 :          1 :       outstream << "X_{ECEF} (ft)" + delimeter + "Y_{ECEF} (ft)" + delimeter + "Z_{ECEF} (ft)" + delimeter;
     341                 :          1 :       outstream << "Earth Position Angle (deg)" + delimeter;
     342                 :          1 :       outstream << "Distance AGL (ft)" + delimeter;
     343                 :          1 :       outstream << "Terrain Elevation (ft)";
     344                 :            :     }
     345         [ -  + ]:          1 :     if (SubSystems & ssCoefficients) {
     346                 :          0 :       scratch = Aerodynamics->GetCoefficientStrings(delimeter);
     347         [ #  # ]:          0 :       if (scratch.length() != 0) outstream << delimeter << scratch;
     348                 :            :     }
     349         [ +  - ]:          1 :     if (SubSystems & ssFCS) {
     350                 :          2 :       scratch = FCS->GetComponentStrings(delimeter);
     351         [ +  - ]:          1 :       if (scratch.length() != 0) outstream << delimeter << scratch;
     352                 :            :     }
     353         [ -  + ]:          1 :     if (SubSystems & ssGroundReactions) {
     354                 :          0 :       outstream << delimeter;
     355                 :          0 :       outstream << GroundReactions->GetGroundReactionStrings(delimeter);
     356                 :            :     }
     357 [ +  - ][ +  - ]:          1 :     if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
                 [ +  - ]
     358                 :          1 :       outstream << delimeter;
     359                 :          1 :       outstream << Propulsion->GetPropulsionStrings(delimeter);
     360                 :            :     }
     361         [ -  + ]:          1 :     if (OutputProperties.size() > 0) {
     362         [ #  # ]:          0 :       for (unsigned int i=0;i<OutputProperties.size();i++) {
     363                 :          0 :         outstream << delimeter << OutputProperties[i]->GetPrintableName();
     364                 :            :       }
     365                 :            :     }
     366                 :            : 
     367                 :            :     outstream << endl;
     368                 :          1 :     dFirstPass = false;
     369                 :            :   }
     370                 :            : 
     371                 :       4909 :   outstream << FDMExec->GetSimTime();
     372                 :       4909 :   if (SubSystems & ssSimulation) {
     373                 :            :   }
     374         [ -  + ]:       4909 :   if (SubSystems & ssAerosurfaces) {
     375                 :          0 :     outstream << delimeter;
     376                 :          0 :     outstream << FCS->GetDaCmd() << delimeter;
     377                 :          0 :     outstream << FCS->GetDeCmd() << delimeter;
     378                 :          0 :     outstream << FCS->GetDrCmd() << delimeter;
     379                 :          0 :     outstream << FCS->GetDfCmd() << delimeter;
     380                 :          0 :     outstream << FCS->GetDaLPos(ofDeg) << delimeter;
     381                 :          0 :     outstream << FCS->GetDaRPos(ofDeg) << delimeter;
     382                 :          0 :     outstream << FCS->GetDePos(ofDeg) << delimeter;
     383                 :          0 :     outstream << FCS->GetDrPos(ofDeg) << delimeter;
     384                 :          0 :     outstream << FCS->GetDfPos(ofDeg);
     385                 :            :   }
     386         [ +  - ]:       4909 :   if (SubSystems & ssRates) {
     387                 :       4909 :     outstream << delimeter;
     388                 :       4909 :     outstream << (radtodeg*Propagate->GetPQR()).Dump(delimeter) << delimeter;
     389                 :       4909 :     outstream << (radtodeg*Propagate->GetPQRdot()).Dump(delimeter) << delimeter;
     390                 :       4909 :     outstream << (radtodeg*Propagate->GetPQRi()).Dump(delimeter);
     391                 :            :   }
     392         [ +  - ]:       4909 :   if (SubSystems & ssVelocities) {
     393                 :       4909 :     outstream << delimeter;
     394                 :       4909 :     outstream << Auxiliary->Getqbar() << delimeter;
     395                 :       4909 :     outstream << Auxiliary->GetReynoldsNumber() << delimeter;
     396                 :       4909 :     outstream << setprecision(12) << Auxiliary->GetVt() << delimeter;
     397                 :       4909 :     outstream << Propagate->GetInertialVelocityMagnitude() << delimeter;
     398                 :       4909 :     outstream << setprecision(12) << Propagate->GetUVW().Dump(delimeter) << delimeter;
     399                 :       4909 :     outstream << Auxiliary->GetAeroUVW().Dump(delimeter) << delimeter;
     400                 :       4909 :     outstream << Propagate->GetInertialVelocity().Dump(delimeter) << delimeter;
     401                 :       4909 :     outstream << Propagate->GetVel().Dump(delimeter);
     402                 :            :     outstream.precision(10);
     403                 :            :   }
     404         [ +  - ]:       4909 :   if (SubSystems & ssForces) {
     405                 :       4909 :     outstream << delimeter;
     406                 :       4909 :     outstream << Aerodynamics->GetvFw().Dump(delimeter) << delimeter;
     407                 :       4909 :     outstream << Aerodynamics->GetLoD() << delimeter;
     408                 :       4909 :     outstream << Aerodynamics->GetForces().Dump(delimeter) << delimeter;
     409                 :       4909 :     outstream << Propulsion->GetForces().Dump(delimeter) << delimeter;
     410                 :       4909 :     outstream << GroundReactions->GetForces().Dump(delimeter) << delimeter;
     411                 :       4909 :     outstream << ExternalReactions->GetForces().Dump(delimeter) << delimeter;
     412                 :       4909 :     outstream << BuoyantForces->GetForces().Dump(delimeter) << delimeter;
     413                 :       4909 :     outstream << Aircraft->GetForces().Dump(delimeter);
     414                 :            :   }
     415         [ +  - ]:       4909 :   if (SubSystems & ssMoments) {
     416                 :       4909 :     outstream << delimeter;
     417                 :       4909 :     outstream << Aerodynamics->GetMoments().Dump(delimeter) << delimeter;
     418                 :       4909 :     outstream << Propulsion->GetMoments().Dump(delimeter) << delimeter;
     419                 :       4909 :     outstream << GroundReactions->GetMoments().Dump(delimeter) << delimeter;
     420                 :       4909 :     outstream << ExternalReactions->GetMoments().Dump(delimeter) << delimeter;
     421                 :       4909 :     outstream << BuoyantForces->GetMoments().Dump(delimeter) << delimeter;
     422                 :       4909 :     outstream << Aircraft->GetMoments().Dump(delimeter);
     423                 :            :   }
     424         [ +  - ]:       4909 :   if (SubSystems & ssAtmosphere) {
     425                 :       4909 :     outstream << delimeter;
     426                 :       4909 :     outstream << Atmosphere->GetDensity() << delimeter;
     427                 :       4909 :     outstream << Atmosphere->GetAbsoluteViscosity() << delimeter;
     428                 :       4909 :     outstream << Atmosphere->GetKinematicViscosity() << delimeter;
     429                 :       4909 :     outstream << Atmosphere->GetTemperature() << delimeter;
     430                 :       4909 :     outstream << Atmosphere->GetPressureSL() << delimeter;
     431                 :       4909 :     outstream << Atmosphere->GetPressure() << delimeter;
     432                 :       4909 :     outstream << Atmosphere->GetTurbMagnitude() << delimeter;
     433                 :       4909 :     outstream << Atmosphere->GetTurbDirection().Dump(delimeter) << delimeter;
     434                 :       4909 :     outstream << Atmosphere->GetTotalWindNED().Dump(delimeter);
     435                 :            :   }
     436         [ +  - ]:       4909 :   if (SubSystems & ssMassProps) {
     437                 :       4909 :     outstream << delimeter;
     438                 :       4909 :     outstream << MassBalance->GetJ().Dump(delimeter) << delimeter;
     439                 :       4909 :     outstream << MassBalance->GetMass() << delimeter;
     440                 :       4909 :     outstream << MassBalance->GetXYZcg().Dump(delimeter);
     441                 :            :   }
     442         [ +  - ]:       4909 :   if (SubSystems & ssPropagate) {
     443                 :            :     outstream.precision(14);
     444                 :       4909 :     outstream << delimeter;
     445                 :       4909 :     outstream << Propagate->GetAltitudeASL() << delimeter;
     446                 :       9818 :     outstream << Propagate->GetDistanceAGL() << delimeter;
     447                 :       4909 :     outstream << (radtodeg*Propagate->GetEuler()).Dump(delimeter) << delimeter;
     448                 :       4909 :     outstream << Auxiliary->Getalpha(inDegrees) << delimeter;
     449                 :       4909 :     outstream << Auxiliary->Getbeta(inDegrees) << delimeter;
     450                 :       4909 :     outstream << Propagate->GetLocation().GetLatitudeDeg() << delimeter;
     451                 :       4909 :     outstream << Propagate->GetLocation().GetLongitudeDeg() << delimeter;
     452                 :            :     outstream.precision(18);
     453                 :       4909 :     outstream << ((FGColumnVector3)Propagate->GetInertialPosition()).Dump(delimeter) << delimeter;
     454                 :       4909 :     outstream << ((FGColumnVector3)Propagate->GetLocation()).Dump(delimeter) << delimeter;
     455                 :            :     outstream.precision(14);
     456                 :       4909 :     outstream << Inertial->GetEarthPositionAngleDeg() << delimeter;
     457                 :       9818 :     outstream << Propagate->GetDistanceAGL() << delimeter;
     458                 :       4909 :     outstream << Propagate->GetTerrainElevation();
     459                 :            :     outstream.precision(10);
     460                 :            :   }
     461         [ -  + ]:       4909 :   if (SubSystems & ssCoefficients) {
     462                 :          0 :     scratch = Aerodynamics->GetCoefficientValues(delimeter);
     463         [ #  # ]:          0 :     if (scratch.length() != 0) outstream << delimeter << scratch;
     464                 :            :   }
     465         [ +  - ]:       4909 :   if (SubSystems & ssFCS) {
     466                 :       9818 :     scratch = FCS->GetComponentValues(delimeter);
     467         [ +  - ]:       4909 :     if (scratch.length() != 0) outstream << delimeter << scratch;
     468                 :            :   }
     469         [ -  + ]:       4909 :   if (SubSystems & ssGroundReactions) {
     470                 :          0 :     outstream << delimeter;
     471                 :          0 :     outstream << GroundReactions->GetGroundReactionValues(delimeter);
     472                 :            :   }
     473 [ +  - ][ +  - ]:       4909 :   if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
                 [ +  - ]
     474                 :       4909 :     outstream << delimeter;
     475                 :       4909 :     outstream << Propulsion->GetPropulsionValues(delimeter);
     476                 :            :   }
     477                 :            : 
     478                 :            :   outstream.precision(18);
     479         [ -  + ]:       4909 :   for (unsigned int i=0;i<OutputProperties.size();i++) {
     480                 :          0 :     outstream << delimeter << OutputProperties[i]->getDoubleValue();
     481                 :            :   }
     482                 :            :   outstream.precision(10);
     483                 :            : 
     484                 :            :   outstream << endl;
     485                 :       4909 :   outstream.flush();
     486                 :       4909 : }
     487                 :            : 
     488                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     489                 :            : 
     490                 :          0 : void FGOutput::SocketDataFill(FGNetFDM* net)
     491                 :            : {
     492                 :            :     unsigned int i;
     493                 :            : 
     494                 :            :     // Version
     495                 :          0 :     net->version = FG_NET_FDM_VERSION;
     496                 :            : 
     497                 :            :     // Positions
     498                 :          0 :     net->longitude = Propagate->GetLocation().GetLongitude(); // geodetic (radians)
     499                 :          0 :     net->latitude  = Propagate->GetLocation().GetLatitude(); // geodetic (radians)
     500                 :          0 :     net->altitude  = Propagate->GetAltitudeASL()*0.3048; // altitude, above sea level (meters)
     501                 :          0 :     net->agl       = (float)(Propagate->GetDistanceAGL()*0.3048); // altitude, above ground level (meters)
     502                 :            : 
     503                 :          0 :     net->phi       = (float)(Propagate->GetEuler(ePhi)); // roll (radians)
     504                 :          0 :     net->theta     = (float)(Propagate->GetEuler(eTht)); // pitch (radians)
     505                 :          0 :     net->psi       = (float)(Propagate->GetEuler(ePsi)); // yaw or true heading (radians)
     506                 :            : 
     507                 :          0 :     net->alpha     = (float)(Auxiliary->Getalpha()); // angle of attack (radians)
     508                 :          0 :     net->beta      = (float)(Auxiliary->Getbeta()); // side slip angle (radians)
     509                 :            : 
     510                 :            :     // Velocities
     511                 :          0 :     net->phidot     = (float)(Auxiliary->GetEulerRates(ePhi)); // roll rate (radians/sec)
     512                 :          0 :     net->thetadot   = (float)(Auxiliary->GetEulerRates(eTht)); // pitch rate (radians/sec)
     513                 :          0 :     net->psidot     = (float)(Auxiliary->GetEulerRates(ePsi)); // yaw rate (radians/sec)
     514                 :          0 :     net->vcas       = (float)(Auxiliary->GetVcalibratedFPS()); // VCAS, ft/sec
     515                 :          0 :     net->climb_rate = (float)(Propagate->Gethdot());           // altitude rate, ft/sec
     516                 :          0 :     net->v_north    = (float)(Propagate->GetVel(eNorth));      // north vel in NED frame, fps
     517                 :          0 :     net->v_east     = (float)(Propagate->GetVel(eEast));       // east vel in NED frame, fps
     518                 :          0 :     net->v_down     = (float)(Propagate->GetVel(eDown));       // down vel in NED frame, fps
     519                 :            : //---ADD METHOD TO CALCULATE THESE TERMS---
     520                 :          0 :     net->v_wind_body_north = (float)(Propagate->GetVel(eNorth)); // north vel in NED relative to airmass, fps
     521                 :          0 :     net->v_wind_body_east = (float)(Propagate->GetVel(eEast)); // east vel in NED relative to airmass, fps
     522                 :          0 :     net->v_wind_body_down = (float)(Propagate->GetVel(eDown)); // down vel in NED relative to airmass, fps
     523                 :            : 
     524                 :            :     // Accelerations
     525                 :          0 :     net->A_X_pilot   = (float)(Auxiliary->GetPilotAccel(1));    // X body accel, ft/s/s
     526                 :          0 :     net->A_Y_pilot   = (float)(Auxiliary->GetPilotAccel(2));    // Y body accel, ft/s/s
     527                 :          0 :     net->A_Z_pilot   = (float)(Auxiliary->GetPilotAccel(3));    // Z body accel, ft/s/s
     528                 :            : 
     529                 :            :     // Stall
     530                 :          0 :     net->stall_warning = 0.0;  // 0.0 - 1.0 indicating the amount of stall
     531                 :          0 :     net->slip_deg    = (float)(Auxiliary->Getbeta(inDegrees));  // slip ball deflection, deg
     532                 :            : 
     533                 :            :     // Engine status
     534                 :          0 :     net->num_engines = Propulsion->GetNumEngines(); // Number of valid engines
     535                 :            : 
     536         [ #  # ]:          0 :     for (i=0; i<net->num_engines; i++) {
     537         [ #  # ]:          0 :        if (Propulsion->GetEngine(i)->GetRunning())
     538                 :          0 :           net->eng_state[i] = 2;       // Engine state running
     539         [ #  # ]:          0 :        else if (Propulsion->GetEngine(i)->GetCranking())
     540                 :          0 :           net->eng_state[i] = 1;       // Engine state cranking
     541                 :            :        else
     542                 :          0 :           net->eng_state[i] = 0;       // Engine state off
     543                 :            : 
     544         [ #  # ]:          0 :        switch (Propulsion->GetEngine(i)->GetType()) {
     545                 :            :        case (FGEngine::etRocket):
     546                 :            :        break;
     547                 :            :        case (FGEngine::etPiston):
     548                 :          0 :           net->rpm[i]       = (float)(((FGPiston *)Propulsion->GetEngine(i))->getRPM());
     549                 :          0 :           net->fuel_flow[i] = (float)(((FGPiston *)Propulsion->GetEngine(i))->getFuelFlow_gph());
     550                 :          0 :           net->fuel_px[i]   = 0; // Fuel pressure, psi  (N/A in current model)
     551                 :          0 :           net->egt[i]       = (float)(((FGPiston *)Propulsion->GetEngine(i))->GetEGT());
     552                 :          0 :           net->cht[i]       = (float)(((FGPiston *)Propulsion->GetEngine(i))->getCylinderHeadTemp_degF());
     553                 :          0 :           net->mp_osi[i]    = (float)(((FGPiston *)Propulsion->GetEngine(i))->getManifoldPressure_inHg());
     554                 :          0 :           net->oil_temp[i]  = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilTemp_degF());
     555                 :          0 :           net->oil_px[i]    = (float)(((FGPiston *)Propulsion->GetEngine(i))->getOilPressure_psi());
     556                 :          0 :           net->tit[i]       = 0; // Turbine Inlet Temperature  (N/A for piston)
     557                 :            :        break;
     558                 :            :        case (FGEngine::etTurbine):
     559                 :            :        break;
     560                 :            :        case (FGEngine::etTurboprop):
     561                 :            :        break;
     562                 :            :        case (FGEngine::etElectric):
     563                 :            :        break;
     564                 :            :        case (FGEngine::etUnknown):
     565                 :            :        break;
     566                 :            :        }
     567                 :            :     }
     568                 :            : 
     569                 :            : 
     570                 :            :     // Consumables
     571                 :          0 :     net->num_tanks = Propulsion->GetNumTanks();   // Max number of fuel tanks
     572                 :            : 
     573         [ #  # ]:          0 :     for (i=0; i<net->num_tanks; i++) {
     574                 :          0 :        net->fuel_quantity[i] = (float)(((FGTank *)Propulsion->GetTank(i))->GetContents());
     575                 :            :     }
     576                 :            : 
     577                 :            : 
     578                 :            :     // Gear status
     579                 :          0 :     net->num_wheels  = GroundReactions->GetNumGearUnits();
     580                 :            : 
     581         [ #  # ]:          0 :     for (i=0; i<net->num_wheels; i++) {
     582                 :          0 :        net->wow[i]              = GroundReactions->GetGearUnit(i)->GetWOW();
     583         [ #  # ]:          0 :        if (GroundReactions->GetGearUnit(i)->GetGearUnitDown())
     584                 :          0 :           net->gear_pos[i]      = 1;  //gear down, using FCS convention
     585                 :            :        else
     586                 :          0 :           net->gear_pos[i]      = 0;  //gear up, using FCS convention
     587                 :          0 :        net->gear_steer[i]       = (float)(GroundReactions->GetGearUnit(i)->GetSteerNorm());
     588                 :          0 :        net->gear_compression[i] = (float)(GroundReactions->GetGearUnit(i)->GetCompLen());
     589                 :            :     }
     590                 :            : 
     591                 :            : 
     592                 :            :     // Environment
     593                 :          0 :     net->cur_time    = (long int)1234567890; // Friday, Feb 13, 2009, 23:31:30 UTC (not processed by FGFS anyway)
     594                 :          0 :     net->warp        = 0;                       // offset in seconds to unix time
     595                 :          0 :     net->visibility  = 25000.0;                 // visibility in meters (for env. effects)
     596                 :            : 
     597                 :            : 
     598                 :            :     // Control surface positions (normalized values)
     599                 :          0 :     net->elevator          = (float)(FCS->GetDePos(ofNorm));    // Norm Elevator Pos, --
     600                 :          0 :     net->elevator_trim_tab = (float)(FCS->GetPitchTrimCmd());   // Norm Elev Trim Tab Pos, --
     601                 :          0 :     net->left_flap         = (float)(FCS->GetDfPos(ofNorm));    // Norm Flap Pos, --
     602                 :          0 :     net->right_flap        = (float)(FCS->GetDfPos(ofNorm));    // Norm Flap Pos, --
     603                 :          0 :     net->left_aileron      = (float)(FCS->GetDaLPos(ofNorm));   // Norm L Aileron Pos, --
     604                 :          0 :     net->right_aileron     = (float)(FCS->GetDaRPos(ofNorm));   // Norm R Aileron Pos, --
     605                 :          0 :     net->rudder            = (float)(FCS->GetDrPos(ofNorm));    // Norm Rudder Pos, --
     606                 :          0 :     net->nose_wheel        = (float)(FCS->GetDrPos(ofNorm));    // *** FIX ***  Using Rudder Pos for NWS, --
     607                 :          0 :     net->speedbrake        = (float)(FCS->GetDsbPos(ofNorm));   // Norm Speedbrake Pos, --
     608                 :          0 :     net->spoilers          = (float)(FCS->GetDspPos(ofNorm));   // Norm Spoiler Pos, --
     609                 :            : 
     610                 :            : 
     611                 :            :     // Convert the net buffer to network format
     612         [ #  # ]:          0 :     if ( isLittleEndian ) {
     613         [ #  # ]:          0 :         net->version = htonl(net->version);
     614                 :            : 
     615                 :          0 :         htond(net->longitude);
     616                 :          0 :         htond(net->latitude);
     617                 :          0 :         htond(net->altitude);
     618                 :          0 :         htonf(net->agl);
     619                 :          0 :         htonf(net->phi);
     620                 :          0 :         htonf(net->theta);
     621                 :          0 :         htonf(net->psi);
     622                 :          0 :         htonf(net->alpha);
     623                 :          0 :         htonf(net->beta);
     624                 :            : 
     625                 :          0 :         htonf(net->phidot);
     626                 :          0 :         htonf(net->thetadot);
     627                 :          0 :         htonf(net->psidot);
     628                 :          0 :         htonf(net->vcas);
     629                 :          0 :         htonf(net->climb_rate);
     630                 :          0 :         htonf(net->v_north);
     631                 :          0 :         htonf(net->v_east);
     632                 :          0 :         htonf(net->v_down);
     633                 :          0 :         htonf(net->v_wind_body_north);
     634                 :          0 :         htonf(net->v_wind_body_east);
     635                 :          0 :         htonf(net->v_wind_body_down);
     636                 :            : 
     637                 :          0 :         htonf(net->A_X_pilot);
     638                 :          0 :         htonf(net->A_Y_pilot);
     639                 :          0 :         htonf(net->A_Z_pilot);
     640                 :            : 
     641                 :          0 :         htonf(net->stall_warning);
     642                 :          0 :         htonf(net->slip_deg);
     643                 :            : 
     644         [ #  # ]:          0 :         for (i=0; i<net->num_engines; ++i ) {
     645         [ #  # ]:          0 :             net->eng_state[i] = htonl(net->eng_state[i]);
     646                 :          0 :             htonf(net->rpm[i]);
     647                 :          0 :             htonf(net->fuel_flow[i]);
     648                 :          0 :             htonf(net->fuel_px[i]);
     649                 :          0 :             htonf(net->egt[i]);
     650                 :          0 :             htonf(net->cht[i]);
     651                 :          0 :             htonf(net->mp_osi[i]);
     652                 :          0 :             htonf(net->tit[i]);
     653                 :          0 :             htonf(net->oil_temp[i]);
     654                 :          0 :             htonf(net->oil_px[i]);
     655                 :            :         }
     656         [ #  # ]:          0 :         net->num_engines = htonl(net->num_engines);
     657                 :            : 
     658         [ #  # ]:          0 :         for (i=0; i<net->num_tanks; ++i ) {
     659                 :          0 :             htonf(net->fuel_quantity[i]);
     660                 :            :         }
     661         [ #  # ]:          0 :         net->num_tanks = htonl(net->num_tanks);
     662                 :            : 
     663         [ #  # ]:          0 :         for (i=0; i<net->num_wheels; ++i ) {
     664         [ #  # ]:          0 :             net->wow[i] = htonl(net->wow[i]);
     665                 :          0 :             htonf(net->gear_pos[i]);
     666                 :          0 :             htonf(net->gear_steer[i]);
     667                 :          0 :             htonf(net->gear_compression[i]);
     668                 :            :         }
     669         [ #  # ]:          0 :         net->num_wheels = htonl(net->num_wheels);
     670                 :            : 
     671         [ #  # ]:          0 :         net->cur_time = htonl( net->cur_time );
     672         [ #  # ]:          0 :         net->warp = htonl( net->warp );
     673                 :          0 :         htonf(net->visibility);
     674                 :            : 
     675                 :          0 :         htonf(net->elevator);
     676                 :          0 :         htonf(net->elevator_trim_tab);
     677                 :          0 :         htonf(net->left_flap);
     678                 :          0 :         htonf(net->right_flap);
     679                 :          0 :         htonf(net->left_aileron);
     680                 :          0 :         htonf(net->right_aileron);
     681                 :          0 :         htonf(net->rudder);
     682                 :          0 :         htonf(net->nose_wheel);
     683                 :          0 :         htonf(net->speedbrake);
     684                 :          0 :         htonf(net->spoilers);
     685                 :            :     }
     686                 :          0 : }
     687                 :            : 
     688                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     689                 :            : 
     690                 :          0 : void FGOutput::FlightGearSocketOutput(void)
     691                 :            : {
     692                 :          0 :   int length = sizeof(fgSockBuf);
     693                 :            : 
     694                 :            : 
     695         [ #  # ]:          0 :   if (flightGearSocket == NULL) return;
     696         [ #  # ]:          0 :   if (!flightGearSocket->GetConnectStatus()) return;
     697                 :            : 
     698                 :          0 :   SocketDataFill(&fgSockBuf);
     699                 :          0 :   flightGearSocket->Send((char *)&fgSockBuf, length);
     700                 :            : }
     701                 :            : 
     702                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     703                 :            : 
     704                 :          0 : void FGOutput::SocketOutput(void)
     705                 :            : {
     706                 :          0 :   string asciiData, scratch;
     707                 :            : 
     708         [ #  # ]:          0 :   if (socket == NULL) return;
     709         [ #  # ]:          0 :   if (!socket->GetConnectStatus()) return;
     710                 :            : 
     711                 :          0 :   socket->Clear();
     712         [ #  # ]:          0 :   if (sFirstPass) {
     713                 :          0 :     socket->Clear("<LABELS>");
     714                 :          0 :     socket->Append("Time");
     715                 :            : 
     716         [ #  # ]:          0 :     if (SubSystems & ssAerosurfaces) {
     717                 :          0 :       socket->Append("Aileron Command");
     718                 :          0 :       socket->Append("Elevator Command");
     719                 :          0 :       socket->Append("Rudder Command");
     720                 :          0 :       socket->Append("Flap Command");
     721                 :          0 :       socket->Append("Left Aileron Position");
     722                 :          0 :       socket->Append("Right Aileron Position");
     723                 :          0 :       socket->Append("Elevator Position");
     724                 :          0 :       socket->Append("Rudder Position");
     725                 :          0 :       socket->Append("Flap Position");
     726                 :            :     }
     727                 :            : 
     728         [ #  # ]:          0 :     if (SubSystems & ssRates) {
     729                 :          0 :       socket->Append("P");
     730                 :          0 :       socket->Append("Q");
     731                 :          0 :       socket->Append("R");
     732                 :          0 :       socket->Append("PDot");
     733                 :          0 :       socket->Append("QDot");
     734                 :          0 :       socket->Append("RDot");
     735                 :            :     }
     736                 :            : 
     737         [ #  # ]:          0 :     if (SubSystems & ssVelocities) {
     738                 :          0 :       socket->Append("QBar");
     739                 :          0 :       socket->Append("Vtotal");
     740                 :          0 :       socket->Append("UBody");
     741                 :          0 :       socket->Append("VBody");
     742                 :          0 :       socket->Append("WBody");
     743                 :          0 :       socket->Append("UAero");
     744                 :          0 :       socket->Append("VAero");
     745                 :          0 :       socket->Append("WAero");
     746                 :          0 :       socket->Append("Vn");
     747                 :          0 :       socket->Append("Ve");
     748                 :          0 :       socket->Append("Vd");
     749                 :            :     }
     750         [ #  # ]:          0 :     if (SubSystems & ssForces) {
     751                 :          0 :       socket->Append("F_Drag");
     752                 :          0 :       socket->Append("F_Side");
     753                 :          0 :       socket->Append("F_Lift");
     754                 :          0 :       socket->Append("LoD");
     755                 :          0 :       socket->Append("Fx");
     756                 :          0 :       socket->Append("Fy");
     757                 :          0 :       socket->Append("Fz");
     758                 :            :     }
     759         [ #  # ]:          0 :     if (SubSystems & ssMoments) {
     760                 :          0 :       socket->Append("L");
     761                 :          0 :       socket->Append("M");
     762                 :          0 :       socket->Append("N");
     763                 :            :     }
     764         [ #  # ]:          0 :     if (SubSystems & ssAtmosphere) {
     765                 :          0 :       socket->Append("Rho");
     766                 :          0 :       socket->Append("SL pressure");
     767                 :          0 :       socket->Append("Ambient pressure");
     768                 :          0 :       socket->Append("Turbulence Magnitude");
     769                 :          0 :       socket->Append("Turbulence Direction X");
     770                 :          0 :       socket->Append("Turbulence Direction Y");
     771                 :          0 :       socket->Append("Turbulence Direction Z");
     772                 :          0 :       socket->Append("NWind");
     773                 :          0 :       socket->Append("EWind");
     774                 :          0 :       socket->Append("DWind");
     775                 :            :     }
     776         [ #  # ]:          0 :     if (SubSystems & ssMassProps) {
     777                 :          0 :       socket->Append("Ixx");
     778                 :          0 :       socket->Append("Ixy");
     779                 :          0 :       socket->Append("Ixz");
     780                 :          0 :       socket->Append("Iyx");
     781                 :          0 :       socket->Append("Iyy");
     782                 :          0 :       socket->Append("Iyz");
     783                 :          0 :       socket->Append("Izx");
     784                 :          0 :       socket->Append("Izy");
     785                 :          0 :       socket->Append("Izz");
     786                 :          0 :       socket->Append("Mass");
     787                 :          0 :       socket->Append("Xcg");
     788                 :          0 :       socket->Append("Ycg");
     789                 :          0 :       socket->Append("Zcg");
     790                 :            :     }
     791         [ #  # ]:          0 :     if (SubSystems & ssPropagate) {
     792                 :          0 :         socket->Append("Altitude");
     793                 :          0 :         socket->Append("Phi (deg)");
     794                 :          0 :         socket->Append("Tht (deg)");
     795                 :          0 :         socket->Append("Psi (deg)");
     796                 :          0 :         socket->Append("Alpha (deg)");
     797                 :          0 :         socket->Append("Beta (deg)");
     798                 :          0 :         socket->Append("Latitude (deg)");
     799                 :          0 :         socket->Append("Longitude (deg)");
     800                 :            :     }
     801         [ #  # ]:          0 :     if (SubSystems & ssCoefficients) {
     802                 :          0 :       scratch = Aerodynamics->GetCoefficientStrings(",");
     803         [ #  # ]:          0 :       if (scratch.length() != 0) socket->Append(scratch);
     804                 :            :     }
     805         [ #  # ]:          0 :     if (SubSystems & ssFCS) {
     806                 :          0 :       scratch = FCS->GetComponentStrings(",");
     807         [ #  # ]:          0 :       if (scratch.length() != 0) socket->Append(scratch);
     808                 :            :     }
     809         [ #  # ]:          0 :     if (SubSystems & ssGroundReactions) {
     810                 :          0 :       socket->Append(GroundReactions->GetGroundReactionStrings(","));
     811                 :            :     }
     812 [ #  # ][ #  # ]:          0 :     if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
                 [ #  # ]
     813                 :          0 :       socket->Append(Propulsion->GetPropulsionStrings(","));
     814                 :            :     }
     815         [ #  # ]:          0 :     if (OutputProperties.size() > 0) {
     816         [ #  # ]:          0 :       for (unsigned int i=0;i<OutputProperties.size();i++) {
     817                 :          0 :         socket->Append(OutputProperties[i]->GetPrintableName());
     818                 :            :       }
     819                 :            :     }
     820                 :            : 
     821                 :          0 :     sFirstPass = false;
     822                 :          0 :     socket->Send();
     823                 :            :   }
     824                 :            : 
     825                 :          0 :   socket->Clear();
     826                 :          0 :   socket->Append(FDMExec->GetSimTime());
     827                 :            : 
     828         [ #  # ]:          0 :   if (SubSystems & ssAerosurfaces) {
     829                 :          0 :     socket->Append(FCS->GetDaCmd());
     830                 :          0 :     socket->Append(FCS->GetDeCmd());
     831                 :          0 :     socket->Append(FCS->GetDrCmd());
     832                 :          0 :     socket->Append(FCS->GetDfCmd());
     833                 :          0 :     socket->Append(FCS->GetDaLPos());
     834                 :          0 :     socket->Append(FCS->GetDaRPos());
     835                 :          0 :     socket->Append(FCS->GetDePos());
     836                 :          0 :     socket->Append(FCS->GetDrPos());
     837                 :          0 :     socket->Append(FCS->GetDfPos());
     838                 :            :   }
     839         [ #  # ]:          0 :   if (SubSystems & ssRates) {
     840                 :          0 :     socket->Append(radtodeg*Propagate->GetPQR(eP));
     841                 :          0 :     socket->Append(radtodeg*Propagate->GetPQR(eQ));
     842                 :          0 :     socket->Append(radtodeg*Propagate->GetPQR(eR));
     843                 :          0 :     socket->Append(radtodeg*Propagate->GetPQRdot(eP));
     844                 :          0 :     socket->Append(radtodeg*Propagate->GetPQRdot(eQ));
     845                 :          0 :     socket->Append(radtodeg*Propagate->GetPQRdot(eR));
     846                 :            :   }
     847         [ #  # ]:          0 :   if (SubSystems & ssVelocities) {
     848                 :          0 :     socket->Append(Auxiliary->Getqbar());
     849                 :          0 :     socket->Append(Auxiliary->GetVt());
     850                 :          0 :     socket->Append(Propagate->GetUVW(eU));
     851                 :          0 :     socket->Append(Propagate->GetUVW(eV));
     852                 :          0 :     socket->Append(Propagate->GetUVW(eW));
     853                 :          0 :     socket->Append(Auxiliary->GetAeroUVW(eU));
     854                 :          0 :     socket->Append(Auxiliary->GetAeroUVW(eV));
     855                 :          0 :     socket->Append(Auxiliary->GetAeroUVW(eW));
     856                 :          0 :     socket->Append(Propagate->GetVel(eNorth));
     857                 :          0 :     socket->Append(Propagate->GetVel(eEast));
     858                 :          0 :     socket->Append(Propagate->GetVel(eDown));
     859                 :            :   }
     860         [ #  # ]:          0 :   if (SubSystems & ssForces) {
     861                 :          0 :     socket->Append(Aerodynamics->GetvFw()(eDrag));
     862                 :          0 :     socket->Append(Aerodynamics->GetvFw()(eSide));
     863                 :          0 :     socket->Append(Aerodynamics->GetvFw()(eLift));
     864                 :          0 :     socket->Append(Aerodynamics->GetLoD());
     865                 :          0 :     socket->Append(Aircraft->GetForces(eX));
     866                 :          0 :     socket->Append(Aircraft->GetForces(eY));
     867                 :          0 :     socket->Append(Aircraft->GetForces(eZ));
     868                 :            :   }
     869         [ #  # ]:          0 :   if (SubSystems & ssMoments) {
     870                 :          0 :     socket->Append(Aircraft->GetMoments(eL));
     871                 :          0 :     socket->Append(Aircraft->GetMoments(eM));
     872                 :          0 :     socket->Append(Aircraft->GetMoments(eN));
     873                 :            :   }
     874         [ #  # ]:          0 :   if (SubSystems & ssAtmosphere) {
     875                 :          0 :     socket->Append(Atmosphere->GetDensity());
     876                 :          0 :     socket->Append(Atmosphere->GetPressureSL());
     877                 :          0 :     socket->Append(Atmosphere->GetPressure());
     878                 :          0 :     socket->Append(Atmosphere->GetTurbMagnitude());
     879                 :          0 :     socket->Append(Atmosphere->GetTurbDirection().Dump(","));
     880                 :          0 :     socket->Append(Atmosphere->GetTotalWindNED().Dump(","));
     881                 :            :   }
     882         [ #  # ]:          0 :   if (SubSystems & ssMassProps) {
     883                 :          0 :     socket->Append(MassBalance->GetJ()(1,1));
     884                 :          0 :     socket->Append(MassBalance->GetJ()(1,2));
     885                 :          0 :     socket->Append(MassBalance->GetJ()(1,3));
     886                 :          0 :     socket->Append(MassBalance->GetJ()(2,1));
     887                 :          0 :     socket->Append(MassBalance->GetJ()(2,2));
     888                 :          0 :     socket->Append(MassBalance->GetJ()(2,3));
     889                 :          0 :     socket->Append(MassBalance->GetJ()(3,1));
     890                 :          0 :     socket->Append(MassBalance->GetJ()(3,2));
     891                 :          0 :     socket->Append(MassBalance->GetJ()(3,3));
     892                 :          0 :     socket->Append(MassBalance->GetMass());
     893                 :          0 :     socket->Append(MassBalance->GetXYZcg()(eX));
     894                 :          0 :     socket->Append(MassBalance->GetXYZcg()(eY));
     895                 :          0 :     socket->Append(MassBalance->GetXYZcg()(eZ));
     896                 :            :   }
     897         [ #  # ]:          0 :   if (SubSystems & ssPropagate) {
     898                 :          0 :     socket->Append(Propagate->GetAltitudeASL());
     899                 :          0 :     socket->Append(radtodeg*Propagate->GetEuler(ePhi));
     900                 :          0 :     socket->Append(radtodeg*Propagate->GetEuler(eTht));
     901                 :          0 :     socket->Append(radtodeg*Propagate->GetEuler(ePsi));
     902                 :          0 :     socket->Append(Auxiliary->Getalpha(inDegrees));
     903                 :          0 :     socket->Append(Auxiliary->Getbeta(inDegrees));
     904                 :          0 :     socket->Append(Propagate->GetLocation().GetLatitudeDeg());
     905                 :          0 :     socket->Append(Propagate->GetLocation().GetLongitudeDeg());
     906                 :            :   }
     907         [ #  # ]:          0 :   if (SubSystems & ssCoefficients) {
     908                 :          0 :     scratch = Aerodynamics->GetCoefficientValues(",");
     909         [ #  # ]:          0 :     if (scratch.length() != 0) socket->Append(scratch);
     910                 :            :   }
     911         [ #  # ]:          0 :   if (SubSystems & ssFCS) {
     912                 :          0 :     scratch = FCS->GetComponentValues(",");
     913         [ #  # ]:          0 :     if (scratch.length() != 0) socket->Append(scratch);
     914                 :            :   }
     915         [ #  # ]:          0 :   if (SubSystems & ssGroundReactions) {
     916                 :          0 :     socket->Append(GroundReactions->GetGroundReactionValues(","));
     917                 :            :   }
     918 [ #  # ][ #  # ]:          0 :   if (SubSystems & ssPropulsion && Propulsion->GetNumEngines() > 0) {
                 [ #  # ]
     919                 :          0 :     socket->Append(Propulsion->GetPropulsionValues(","));
     920                 :            :   }
     921                 :            : 
     922         [ #  # ]:          0 :   for (unsigned int i=0;i<OutputProperties.size();i++) {
     923                 :          0 :     socket->Append(OutputProperties[i]->getDoubleValue());
     924                 :            :   }
     925                 :            : 
     926                 :          0 :   socket->Send();
     927                 :            : }
     928                 :            : 
     929                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     930                 :            : 
     931                 :          0 : void FGOutput::SocketStatusOutput(const string& out_str)
     932                 :            : {
     933                 :          0 :   string asciiData;
     934                 :            : 
     935         [ #  # ]:          0 :   if (socket == NULL) return;
     936                 :            : 
     937                 :          0 :   socket->Clear();
     938                 :          0 :   asciiData = string("<STATUS>") + out_str;
     939                 :          0 :   socket->Append(asciiData.c_str());
     940                 :          0 :   socket->Send();
     941                 :            : }
     942                 :            : 
     943                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     944                 :            : 
     945                 :          1 : bool FGOutput::Load(Element* element)
     946                 :            : {
     947                 :          1 :   string type="", parameter="";
     948                 :          1 :   string name="";
     949                 :          1 :   string protocol="tcp";
     950                 :          1 :   int OutRate = 0;
     951                 :          1 :   string property;
     952                 :            :   unsigned int port;
     953                 :            :   Element *property_element;
     954                 :            : 
     955                 :          1 :   string separator = "/";
     956                 :            : 
     957         [ -  + ]:          1 :   if (!DirectivesFile.empty()) { // A directives filename from the command line overrides
     958                 :          0 :     output_file_name = DirectivesFile;      // one found in the config file.
     959                 :          0 :     document = LoadXMLDocument(output_file_name);
     960         [ -  + ]:          1 :   } else if (!element->GetAttributeValue("file").empty()) {
     961                 :          0 :     output_file_name = FDMExec->GetRootDir() + element->GetAttributeValue("file");
     962                 :          0 :     document = LoadXMLDocument(output_file_name);
     963                 :            :   } else {
     964                 :          1 :     document = element;
     965                 :            :   }
     966                 :            : 
     967         [ -  + ]:          1 :   if (!document) return false;
     968                 :            : 
     969                 :          3 :   name = FDMExec->GetRootDir() + document->GetAttributeValue("name");
     970                 :          2 :   type = document->GetAttributeValue("type");
     971                 :          1 :   SetType(type);
     972 [ -  + ][ #  # ]:          2 :   if (!document->GetAttributeValue("port").empty() && type == string("SOCKET")) {
         [ -  + ][ #  # ]
         [ #  # ][ -  + ]
         [ #  # ][ +  - ]
         [ #  # ][ +  - ]
         [ #  # ][ +  - ]
                 [ -  + ]
     973                 :          0 :     port = atoi(document->GetAttributeValue("port").c_str());
     974                 :          0 :     socket = new FGfdmSocket(name, port);
     975 [ -  + ][ #  # ]:          2 :   } else if (!document->GetAttributeValue("port").empty() && type == string("FLIGHTGEAR")) {
         [ -  + ][ #  # ]
         [ #  # ][ -  + ]
         [ #  # ][ +  - ]
         [ #  # ][ +  - ]
         [ #  # ][ +  - ]
                 [ -  + ]
     976                 :          0 :     port = atoi(document->GetAttributeValue("port").c_str());
     977         [ #  # ]:          0 :     if (!document->GetAttributeValue("protocol").empty())
     978                 :          0 :        protocol = document->GetAttributeValue("protocol");
     979         [ #  # ]:          0 :     if (protocol == "udp")
     980                 :          0 :        flightGearSocket = new FGfdmSocket(name, port, FGfdmSocket::ptUDP);  // create udp socket
     981                 :            :     else
     982                 :          0 :        flightGearSocket = new FGfdmSocket(name, port, FGfdmSocket::ptTCP);  // create tcp socket (default)
     983                 :            :   } else {
     984                 :          2 :     BaseFilename = Filename = name;
     985                 :            :   }
     986         [ +  - ]:          1 :   if (!document->GetAttributeValue("rate").empty()) {
     987                 :          1 :     OutRate = (int)document->GetAttributeValueAsNumber("rate");
     988                 :            :   } else {
     989                 :          0 :     OutRate = 1;
     990                 :            :   }
     991                 :            : 
     992         [ -  + ]:          1 :   if (document->FindElementValue("simulation") == string("ON"))
     993                 :          0 :     SubSystems += ssSimulation;
     994         [ -  + ]:          1 :   if (document->FindElementValue("aerosurfaces") == string("ON"))
     995                 :          0 :     SubSystems += ssAerosurfaces;
     996         [ +  - ]:          1 :   if (document->FindElementValue("rates") == string("ON"))
     997                 :          1 :     SubSystems += ssRates;
     998         [ +  - ]:          1 :   if (document->FindElementValue("velocities") == string("ON"))
     999                 :          1 :     SubSystems += ssVelocities;
    1000         [ +  - ]:          1 :   if (document->FindElementValue("forces") == string("ON"))
    1001                 :          1 :     SubSystems += ssForces;
    1002         [ +  - ]:          1 :   if (document->FindElementValue("moments") == string("ON"))
    1003                 :          1 :     SubSystems += ssMoments;
    1004         [ +  - ]:          1 :   if (document->FindElementValue("atmosphere") == string("ON"))
    1005                 :          1 :     SubSystems += ssAtmosphere;
    1006         [ +  - ]:          1 :   if (document->FindElementValue("massprops") == string("ON"))
    1007                 :          1 :     SubSystems += ssMassProps;
    1008         [ +  - ]:          1 :   if (document->FindElementValue("position") == string("ON"))
    1009                 :          1 :     SubSystems += ssPropagate;
    1010         [ -  + ]:          1 :   if (document->FindElementValue("coefficients") == string("ON"))
    1011                 :          0 :     SubSystems += ssCoefficients;
    1012         [ -  + ]:          1 :   if (document->FindElementValue("ground_reactions") == string("ON"))
    1013                 :          0 :     SubSystems += ssGroundReactions;
    1014         [ +  - ]:          1 :   if (document->FindElementValue("fcs") == string("ON"))
    1015                 :          1 :     SubSystems += ssFCS;
    1016         [ +  - ]:          1 :   if (document->FindElementValue("propulsion") == string("ON"))
    1017                 :          1 :     SubSystems += ssPropulsion;
    1018                 :          1 :   property_element = document->FindElement("property");
    1019         [ -  + ]:          1 :   while (property_element) {
    1020                 :          0 :     string property_str = property_element->GetDataLine();
    1021                 :          0 :     FGPropertyManager* node = PropertyManager->GetNode(property_str);
    1022         [ #  # ]:          0 :     if (!node) {
    1023                 :            :       cerr << fgred << highint << endl << "  No property by the name "
    1024                 :            :            << property_str << " has been defined. This property will " << endl
    1025                 :            :            << "  not be logged. You should check your configuration file."
    1026                 :          0 :            << reset << endl;
    1027                 :            :     } else {
    1028                 :          0 :       OutputProperties.push_back(node);
    1029                 :            :     }
    1030                 :          0 :     property_element = document->FindNextElement("property");
    1031                 :            :   }
    1032                 :            : 
    1033                 :          1 :   SetRate(OutRate);
    1034                 :            : 
    1035                 :          1 :   Debug(2);
    1036                 :            : 
    1037                 :          1 :   return true;
    1038                 :            : }
    1039                 :            : 
    1040                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1041                 :            : 
    1042                 :          2 : void FGOutput::SetRate(int rtHz)
    1043                 :            : {
    1044         [ +  - ]:          2 :   rtHz = rtHz>1000?1000:(rtHz<0?0:rtHz);
    1045         [ +  - ]:          2 :   if (rtHz > 0) {
    1046                 :          4 :     rate = (int)(0.5 + 1.0/(FDMExec->GetDeltaT()*rtHz));
    1047                 :            :     Enable();
    1048                 :            :   } else {
    1049                 :          0 :     rate = 1;
    1050                 :            :     Disable();
    1051                 :            :   }
    1052                 :          2 : }
    1053                 :            : 
    1054                 :            : //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1055                 :            : //    The bitmasked value choices are as follows:
    1056                 :            : //    unset: In this case (the default) JSBSim would only print
    1057                 :            : //       out the normally expected messages, essentially echoing
    1058                 :            : //       the config files as they are read. If the environment
    1059                 :            : //       variable is not set, debug_lvl is set to 1 internally
    1060                 :            : //    0: This requests JSBSim not to output any messages
    1061                 :            : //       whatsoever.
    1062                 :            : //    1: This value explicity requests the normal JSBSim
    1063                 :            : //       startup messages
    1064                 :            : //    2: This value asks for a message to be printed out when
    1065                 :            : //       a class is instantiated
    1066                 :            : //    4: When this value is set, a message is displayed when a
    1067                 :            : //       FGModel object executes its Run() method
    1068                 :            : //    8: When this value is set, various runtime state variables
    1069                 :            : //       are printed out periodically
    1070                 :            : //    16: When set various parameters are sanity checked and
    1071                 :            : //       a message is printed out when they go out of bounds
    1072                 :            : 
    1073                 :          3 : void FGOutput::Debug(int from)
    1074                 :            : {
    1075                 :          3 :   string scratch="";
    1076                 :            : 
    1077         [ +  - ]:          3 :   if (debug_lvl <= 0) return;
    1078                 :            : 
    1079         [ +  - ]:          3 :   if (debug_lvl & 1) { // Standard console startup message output
    1080                 :            :     if (from == 0) { // Constructor
    1081                 :            : 
    1082                 :            :     }
    1083         [ +  + ]:          3 :     if (from == 2) {
    1084         [ +  - ]:          1 :       if (output_file_name.empty())
    1085                 :          1 :         cout << "  " << "Output parameters read inline" << endl;
    1086                 :            :       else
    1087                 :          0 :         cout << "    Output parameters read from file: " << output_file_name << endl;
    1088                 :            : 
    1089   [ +  -  -  + ]:          2 :       if (Filename == "cout" || Filename == "COUT") {
                 [ -  + ]
    1090                 :            :         scratch = "    Log output goes to screen console";
    1091         [ +  - ]:          1 :       } else if (!Filename.empty()) {
    1092                 :          2 :         scratch = "    Log output goes to file: " + Filename;
    1093                 :            :       }
    1094         [ +  - ]:          1 :       switch (Type) {
    1095                 :            :       case otCSV:
    1096                 :          2 :         cout << scratch << " in CSV format output at rate " << 1/(FDMExec->GetDeltaT()*rate) << " Hz" << endl;
    1097                 :            :         break;
    1098                 :            :       case otNone:
    1099                 :            :       default:
    1100                 :          0 :         cout << "  No log output" << endl;
    1101                 :            :         break;
    1102                 :            :       }
    1103                 :            : 
    1104         [ -  + ]:          1 :       if (SubSystems & ssSimulation)      cout << "    Simulation parameters logged" << endl;
    1105         [ -  + ]:          1 :       if (SubSystems & ssAerosurfaces)    cout << "    Aerosurface parameters logged" << endl;
    1106         [ +  - ]:          1 :       if (SubSystems & ssRates)           cout << "    Rate parameters logged" << endl;
    1107         [ +  - ]:          1 :       if (SubSystems & ssVelocities)      cout << "    Velocity parameters logged" << endl;
    1108         [ +  - ]:          1 :       if (SubSystems & ssForces)          cout << "    Force parameters logged" << endl;
    1109         [ +  - ]:          1 :       if (SubSystems & ssMoments)         cout << "    Moments parameters logged" << endl;
    1110         [ +  - ]:          1 :       if (SubSystems & ssAtmosphere)      cout << "    Atmosphere parameters logged" << endl;
    1111         [ +  - ]:          1 :       if (SubSystems & ssMassProps)       cout << "    Mass parameters logged" << endl;
    1112         [ -  + ]:          1 :       if (SubSystems & ssCoefficients)    cout << "    Coefficient parameters logged" << endl;
    1113         [ +  - ]:          1 :       if (SubSystems & ssPropagate)       cout << "    Propagate parameters logged" << endl;
    1114         [ -  + ]:          1 :       if (SubSystems & ssGroundReactions) cout << "    Ground parameters logged" << endl;
    1115         [ +  - ]:          1 :       if (SubSystems & ssFCS)             cout << "    FCS parameters logged" << endl;
    1116         [ +  - ]:          1 :       if (SubSystems & ssPropulsion)      cout << "    Propulsion parameters logged" << endl;
    1117         [ -  + ]:          1 :       if (OutputProperties.size() > 0)    cout << "    Properties logged:" << endl;
    1118         [ -  + ]:          1 :       for (unsigned int i=0;i<OutputProperties.size();i++) {
    1119                 :          0 :         cout << "      - " << OutputProperties[i]->GetName() << endl;
    1120                 :            :       }
    1121                 :            :     }
    1122                 :            :   }
    1123         [ -  + ]:          3 :   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
    1124         [ #  # ]:          0 :     if (from == 0) cout << "Instantiated: FGOutput" << endl;
    1125         [ #  # ]:          0 :     if (from == 1) cout << "Destroyed:    FGOutput" << endl;
    1126                 :            :   }
    1127                 :          3 :   if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
    1128                 :            :   }
    1129                 :          3 :   if (debug_lvl & 8 ) { // Runtime state variables
    1130                 :            :   }
    1131                 :          3 :   if (debug_lvl & 16) { // Sanity checking
    1132                 :            :   }
    1133         [ -  + ]:          3 :   if (debug_lvl & 64) {
    1134         [ #  # ]:          0 :     if (from == 0) { // Constructor
    1135                 :          0 :       cout << IdSrc << endl;
    1136                 :          0 :       cout << IdHdr << endl;
    1137                 :            :     }
    1138                 :          3 :   }
    1139                 :            : }
    1140 [ +  + ][ +  - ]:         12 : }

Generated by: LCOV version 1.9