1 /*******************************************************************************
7 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
26 FUNCTIONAL DESCRIPTION
27 --------------------------------------------------------------------------------
29 Based on Flightgear code, which is based on LaRCSim. This class wraps all
30 global state variables (such as velocity, position, orientation, etc.).
33 --------------------------------------------------------------------------------
36 ********************************************************************************
38 *******************************************************************************/
43 /*******************************************************************************
45 *******************************************************************************/
48 # include <simgear/compiler.h>
50 # ifdef FG_HAVE_STD_INCLUDES
63 #include "FGInitialCondition.h"
66 /*******************************************************************************
68 *******************************************************************************/
72 /*******************************************************************************
74 *******************************************************************************/
84 bool Reset(string, string, string);
85 void Initialize(float, float, float, float, float, float, float, float, float);
86 void Initialize(FGInitialCondition *FGIC);
87 bool StoreData(string);
89 inline float GetVt(void) {return Vt;}
91 inline float Getlatitude(void) {return latitude;}
92 inline float Getlongitude(void) {return longitude;}
93 inline float GetGeodeticLat(void) {return GeodeticLat;}
95 inline float Getadot(void) {return adot;}
96 inline float Getbdot(void) {return bdot;}
98 inline float GetLocalAltitudeOverRunway(void) {return LocalAltitudeOverRunway;}
99 inline float Geth(void) {return h;}
100 inline float Geta(void) {return a;}
101 inline float GetMach(void) {return Mach;}
103 inline float Getsim_time(void) {return sim_time;}
104 inline float Getdt(void) {return dt;}
106 inline float Getqbar(void) {return qbar;}
107 float GetParameter(int val_idx);
108 float GetParameter(string val_string);
109 int GetParameterIndex(string val_string);
111 inline void SetVt(float tt) {Vt = tt;}
113 inline void Setlatitude(float tt) {latitude = tt;}
114 inline void Setlongitude(float tt) {longitude = tt;}
115 inline void SetGeodeticLat(float tt) {GeodeticLat = tt;}
117 inline void Setadot(float tt) {adot = tt;}
118 inline void Setbdot(float tt) {bdot = tt;}
120 inline void Setqbar(float tt) {qbar = tt;}
122 inline void SetLocalAltitudeOverRunway(float tt) {LocalAltitudeOverRunway = tt;}
123 inline void Seth(float tt) {h = tt;}
124 inline void Seta(float tt) {a = tt;}
125 inline void SetMach(float tt) {Mach = tt;}
127 inline float Setsim_time(float tt) {sim_time = tt; return sim_time;}
128 inline void Setdt(float tt) {dt = tt;}
130 void SetParameter(int, float);
132 inline float IncrTime(void) {sim_time+=dt;return sim_time;}
133 void InitMatrices(float phi, float tht, float psi);
134 void CalcMatrices(void);
135 void IntegrateQuat(FGColumnVector vPQR, int rate);
136 FGColumnVector CalcEuler(void);
137 FGMatrix GetTs2b(float alpha, float beta);
138 FGMatrix GetTl2b(void) {return mTl2b;}
139 FGMatrix GetTb2l(void) {return mTb2l;}
143 float Vt; // Total velocity
144 float latitude, longitude; // position
145 float GeodeticLat; // Geodetic Latitude
146 float adot, bdot; // alpha dot and beta dot
147 float h, a; // altitude above sea level, speed of sound
148 float qbar; // dynamic pressure
150 float Mach; // Mach number
153 float LocalAltitudeOverRunway;
157 FGColumnVector vQtrn;
159 typedef map<string, long> CoeffMap;
163 enum {ePhi=1, eTht, ePsi};
167 /******************************************************************************/