]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGPosition.h
Adjust the turbine names for N1, N2 and EGT_degC to match those already specified...
[flightgear.git] / src / FDM / JSBSim / FGPosition.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGPosition.h
4  Author:       Jon S. Berndt
5  Date started: 1/5/99
6  
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8  
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
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 General Public License for more
17  details.
18  
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.
22  
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25  
26 HISTORY
27 --------------------------------------------------------------------------------
28 01/05/99   JSB   Created
29  
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGPOSITION_H
35 #define FGPOSITION_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #include "FGModel.h"
42 #include "FGMatrix33.h"
43 #include "FGColumnVector3.h"
44 #include "FGColumnVector4.h"
45
46 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 DEFINITIONS
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49
50 #define ID_POSITION "$Id$"
51
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 FORWARD DECLARATIONS
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55
56 namespace JSBSim {
57
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 CLASS DOCUMENTATION
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
62 /** Models the lateral and longitudinal translational EOM.
63     @author Jon S. Berndt
64     @version $Id$
65   */
66
67 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 CLASS DECLARATION
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
70
71 class FGPosition : public FGModel {
72 public:
73   /** Constructor
74       @param Executive a pointer to the parent executive object */
75   FGPosition(FGFDMExec* Executive);
76
77   /// Destructor
78   ~FGPosition();
79
80   bool InitModel(void);
81
82   /** Runs the Position model; called by the Executive
83       @see JSBSim.cpp documentation
84       @return false if no error */
85   bool Run(void);
86   
87   inline FGColumnVector3& GetVel(void) { return vVel; }
88   inline FGColumnVector3& GetVelDot(void) { return vVelDot; }
89   inline double GetVn(void)  const { return vVel(eX); }
90   inline double GetVe(void)  const { return vVel(eY); }
91   inline double GetVd(void)  const { return vVel(eZ); }
92   inline double GetVground(void) const { return Vground; }
93   inline double GetGroundTrack(void) const { return psigt; }
94   inline double Geth(void)  const { return h; }
95   inline double GethVRP(void)  const { return hVRP; }
96   inline double Gethdot(void) const { return RadiusDot; }
97   inline double GetLatitude(void) const { return Latitude; }
98   inline double GetLatitudeVRP(void) const { return LatitudeVRP; }
99   inline double GetLatitudeDot(void) const { return LatitudeDot; }
100   inline double GetLongitude(void) const { return Longitude; }
101   inline double GetLongitudeVRP(void) const { return LongitudeVRP; }
102   inline double GetLongitudeDot(void) const { return LongitudeDot; }
103   inline double GetRunwayRadius(void) const { return RunwayRadius; }
104   inline double GetDistanceAGL(void)  const { return DistanceAGL; }
105   inline double GetRadius(void) const { return Radius; }
106   inline FGColumnVector3& GetRunwayNormal(void) { return vRunwayNormal; }
107   
108   inline double GetGamma(void) const { return gamma; }
109   inline void SetGamma(double tt) { gamma = tt; }
110   inline double GetHOverBCG(void) const { return hoverbcg; }
111   inline double GetHOverBMAC(void) const { return hoverbmac; }
112   void SetvVel(const FGColumnVector3& v) { vVel = v; }
113   void SetLatitude(double tt) { Latitude = tt; }
114   void SetLongitude(double tt) { Longitude = tt; }
115   void Seth(double tt);
116   void SetRunwayRadius(double tt) { RunwayRadius = tt; }
117   void SetSeaLevelRadius(double tt) { SeaLevelRadius = tt;}
118   void SetDistanceAGL(double tt);
119   inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
120       vRunwayNormal << fgx << fgy << fgz;
121   }
122   void SetVRP(FGColumnVector3& vrp) {vVRP = vrp;}
123   
124   void bind(void);
125   void unbind(void);
126   
127 private:  
128   FGColumnVector3 vVel;
129   FGColumnVector3 vVelDot;
130   FGColumnVector3 vRunwayNormal;
131   FGColumnVector3 vVRP;
132   FGColumnVector3 vVRPoffset;
133   FGColumnVector3 vMac;
134   
135   double Radius, h, hVRP;
136   double LatitudeDot, LongitudeDot, RadiusDot;
137   double LatitudeDot_prev[4], LongitudeDot_prev[4], RadiusDot_prev[4];
138   double Longitude, Latitude;
139   double LongitudeVRP, LatitudeVRP;
140   double dt;
141   double RunwayRadius;
142   double DistanceAGL;
143   double SeaLevelRadius;
144   double gamma;
145   double Vt, Vground;
146   double hoverbcg,hoverbmac,b;
147
148   double psigt;
149
150   void GetState(void);
151   void Debug(int from);
152 };
153 }
154 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155 #endif
156