]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGState.h
FG_HAVE_STD_INCLUDES -> SG_HAVE_STD_INCLUDES
[flightgear.git] / src / FDM / JSBSim / FGState.h
index b7613b102f9416925dabdc6d03c4c9f1970f65ec..4e0fcf67fd3f80c6b729215174931c23fbb14b38 100644 (file)
@@ -1,84 +1,81 @@
-/*******************************************************************************
-
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Header:       FGState.h
  Author:       Jon S. Berndt
  Date started: 11/17/98
-
  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
-
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later
  version.
-
  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.
-
  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  Place - Suite 330, Boston, MA  02111-1307, USA.
-
  Further information about the GNU General Public License can also be found on
  the world wide web at http://www.gnu.org.
-
 FUNCTIONAL DESCRIPTION
 --------------------------------------------------------------------------------
-
 Based on Flightgear code, which is based on LaRCSim. This class wraps all
 global state variables (such as velocity, position, orientation, etc.).
-
 HISTORY
 --------------------------------------------------------------------------------
 11/17/98   JSB   Created
-
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGSTATE_H
 #define FGSTATE_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
-#  include STL_STRING
-#  ifdef FG_HAVE_STD_INCLUDES
+#  ifdef SG_HAVE_STD_INCLUDES
 #    include <fstream>
 #  else
 #    include <fstream.h>
 #  endif
-   FG_USING_STD(string);
 #else
-#  include <string>
 #  include <fstream>
 #endif
 
+#include <string>
 #include <map>
 #include "FGDefs.h"
 #include "FGInitialCondition.h"
 #include "FGMatrix.h"
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using namespace std;
+#define ID_STATE "$Header$"
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGFDMExec;
 
-class FGState
-{
+class FGState {
 public:
-   FGState(FGFDMExec*);
+  FGState(FGFDMExec*);
   ~FGState(void);
 
   bool Reset(string, string, string);
@@ -86,53 +83,56 @@ public:
   void Initialize(FGInitialCondition *FGIC);
   bool StoreData(string);
 
-  inline float Getadot(void) {return adot;}
-  inline float Getbdot(void) {return bdot;}
+  inline float Geta(void) { return a; }
 
-  inline float GetLocalAltitudeOverRunway(void) {return LocalAltitudeOverRunway;}
-  inline float Geta(void) {return a;}
+  inline float Getsim_time(void) { return sim_time; }
+  inline float Getdt(void) { return dt; }
 
-  inline float Getsim_time(void) {return sim_time;}
-  inline float Getdt(void) {return dt;}
+  inline void Suspend(void) {saved_dt = dt; dt = 0.0;}
+  inline void Resume(void)  {dt = saved_dt;}
 
-  float GetParameter(int val_idx);
+  float GetParameter(eParam val_idx);
   float GetParameter(string val_string);
-  int GetParameterIndex(string val_string);
+  eParam GetParameterIndex(string val_string);
 
-  inline void Setadot(float tt) {adot = tt;}
-  inline void Setbdot(float tt) {bdot = tt;}
 
-  inline void SetLocalAltitudeOverRunway(float tt) {LocalAltitudeOverRunway = tt;}
-  inline void Seta(float tt) {a = tt;}
+  inline void Seta(float tt) { a = tt; }
 
-  inline float Setsim_time(float tt) {sim_time = tt; return sim_time;}
-  inline void  Setdt(float tt) {dt = tt;}
+  inline float Setsim_time(float tt) {
+    sim_time = tt;
+    return sim_time;
+  }
+  inline void  Setdt(float tt) { dt = tt; }
 
-  void SetParameter(int, float);
+  void SetParameter(eParam, float);
 
-  inline float IncrTime(void) {sim_time+=dt;return sim_time;}
+  inline float IncrTime(void) {
+    sim_time+=dt;
+    return sim_time;
+  }
   void InitMatrices(float phi, float tht, float psi);
   void CalcMatrices(void);
   void IntegrateQuat(FGColumnVector vPQR, int rate);
   FGColumnVector CalcEuler(void);
   FGMatrix GetTs2b(float alpha, float beta);
-  FGMatrix GetTl2b(void) {return mTl2b;}
-  FGMatrix GetTb2l(void) {return mTb2l;}
+  FGMatrix GetTl2b(void) { return mTl2b; }
+  FGMatrix GetTb2l(void) { return mTb2l; }
+  typedef map<eParam, string> ParamMap;
+  ParamMap paramdef;
 
 private:
 
-  float adot, bdot;                 // alpha dot and beta dot
   float a;                          // speed of sound
   float sim_time, dt;
+  float saved_dt;
 
   FGFDMExec* FDMExec;
-  float LocalAltitudeOverRunway;
   FGMatrix mTb2l;
   FGMatrix mTl2b;
   FGMatrix mTs2b;
   FGColumnVector vQtrn;
 
-  typedef map<string, long> CoeffMap;
+  typedef map<string, eParam> CoeffMap;
   CoeffMap coeffdef;
 
 protected:
@@ -140,5 +140,5 @@ protected:
   enum {eP=1, eQ, eR};
 };
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif