JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGOutputType.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGOutputType.h
4  Author: Bertrand Coconnier
5  Date started: 09/10/11
6 
7  ------------- Copyright (C) 2011 Bertrand Coconnier -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser 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 Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser 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 Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 09/10/11 BC Created
29 
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 
34 #ifndef FGOUTPUTTYPE_H
35 #define FGOUTPUTTYPE_H
36 
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40 
41 #include "models/FGModel.h"
42 
43 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44 DEFINITIONS
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46 
47 #define ID_OUTPUTTYPE "$Id: FGOutputType.h,v 1.11 2015/08/23 09:43:31 bcoconni Exp $"
48 
49 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 FORWARD DECLARATIONS
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52 
53 namespace JSBSim {
54 
55 class FGFDMExec;
56 class Element;
57 class FGAerodynamics;
58 class FGAuxiliary;
59 class FGAircraft;
60 class FGAtmosphere;
61 class FGWinds;
62 class FGPropulsion;
63 class FGMassBalance;
64 class FGPropagate;
65 class FGAccelerations;
66 class FGFCS;
67 class FGGroundReactions;
68 class FGExternalReactions;
69 class FGBuoyantForces;
70 
71 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 CLASS DOCUMENTATION
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
74 
91 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92 CLASS DECLARATION
93 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
94 
95 class FGOutputType : public FGModel
96 {
97 public:
101  FGOutputType(FGFDMExec* fdmex);
102 
104  virtual ~FGOutputType();
105 
109  void SetIdx(unsigned int idx);
110 
113  void SetRateHz(double rtHz);
114 
116  double GetRateHz(void) const;
117 
122  void SetSubSystems(int subSystems) { SubSystems = subSystems; }
123 
127  void SetOutputProperties(std::vector<FGPropertyNode_ptr> & outputProperties)
128  {
129  OutputProperties = outputProperties;
130  }
131 
137  virtual void SetOutputName(const std::string& name) { Name = name; }
138 
141  virtual const std::string& GetOutputName(void) const { return Name; }
142 
146  virtual bool Load(Element* el);
147 
149  virtual bool InitModel(void);
150 
157  bool Run(void);
158 
163  virtual void Print(void) = 0;
164 
171  virtual void SetStartNewOutput(void) {}
172 
174  void Enable(void) { enabled = true; }
176  void Disable(void) { enabled = false; }
180  bool Toggle(void) {enabled = !enabled; return enabled;}
181 
197  } subsystems;
198 
199 protected:
200  unsigned int OutputIdx;
201  int SubSystems;
202  std::vector <FGPropertyNode_ptr> OutputProperties;
203  std::vector <std::string> OutputCaptions;
204  bool enabled;
205 
206  FGAerodynamics* Aerodynamics;
207  FGAuxiliary* Auxiliary;
208  FGAircraft* Aircraft;
209  FGAtmosphere* Atmosphere;
210  FGWinds* Winds;
211  FGPropulsion* Propulsion;
212  FGMassBalance* MassBalance;
213  FGPropagate* Propagate;
214  FGAccelerations* Accelerations;
215  FGFCS* FCS;
216  FGGroundReactions* GroundReactions;
217  FGExternalReactions* ExternalReactions;
218  FGBuoyantForces* BuoyantForces;
219 
220  void Debug(int from);
221 };
222 }
223 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224 #endif
Subsystem: Propagate (= 512)
Definition: FGOutputType.h:193
Encapsulates an Aircraft and its systems.
Definition: FGAircraft.h:110
void SetSubSystems(int subSystems)
Set the activated subsystems for this output instance.
Definition: FGOutputType.h:122
Encapsulates the Buoyant forces calculations.
eSubSystems
Subsystem types for specifying which will be output in the FDM data logging.
Definition: FGOutputType.h:183
virtual bool InitModel(void)
Init the output model according to its configitation.
Encapsulates the aerodynamic calculations.
Subsystem: Aerosurfaces (= 2)
Definition: FGOutputType.h:185
Subsystem: Simulation (= 1)
Definition: FGOutputType.h:184
virtual void Print(void)=0
Generate the output.
void SetOutputProperties(std::vector< FGPropertyNode_ptr > &outputProperties)
Set the list of properties that should be output for this output instance.
Definition: FGOutputType.h:127
Subsystem: Velocities (= 8)
Definition: FGOutputType.h:187
bool Toggle(void)
Toggles the output generation.
Definition: FGOutputType.h:180
double GetRateHz(void) const
Get the output rate in Hz for this output.
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
Definition: FGWinds.h:119
void SetRateHz(double rtHz)
Set the output rate for this output instances.
void Enable(void)
Enables the output generation.
Definition: FGOutputType.h:174
Models the EOM and integration/propagation of state.
Definition: FGPropagate.h:102
Subsystem: Atmosphere (= 64)
Definition: FGOutputType.h:190
Propulsion management class.
Definition: FGPropulsion.h:106
Base class for all scheduled JSBSim models.
Definition: FGModel.h:74
virtual bool Load(Element *el)
Init the output directives from an XML file (implement the FGModel interface).
bool Run(void)
Executes the output directives (implement the FGModel interface).
FGOutputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
Subsystem: Moments (= 32)
Definition: FGOutputType.h:189
Models an empty, abstract base atmosphere class.
Definition: FGAtmosphere.h:84
Abstract class to provide functions generic to all the output directives.
Definition: FGOutputType.h:95
Encapsulates the Flight Control System (FCS) functionality.
Definition: FGFCS.h:193
virtual void SetOutputName(const std::string &name)
Overwrites the name identifier under which the output will be logged.
Definition: FGOutputType.h:137
Manages ground reactions modeling.
void SetIdx(unsigned int idx)
Set the idx for this output instance.
Handles the calculation of accelerations.
Encapsulates various uncategorized scheduled functions.
Definition: FGAuxiliary.h:109
Subsystem: Ground Reactions (= 1024)
Definition: FGOutputType.h:194
Subsystem: FCS (= 2048)
Definition: FGOutputType.h:195
Subsystem: Mass Properties (= 128)
Definition: FGOutputType.h:191
virtual ~FGOutputType()
Destructor.
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189
Subsystem: Body rates (= 4)
Definition: FGOutputType.h:186
Subsystem: Forces (= 16)
Definition: FGOutputType.h:188
virtual const std::string & GetOutputName(void) const
Get the name identifier to which the output will be directed.
Definition: FGOutputType.h:141
Subsystem: Coefficients (= 256)
Definition: FGOutputType.h:192
Models weight, balance and moment of inertia information.
Subsystem: Propulsion (= 4096)
Definition: FGOutputType.h:196
virtual void SetStartNewOutput(void)
Reset the output prior to a restart of the simulation.
Definition: FGOutputType.h:171
void Disable(void)
Disables the output generation.
Definition: FGOutputType.h:176
Manages the external and/or arbitrary forces.