JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
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 FORWARD DECLARATIONS
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46 
47 namespace JSBSim {
48 
49 class FGFDMExec;
50 class Element;
51 class FGAerodynamics;
52 class FGAuxiliary;
53 class FGAircraft;
54 class FGAtmosphere;
55 class FGWinds;
56 class FGPropulsion;
57 class FGMassBalance;
58 class FGPropagate;
59 class FGAccelerations;
60 class FGFCS;
61 class FGGroundReactions;
62 class FGExternalReactions;
63 class FGBuoyantForces;
64 class FGPropertyValue;
65 
66 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 CLASS DOCUMENTATION
68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
69 
86 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87 CLASS DECLARATION
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
89 
90 class FGOutputType : public FGModel
91 {
92 public:
96  FGOutputType(FGFDMExec* fdmex);
97 
99  ~FGOutputType() override;
100 
104  void SetIdx(unsigned int idx);
105 
108  void SetRateHz(double rtHz);
109 
111  double GetRateHz(void) const;
112 
117  void SetSubSystems(int subSystems) { SubSystems = subSystems; }
118 
122  void SetOutputProperties(std::vector<FGPropertyNode_ptr> & outputProperties);
123 
129  virtual void SetOutputName(const std::string& name) { Name = name; }
130 
133  virtual const std::string& GetOutputName(void) const { return Name; }
134 
138  bool Load(Element* el) override;
139 
141  bool InitModel(void) override;
142 
149  bool Run(void);
150 
155  virtual void Print(void) = 0;
156 
163  virtual void SetStartNewOutput(void) {}
164 
166  void Enable(void) { enabled = true; }
168  void Disable(void) { enabled = false; }
172  bool Toggle(void) {enabled = !enabled; return enabled;}
173 
189  } subsystems;
190 
191 protected:
192  unsigned int OutputIdx;
193  int SubSystems;
194  std::vector <FGPropertyValue*> OutputParameters;
195  std::vector <std::string> OutputCaptions;
196  bool enabled;
197 
198  FGAerodynamics* Aerodynamics;
199  FGAuxiliary* Auxiliary;
200  FGAircraft* Aircraft;
201  FGAtmosphere* Atmosphere;
202  FGWinds* Winds;
203  FGPropulsion* Propulsion;
204  FGMassBalance* MassBalance;
205  FGPropagate* Propagate;
206  FGAccelerations* Accelerations;
207  FGFCS* FCS;
208  FGGroundReactions* GroundReactions;
209  FGExternalReactions* ExternalReactions;
210  FGBuoyantForces* BuoyantForces;
211 
212  void Debug(int from) override;
213 };
214 }
215 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 #endif
JSBSim::FGOutputType::ssMoments
@ ssMoments
Subsystem: Moments (= 32)
Definition: FGOutputType.h:181
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGOutputType
Abstract class to provide functions generic to all the output directives.
Definition: FGOutputType.h:90
JSBSim::FGOutputType::ssAeroFunctions
@ ssAeroFunctions
Subsystem: Coefficients (= 256)
Definition: FGOutputType.h:184
JSBSim::FGOutputType::GetRateHz
double GetRateHz(void) const
Get the output rate in Hz for this output.
Definition: FGOutputType.cpp:218
JSBSim::FGAerodynamics
Encapsulates the aerodynamic calculations.
Definition: FGAerodynamics.h:113
JSBSim::FGExternalReactions
Manages the external and/or arbitrary forces and moments.
Definition: FGExternalReactions.h:121
JSBSim::FGOutputType::Enable
void Enable(void)
Enables the output generation.
Definition: FGOutputType.h:166
JSBSim::FGModel
Base class for all scheduled JSBSim models.
Definition: FGModel.h:68
JSBSim::FGOutputType::eSubSystems
eSubSystems
Subsystem types for specifying which will be output in the FDM data logging.
Definition: FGOutputType.h:175
JSBSim::FGOutputType::GetOutputName
virtual const std::string & GetOutputName(void) const
Get the name identifier to which the output will be directed.
Definition: FGOutputType.h:133
JSBSim::FGOutputType::Print
virtual void Print(void)=0
Generate the output.
JSBSim::FGMassBalance
Models weight, balance and moment of inertia information.
Definition: FGMassBalance.h:122
JSBSim::FGOutputType::ssAtmosphere
@ ssAtmosphere
Subsystem: Atmosphere (= 64)
Definition: FGOutputType.h:182
JSBSim::FGOutputType::Disable
void Disable(void)
Disables the output generation.
Definition: FGOutputType.h:168
JSBSim::FGOutputType::InitModel
bool InitModel(void) override
Init the output model according to its configitation.
Definition: FGOutputType.cpp:178
JSBSim::FGOutputType::FGOutputType
FGOutputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
Definition: FGOutputType.cpp:57
JSBSim::FGOutputType::ssPropagate
@ ssPropagate
Subsystem: Propagate (= 512)
Definition: FGOutputType.h:185
JSBSim::FGOutputType::SetIdx
void SetIdx(unsigned int idx)
Set the idx for this output instance.
Definition: FGOutputType.cpp:91
JSBSim::FGOutputType::SetSubSystems
void SetSubSystems(int subSystems)
Set the activated subsystems for this output instance.
Definition: FGOutputType.h:117
JSBSim::FGOutputType::ssMassProps
@ ssMassProps
Subsystem: Mass Properties (= 128)
Definition: FGOutputType.h:183
JSBSim::FGOutputType::SetOutputProperties
void SetOutputProperties(std::vector< FGPropertyNode_ptr > &outputProperties)
Set the list of properties that should be output for this output instance.
Definition: FGOutputType.cpp:225
JSBSim::FGAtmosphere
Models an empty, abstract base atmosphere class.
Definition: FGAtmosphere.h:76
JSBSim::FGOutputType::ssRates
@ ssRates
Subsystem: Body rates (= 4)
Definition: FGOutputType.h:178
JSBSim::FGOutputType::ssForces
@ ssForces
Subsystem: Forces (= 16)
Definition: FGOutputType.h:180
JSBSim::FGPropagate
Models the EOM and integration/propagation of state.
Definition: FGPropagate.h:93
JSBSim::FGOutputType::ssFCS
@ ssFCS
Subsystem: FCS (= 2048)
Definition: FGOutputType.h:187
JSBSim::FGOutputType::ssPropulsion
@ ssPropulsion
Subsystem: Propulsion (= 4096)
Definition: FGOutputType.h:188
JSBSim::FGGroundReactions
Manages ground reactions modeling.
Definition: FGGroundReactions.h:79
JSBSim::FGOutputType::~FGOutputType
~FGOutputType() override
Destructor.
Definition: FGOutputType.cpp:81
JSBSim::FGAccelerations
Handles the calculation of accelerations.
Definition: FGAccelerations.h:95
JSBSim::FGOutputType::ssAerosurfaces
@ ssAerosurfaces
Subsystem: Aerosurfaces (= 2)
Definition: FGOutputType.h:177
JSBSim::FGAircraft
Encapsulates an Aircraft and its systems.
Definition: FGAircraft.h:102
JSBSim::FGOutputType::ssGroundReactions
@ ssGroundReactions
Subsystem: Ground Reactions (= 1024)
Definition: FGOutputType.h:186
JSBSim::FGFCS
Encapsulates the Flight Control System (FCS) functionality.
Definition: FGFCS.h:187
JSBSim::FGPropulsion
Propulsion management class.
Definition: FGPropulsion.h:99
JSBSim::FGOutputType::SetOutputName
virtual void SetOutputName(const std::string &name)
Overwrites the name identifier under which the output will be logged.
Definition: FGOutputType.h:129
JSBSim::FGOutputType::Toggle
bool Toggle(void)
Toggles the output generation.
Definition: FGOutputType.h:172
JSBSim::FGOutputType::ssSimulation
@ ssSimulation
Subsystem: Simulation (= 1)
Definition: FGOutputType.h:176
JSBSim::FGOutputType::SetRateHz
void SetRateHz(double rtHz)
Set the output rate for this output instances.
Definition: FGOutputType.cpp:204
JSBSim::FGOutputType::Run
bool Run(void)
Executes the output directives (implement the FGModel interface).
Definition: FGOutputType.cpp:188
JSBSim::FGAuxiliary
Encapsulates various uncategorized scheduled functions.
Definition: FGAuxiliary.h:100
JSBSim::FGOutputType::SetStartNewOutput
virtual void SetStartNewOutput(void)
Reset the output prior to a restart of the simulation.
Definition: FGOutputType.h:163
JSBSim::FGWinds
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
Definition: FGWinds.h:166
JSBSim::FGOutputType::Load
bool Load(Element *el) override
Init the output directives from an XML file (implement the FGModel interface).
Definition: FGOutputType.cpp:102
JSBSim::FGBuoyantForces
Encapsulates the Buoyant forces calculations.
Definition: FGBuoyantForces.h:98
JSBSim::FGOutputType::ssVelocities
@ ssVelocities
Subsystem: Velocities (= 8)
Definition: FGOutputType.h:179
JSBSim::Element
Definition: FGXMLElement.h:143