]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGOutput.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGOutput.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGOutput.h
4  Author:       Jon Berndt
5  Date started: 12/2/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/02/98   JSB   Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGOUTPUT_H
35 #define FGOUTPUT_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #include "FGModel.h"
42
43 #ifdef FGFS
44 #  include <simgear/compiler.h>
45 #  include STL_IOSTREAM
46 #  include STL_FSTREAM
47 #else
48 #  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
49 #    include <iostream.h>
50 #    include <fstream.h>
51 #  else
52 #    include <iostream>
53 #    include <fstream>
54 #  endif
55 #endif
56
57 #include "FGfdmSocket.h"
58
59 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 DEFINITIONS
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
62
63 #define ID_OUTPUT "$Id$"
64
65 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 FORWARD DECLARATIONS
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
68
69 namespace JSBSim {
70
71 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 CLASS DOCUMENTATION
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
74
75 /** Handles simulation output.
76     OUTPUT section definition
77
78     The following specifies the way that JSBSim writes out data.
79
80     NAME is the filename you want the output to go to
81
82     TYPE can be:
83       CSV       Comma separated data. If a filename is supplied then the data
84                 goes to that file. If COUT or cout is specified, the data goes
85                 to stdout. If the filename is a null filename the data goes to
86                 stdout, as well.
87       SOCKET    Will eventually send data to a socket output, where NAME
88                 would then be the IP address of the machine the data should be
89                 sent to. DON'T USE THIS YET!
90       TABULAR   Columnar data. NOT IMPLEMENTED YET!
91       TERMINAL  Output to terminal. NOT IMPLEMENTED YET!
92       NONE      Specifies to do nothing. THis setting makes it easy to turn on and
93                 off the data output without having to mess with anything else.
94
95     The arguments that can be supplied, currently, are
96
97     RATE_IN_HZ  An integer rate in times-per-second that the data is output. This
98                 value may not be *exactly* what you want, due to the dependence
99                 on dt, the cycle rate for the FDM.
100
101     The following parameters tell which subsystems of data to output:
102
103     SIMULATION       ON|OFF
104     ATMOSPHERE       ON|OFF
105     MASSPROPS        ON|OFF
106     AEROSURFACES     ON|OFF
107     RATES            ON|OFF
108     VELOCITIES       ON|OFF
109     FORCES           ON|OFF
110     MOMENTS          ON|OFF
111     POSITION         ON|OFF
112     COEFFICIENTS     ON|OFF
113     GROUND_REACTIONS ON|OFF
114     FCS              ON|OFF
115     PROPULSION       ON|OFF
116
117     NOTE that Time is always output with the data.
118     @version $Id$
119  */
120
121 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
122 CLASS DECLARATION
123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
124
125 class FGOutput : public FGModel
126 {
127 public:
128   FGOutput(FGFDMExec*);
129   ~FGOutput();
130
131   bool Run(void);
132
133   void DelimitedOutput(string);
134   void SocketOutput(void);
135   void SocketStatusOutput(string);
136   void SetFilename(string fn) {Filename = fn;}
137   void SetType(string);
138   void SetSubsystems(int tt) {SubSystems = tt;}
139   inline void Enable(void) { enabled = true; }
140   inline void Disable(void) { enabled = false; }
141   inline bool Toggle(void) {enabled = !enabled; return enabled;}
142   bool Load(FGConfigFile* AC_cfg);
143
144   /// Subsystem types for specifying which will be output in the FDM data logging
145   enum  eSubSystems {
146     /** Subsystem: Simulation (= 1)          */ ssSimulation      = 1,
147     /** Subsystem: Aerosurfaces (= 2)        */ ssAerosurfaces    = 2,
148     /** Subsystem: Body rates (= 4)          */ ssRates           = 4,
149     /** Subsystem: Velocities (= 8)          */ ssVelocities      = 8,
150     /** Subsystem: Forces (= 16)             */ ssForces          = 16,
151     /** Subsystem: Moments (= 32)            */ ssMoments         = 32,
152     /** Subsystem: Atmosphere (= 64)         */ ssAtmosphere      = 64,
153     /** Subsystem: Mass Properties (= 128)   */ ssMassProps       = 128,
154     /** Subsystem: Coefficients (= 256)      */ ssCoefficients    = 256,
155     /** Subsystem: Propagate (= 512)         */ ssPropagate       = 512,
156     /** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024,
157     /** Subsystem: FCS (= 2048)              */ ssFCS             = 2048,
158     /** Subsystem: Propulsion (= 4096)       */ ssPropulsion      = 4096
159   } subsystems;
160
161 private:
162   bool sFirstPass, dFirstPass, enabled;
163   int SubSystems;
164   string Filename, outputInFileName, delimeter;
165   enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
166   ofstream datafile;
167   FGfdmSocket* socket;
168   vector <FGPropertyManager*> OutputProperties;
169   void Debug(int from);
170 };
171 }
172 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173 #endif
174