]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGTank.h
Curt Olson:
[flightgear.git] / src / FDM / JSBSim / FGTank.h
index 8ffaf3bac4ec2d2a5f09fa52fa54d03e796bc024..c04f7128b30aa1bd77d8300b9a0174a899da73c2 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGTank.h
  Author:       Jon S. Berndt
@@ -33,68 +33,91 @@ HISTORY
 --------------------------------------------------------------------------------
 01/21/99   JSB   Created
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGTank_H
 #define FGTank_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#include "FGConfigFile.h"
+#include "FGJSBBase.h"
+
 #ifdef FGFS
 #  include <simgear/compiler.h>
 #  include STL_STRING
-#  ifdef FG_HAVE_STD_INCLUDES
-#    include <fstream>
-#  else
-#    include <fstream.h>
-#  endif
-   FG_USING_STD(string);
+  SG_USING_STD(string);
+  SG_USING_STD(cerr);
+  SG_USING_STD(endl);
+  SG_USING_STD(cout);
 #else
-#  include <string>
-#  include <fstream>
+# include <string>
+  using std::string;
+# if !defined(sgi) || defined(__GNUC__) || (_COMPILER_VERSION >= 740)
+   using std::cerr;
+   using std::endl;
+   using std::cout;
+# endif
 #endif
 
-/*******************************************************************************
-DEFINES
-*******************************************************************************/
-using namespace std;
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#define ID_TANK "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+namespace JSBSim {
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*******************************************************************************
+/** Models a fuel tank.
+  */
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGTank
+class FGTank : public FGJSBBase
 {
 public:
-  FGTank(ifstream&);
-  ~FGTank(void);
+  FGTank(FGConfigFile*);
+  ~FGTank();
 
-  float Reduce(float);
+  double Reduce(double);
   int GetType(void) {return Type;}
   bool GetSelected(void) {return Selected;}
-  float GetPctFull(void) {return PctFull;}
-  float GetContents(void) {return Contents;}
-  float inline GetX(void) {return X;}
-  float inline GetY(void) {return Y;}
-  float inline GetZ(void) {return Z;}
+  double GetPctFull(void) {return PctFull;}
+  double GetContents(void) {return Contents;}
+  double inline GetX(void) {return X;}
+  double inline GetY(void) {return Y;}
+  double inline GetZ(void) {return Z;}
+
+  void SetContents(double contents) { Contents = contents; }
 
   enum TankType {ttUNKNOWN, ttFUEL, ttOXIDIZER};
-  
+
 private:
   TankType Type;
-  float X, Y, Z;
-  float Capacity;
-  float Radius;
-  float PctFull;
-  float Contents;
+  string type;
+  double X, Y, Z;
+  double Capacity;
+  double Radius;
+  double PctFull;
+  double Contents;
   bool  Selected;
-
-protected:
+  void Debug(int from);
 };
-
-/******************************************************************************/
+}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+