FlightGear next
FGOutputType.h
Go to the documentation of this file.
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
26HISTORY
27--------------------------------------------------------------------------------
2809/10/11 BC Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGOUTPUTTYPE_H
35#define FGOUTPUTTYPE_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include "models/FGModel.h"
42
43/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44FORWARD DECLARATIONS
45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46
47namespace JSBSim {
48
49class FGFDMExec;
50class Element;
51class FGAerodynamics;
52class FGAuxiliary;
53class FGAircraft;
54class FGAtmosphere;
55class FGWinds;
56class FGPropulsion;
57class FGMassBalance;
58class FGPropagate;
59class FGAccelerations;
60class FGFCS;
63class FGBuoyantForces;
64class FGPropertyValue;
65
66/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67CLASS DOCUMENTATION
68%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
69
85
86/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87CLASS DECLARATION
88%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
89
90class FGOutputType : public FGModel
91{
92public:
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
162
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
190
191protected:
192 unsigned int OutputIdx;
194 std::vector <FGPropertyValue*> OutputParameters;
195 std::vector <std::string> OutputCaptions;
197
211
212 void Debug(int from) override;
213};
214}
215//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216#endif
Encapsulates the aerodynamic calculations.
Encapsulates an Aircraft and its systems.
Definition FGAircraft.h:102
Encapsulates various uncategorized scheduled functions.
Encapsulates the Buoyant forces calculations.
Manages the external and/or arbitrary forces and moments.
Manages ground reactions modeling.
Models weight, balance and moment of inertia information.
FGModel(FGFDMExec *)
Constructor.
Definition FGModel.cpp:57
std::string Name
Definition FGModel.h:103
eSubSystems
Subsystem types for specifying which will be output in the FDM data logging.
@ ssGroundReactions
Subsystem: Ground Reactions (= 1024)
@ ssMoments
Subsystem: Moments (= 32)
@ ssPropagate
Subsystem: Propagate (= 512)
@ ssPropulsion
Subsystem: Propulsion (= 4096)
@ ssSimulation
Subsystem: Simulation (= 1)
@ ssForces
Subsystem: Forces (= 16)
@ ssAerosurfaces
Subsystem: Aerosurfaces (= 2)
@ ssMassProps
Subsystem: Mass Properties (= 128)
@ ssFCS
Subsystem: FCS (= 2048)
@ ssRates
Subsystem: Body rates (= 4)
@ ssAtmosphere
Subsystem: Atmosphere (= 64)
@ ssAeroFunctions
Subsystem: Coefficients (= 256)
@ ssVelocities
Subsystem: Velocities (= 8)
virtual void SetOutputName(const std::string &name)
Overwrites the name identifier under which the output will be logged.
void SetSubSystems(int subSystems)
Set the activated subsystems for this output instance.
FGGroundReactions * GroundReactions
bool Toggle(void)
Toggles the output generation.
FGAircraft * Aircraft
std::vector< FGPropertyValue * > OutputParameters
void Disable(void)
Disables the output generation.
unsigned int OutputIdx
FGAccelerations * Accelerations
FGPropulsion * Propulsion
void SetOutputProperties(std::vector< FGPropertyNode_ptr > &outputProperties)
Set the list of properties that should be output for this output instance.
FGAuxiliary * Auxiliary
FGOutputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
FGPropagate * Propagate
FGExternalReactions * ExternalReactions
void SetIdx(unsigned int idx)
Set the idx for this output instance.
FGAtmosphere * Atmosphere
virtual const std::string & GetOutputName(void) const
Get the name identifier to which the output will be directed.
~FGOutputType() override
Destructor.
bool Run(void)
Executes the output directives (implement the FGModel interface).
virtual void SetStartNewOutput(void)
Reset the output prior to a restart of the simulation.
void SetRateHz(double rtHz)
Set the output rate for this output instances.
FGMassBalance * MassBalance
std::vector< std::string > OutputCaptions
enum JSBSim::FGOutputType::eSubSystems subsystems
bool Load(Element *el) override
Init the output directives from an XML file (implement the FGModel interface).
FGAerodynamics * Aerodynamics
void Debug(int from) override
virtual void Print(void)=0
Generate the output.
double GetRateHz(void) const
Get the output rate in Hz for this output.
bool InitModel(void) override
Init the output model according to its configitation.
FGBuoyantForces * BuoyantForces
void Enable(void)
Enables the output generation.
Models the EOM and integration/propagation of state.
Definition FGPropagate.h:93
Represents a property value which can use late binding.
Propulsion management class.
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
Definition FGWinds.h:166
const char * name