]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPosition.h
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGPosition.h
index 423889bc35ab5ea29fa3f1360f176ead854d71eb..0fd024354c8cd6c454ee08fcbe26368ce750dc1d 100644 (file)
@@ -1,5 +1,5 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
  Header:       FGPosition.h
  Author:       Jon S. Berndt
  Date started: 1/5/99
@@ -27,74 +27,127 @@ HISTORY
 --------------------------------------------------------------------------------
 01/05/99   JSB   Created
  
-********************************************************************************
-COMMENTS, REFERENCES,  and NOTES
-********************************************************************************
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGPOSITION_H
 #define FGPOSITION_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
-#include "FGMatrix.h"
+#include "FGMatrix33.h"
+#include "FGColumnVector3.h"
+#include "FGColumnVector4.h"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#define ID_POSITION "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES,  and NOTES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*******************************************************************************
+/** Models the lateral and longitudinal translational EOM.
+    @author Jon S. Berndt
+    @version $Id$
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPosition.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPosition.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
+  */
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGPosition : public FGModel {
-  FGColumnVector vUVW;
-  FGColumnVector vVel;
+public:
+  /** Constructor
+      @param Executive a pointer to the parent executive object */
+  FGPosition(FGFDMExec*);
+  /// Destructor
+  ~FGPosition();
+
+  bool InitModel(void);
 
-  double Vee, invMass, invRadius;
+  /** Runs the Position model; called by the Executive
+      @see JSBSim.cpp documentation
+      @return false if no error */
+  bool Run(void);
+  
+  inline FGColumnVector3& GetVel(void) { return vVel; }
+  inline FGColumnVector3& GetVelDot(void) { return vVelDot; }
+  inline double GetVn(void)  const { return vVel(eX); }
+  inline double GetVe(void)  const { return vVel(eY); }
+  inline double GetVd(void)  const { return vVel(eZ); }
+  inline double GetVground(void) const { return Vground; }
+  inline double GetGroundTrack(void) const { return psigt; }
+  inline double Geth(void)  const { return h; }
+  inline double Gethdot(void) const { return RadiusDot; }
+  inline double GetLatitude(void) const { return Latitude; }
+  inline double GetLatitudeDot(void) const { return LatitudeDot; }
+  inline double GetLongitude(void) const { return Longitude; }
+  inline double GetLongitudeDot(void) const { return LongitudeDot; }
+  inline double GetRunwayRadius(void) const { return RunwayRadius; }
+  inline double GetDistanceAGL(void)  const { return DistanceAGL; }
+  inline double GetRadius(void) const { return Radius; }
+  inline FGColumnVector3& GetRunwayNormal(void) { return vRunwayNormal; }
+  
+  inline double GetGamma(void) const { return gamma; }
+  inline void SetGamma(double tt) { gamma = tt; }
+  inline double GetHOverBCG(void) const { return hoverbcg; }
+  inline double GetHOverBMAC(void) const { return hoverbmac; }
+  void SetvVel(const FGColumnVector3& v) { vVel = v; }
+  void SetLatitude(double tt) { Latitude = tt; }
+  void SetLongitude(double tt) { Longitude = tt; }
+  void Seth(double tt);
+  void SetRunwayRadius(double tt) { RunwayRadius = tt; }
+  void SetSeaLevelRadius(double tt) { SeaLevelRadius = tt;}
+  void SetDistanceAGL(double tt);
+  inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
+      vRunwayNormal << fgx << fgy << fgz;
+  }
+  
+  void bind(void);
+  void unbind(void);
+  
+private:  
+  FGColumnVector3 vVel;
+  FGColumnVector3 vVelDot;
+  FGColumnVector3 vRunwayNormal;
+  
   double Radius, h;
   double LatitudeDot, LongitudeDot, RadiusDot;
   double lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
   double Longitude, Latitude;
-  float dt;
+  double dt;
   double RunwayRadius;
   double DistanceAGL;
   double SeaLevelRadius;
   double gamma;
-  double Vt;
-  double hoverb,b;
+  double Vt, Vground;
+  double hoverbcg,hoverbmac,b;
 
-  void GetState(void);
-
-public:
-  FGPosition(FGFDMExec*);
-  ~FGPosition(void);
-
-  inline FGColumnVector GetVel(void) { return vVel; }
-  inline FGColumnVector GetUVW(void) { return vUVW; }
-  inline double GetVn(void)  { return vVel(eX); }
-  inline double GetVe(void)  { return vVel(eY); }
-  inline double GetVd(void)  { return vVel(eZ); }
-  inline double Geth(void)  { return h; }
-  inline double Gethdot(void) { return RadiusDot; }
-  inline double GetLatitude(void) { return Latitude; }
-  inline double GetLongitude(void) { return Longitude; }
-  inline double GetRunwayRadius(void) { return RunwayRadius; }
-  inline double GetDistanceAGL(void)  { return DistanceAGL; }
-  inline double GetGamma(void) { return gamma; }
-  inline double GetHOverB(void) { return hoverb; }
-  void SetvVel(const FGColumnVector& v) { vVel = v; }
-  void SetLatitude(float tt) { Latitude = tt; }
-  void SetLongitude(double tt) { Longitude = tt; }
-  void Seth(double tt);
-  void SetRunwayRadius(double tt) { RunwayRadius = tt; }
-  void SetSeaLevelRadius(double tt) { SeaLevelRadius = tt;}
-  void SetDistanceAGL(double tt);
+  double psigt;
 
-  bool Run(void);
+  void GetState(void);
+  void Debug(int from);
 };
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+