]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGLGear.h
Check return value of FDM::init().
[flightgear.git] / src / FDM / JSBSim / FGLGear.h
1 /*******************************************************************************
2
3  Header:       FGLGear.h
4  Author:       Jon S. Berndt
5  Date started: 11/18/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 11/18/99   JSB   Created
29
30 ********************************************************************************
31 SENTRY
32 *******************************************************************************/
33
34 #ifndef FGLGEAR_H
35 #define FGLGEAR_H
36
37 /*******************************************************************************
38 COMMENTS, REFERENCES,  and NOTES
39 ********************************************************************************
40
41 [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
42            Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420  Naval Postgraduate
43            School, January 1994
44 [2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
45            JSC 12960, July 1977
46 [3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
47            NASA-Ames", NASA CR-2497, January 1975
48 [4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
49            Wiley & Sons, 1979 ISBN 0-471-03032-5
50 [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
51            1982 ISBN 0-471-08936-2
52
53 ********************************************************************************
54 INCLUDES
55 *******************************************************************************/
56
57 #ifdef FGFS
58 #  include <simgear/compiler.h>
59 #endif
60
61 #include <string>
62 #include "FGConfigFile.h"
63 #include "FGMatrix.h"
64 #include "FGFDMExec.h"
65 #include "FGState.h"
66
67 /*******************************************************************************
68 DEFINITIONS
69 *******************************************************************************/
70
71 #define ID_LGEAR "$Header"
72
73 /*******************************************************************************
74 CLASS DECLARATION
75 *******************************************************************************/
76
77 class FGAircraft;
78 class FGPosition;
79 class FGRotation;
80
81 class FGLGear
82 {
83 public:
84   FGLGear(FGConfigFile*, FGFDMExec*);
85   ~FGLGear(void);
86
87   FGColumnVector Force(void);
88   FGColumnVector Moment(void) {return vMoment;}
89   FGColumnVector GetBodyLocation(void) { return vWhlBodyVec; }
90
91   inline string GetName(void)      {return name;          }
92   inline bool   GetWOW(void)       {return WOW;           }
93   inline float  GetCompLen(void)   {return compressLength;}
94   inline float  GetCompVel(void)   {return compressSpeed; }
95   inline float  GetCompForce(void) {return Force()(3);    }
96   
97   inline void SetBrake(double bp) {brakePct = bp;}
98   
99   inline void SetReport(bool bb) { ReportEnable=bb; }
100   inline bool GetReport(void)    { return ReportEnable; }
101   
102
103 private:
104   enum {eX=1, eY, eZ};
105   FGColumnVector vXYZ;
106   FGColumnVector vMoment;
107   FGColumnVector vWhlBodyVec;
108   float kSpring;
109   float bDamp;
110   float compressLength;
111   float compressSpeed;
112   float staticFCoeff, dynamicFCoeff;
113   float brakePct;
114   float maxCompLen;
115   double SinkRate;
116   double GroundSpeed;
117   double DistanceTraveled;
118   double MaximumStrutForce;
119   double MaximumStrutTravel;
120   bool WOW;
121   bool FirstContact;
122   bool Reported;
123   bool ReportEnable;
124   string name;
125   string BrakeType;
126   string SteerType;
127   string GroupMember;
128   float  maxSteerAngle;
129
130   FGFDMExec*     Exec;
131   FGState*       State;
132   FGAircraft*    Aircraft;
133   FGPosition*    Position;
134   FGRotation*    Rotation;
135
136   void Report(void);
137 };
138
139 #include "FGAircraft.h"
140 #include "FGPosition.h"
141 #include "FGRotation.h"
142
143 /******************************************************************************/
144 #endif