FlightGear next
FGAircraft.h
Go to the documentation of this file.
1/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3 Header: FGAircraft.h
4 Author: Jon S. Berndt
5 Date started: 12/12/98
6
7 ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) -------------
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
11 Software Foundation; either version 2 of the License, or (at your option) any
12 later 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
20 with this program; if not, write to the Free Software Foundation, Inc., 59
21 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 Further information about the GNU Lesser General Public License can also be
24 found on the world wide web at http://www.gnu.org.
25
26HISTORY
27--------------------------------------------------------------------------------
2812/12/98 JSB Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGAIRCRAFT_H
35#define FGAIRCRAFT_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include <string>
42
43#include "FGModel.h"
44#include "math/FGMatrix33.h"
45
46/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47FORWARD DECLARATIONS
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49
50namespace JSBSim {
51
52/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53CLASS DOCUMENTATION
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55
97
98/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99CLASS DECLARATION
100%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
101
102class FGAircraft : public FGModel {
103public:
106 FGAircraft(FGFDMExec *Executive);
107
109 ~FGAircraft() override;
110
119 bool Run(bool Holding) override;
120
121 bool InitModel(void) override;
122
127 bool Load(Element* el) override;
128
131 const std::string& GetAircraftName(void) const { return AircraftName; }
132
134 double GetWingArea(void) const { return WingArea; }
136 double GetWingSpan(void) const { return WingSpan; }
138 double Getcbar(void) const { return cbar; }
139 double GetWingIncidence(void) const { return WingIncidence; }
140 double GetWingIncidenceDeg(void) const { return WingIncidence*radtodeg; }
141 double GetHTailArea(void) const { return HTailArea; }
142 double GetHTailArm(void) const { return HTailArm; }
143 double GetVTailArea(void) const { return VTailArea; }
144 double GetVTailArm(void) const { return VTailArm; }
145 double Getlbarh(void) const { return lbarh; } // HTailArm / cbar
146 double Getlbarv(void) const { return lbarv; } // VTailArm / cbar
147 double Getvbarh(void) const { return vbarh; } // H. Tail Volume
148 double Getvbarv(void) const { return vbarv; } // V. Tail Volume
149 const FGColumnVector3& GetMoments(void) const { return vMoments; }
150 double GetMoments(int idx) const { return vMoments(idx); }
151 const FGColumnVector3& GetForces(void) const { return vForces; }
152 double GetForces(int idx) const { return vForces(idx); }
155 const FGColumnVector3& GetXYZrp(void) const { return vXYZrp; }
156 const FGColumnVector3& GetXYZvrp(void) const { return vXYZvrp; }
157 const FGColumnVector3& GetXYZep(void) const { return vXYZep; }
158 double GetXYZrp(int idx) const { return vXYZrp(idx); }
159 double GetXYZvrp(int idx) const { return vXYZvrp(idx); }
160 double GetXYZep(int idx) const { return vXYZep(idx); }
161 void SetAircraftName(const std::string& name) {AircraftName = name;}
162
163 void SetXYZrp(int idx, double value) {vXYZrp(idx) = value;}
164
165 void SetWingArea(double S) {WingArea = S;}
166
179
180private:
181 FGColumnVector3 vMoments;
182 FGColumnVector3 vForces;
183 FGColumnVector3 vXYZrp;
184 FGColumnVector3 vXYZvrp;
185 FGColumnVector3 vXYZep;
186 FGColumnVector3 vDXYZcg;
187
188 double WingArea, WingSpan, cbar, WingIncidence;
189 double HTailArea, VTailArea, HTailArm, VTailArm;
190 double lbarh,lbarv,vbarh,vbarv;
191 std::string AircraftName;
192
193 void bind(void);
194 void unbind(void);
195 void Debug(int from) override;
196};
197
198} // namespace JSBSim
199//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
200#endif
string AircraftName
Definition JSBSim.cpp:82
double GetXYZep(int idx) const
Definition FGAircraft.h:160
bool Run(bool Holding) override
Runs the Aircraft model; called by the Executive Can pass in a value indicating if the executive is d...
double GetXYZvrp(int idx) const
Definition FGAircraft.h:159
const FGColumnVector3 & GetMoments(void) const
Definition FGAircraft.h:149
const FGColumnVector3 & GetForces(void) const
Definition FGAircraft.h:151
double Getcbar(void) const
Gets the average wing chord.
Definition FGAircraft.h:138
const FGColumnVector3 & GetXYZrp(void) const
Gets the the aero reference point (RP) coordinates.
Definition FGAircraft.h:155
double GetHTailArea(void) const
Definition FGAircraft.h:141
const std::string & GetAircraftName(void) const
Gets the aircraft name.
Definition FGAircraft.h:131
const FGColumnVector3 & GetXYZep(void) const
Definition FGAircraft.h:157
double GetVTailArm(void) const
Definition FGAircraft.h:144
FGAircraft(FGFDMExec *Executive)
Constructor.
~FGAircraft() override
Destructor.
double GetForces(int idx) const
Definition FGAircraft.h:152
void SetWingArea(double S)
Definition FGAircraft.h:165
void SetAircraftName(const std::string &name)
Definition FGAircraft.h:161
double GetWingIncidence(void) const
Definition FGAircraft.h:139
double GetVTailArea(void) const
Definition FGAircraft.h:143
struct JSBSim::FGAircraft::Inputs in
double GetWingArea(void) const
Gets the wing area.
Definition FGAircraft.h:134
bool Load(Element *el) override
Loads the aircraft.
double GetMoments(int idx) const
Definition FGAircraft.h:150
void SetXYZrp(int idx, double value)
Definition FGAircraft.h:163
double GetWingIncidenceDeg(void) const
Definition FGAircraft.h:140
bool InitModel(void) override
double Getlbarh(void) const
Definition FGAircraft.h:145
double Getvbarv(void) const
Definition FGAircraft.h:148
double GetHTailArm(void) const
Definition FGAircraft.h:142
double Getlbarv(void) const
Definition FGAircraft.h:146
const FGColumnVector3 & GetXYZvrp(void) const
Definition FGAircraft.h:156
double GetXYZrp(int idx) const
Definition FGAircraft.h:158
double Getvbarh(void) const
Definition FGAircraft.h:147
double GetWingSpan(void) const
Gets the wing span.
Definition FGAircraft.h:136
This class implements a 3 element column vector.
static constexpr double radtodeg
Definition FGJSBBase.h:348
FGModel(FGFDMExec *)
Constructor.
Definition FGModel.cpp:57
const char * name
FGColumnVector3 AeroForce
Definition FGAircraft.h:168
FGColumnVector3 ExternalForce
Definition FGAircraft.h:171
FGColumnVector3 GroundMoment
Definition FGAircraft.h:175
FGColumnVector3 GroundForce
Definition FGAircraft.h:170
FGColumnVector3 BuoyantMoment
Definition FGAircraft.h:177
FGColumnVector3 ExternalMoment
Definition FGAircraft.h:176
FGColumnVector3 BuoyantForce
Definition FGAircraft.h:172
FGColumnVector3 AeroMoment
Definition FGAircraft.h:173
FGColumnVector3 PropForce
Definition FGAircraft.h:169
FGColumnVector3 PropMoment
Definition FGAircraft.h:174