]> git.mxchange.org Git - flightgear.git/commitdiff
General cleanups to cut cross-dependencies and speed up compilation.
authordavid <david>
Fri, 22 Feb 2002 23:37:45 +0000 (23:37 +0000)
committerdavid <david>
Fri, 22 Feb 2002 23:37:45 +0000 (23:37 +0000)
Added two new properties:

  /environment/temperature-sea-level-degc
  /environment/pressure-sea-level-inhg

These are now supported in FGEnvironment as well, though they always
have the same value for now.  They need to be hooked up to the FDMs.

src/Environment/environment.cxx
src/Environment/environment.hxx
src/Environment/environment_mgr.cxx
src/Input/input.cxx
src/Main/fg_init.cxx
src/Main/globals.cxx
src/Main/globals.hxx
src/Scenery/tilemgr.cxx

index 59a26ec11aa6247b13f2c71384816777f7b1122f..bb5894443266da66e1de20f069c64e930c9885b7 100644 (file)
@@ -39,6 +39,8 @@
 
 FGEnvironment::FGEnvironment()
   : visibility_m(32000),
+    temperature_sea_level_degc(20),
+    pressure_sea_level_inhg(28),
     wind_from_heading_deg(0),
     wind_speed_kt(0),
     wind_from_north_fps(0),
@@ -53,12 +55,74 @@ FGEnvironment::~FGEnvironment()
 }
 
 
+double
+FGEnvironment::get_visibility_m () const
+{
+  return visibility_m;
+}
+
+double
+FGEnvironment::get_temperature_sea_level_degc () const
+{
+  return temperature_sea_level_degc;
+}
+
+double
+FGEnvironment::get_pressure_sea_level_inhg () const
+{
+  return pressure_sea_level_inhg;
+}
+
+double
+FGEnvironment::get_wind_from_heading_deg () const
+{
+  return wind_from_heading_deg;
+}
+
+double
+FGEnvironment::get_wind_speed_kt () const
+{
+  return wind_speed_kt;
+}
+
+double
+FGEnvironment::get_wind_from_north_fps () const
+{
+  return wind_from_north_fps;
+}
+
+double
+FGEnvironment::get_wind_from_east_fps () const
+{
+  return wind_from_east_fps;
+}
+
+double
+FGEnvironment::get_wind_from_down_fps () const
+{
+  return wind_from_down_fps;
+}
+
+
+
 void
 FGEnvironment::set_visibility_m (double v)
 {
   visibility_m = v;
 }
 
+void
+FGEnvironment::set_temperature_sea_level_degc (double t)
+{
+  temperature_sea_level_degc = t;
+}
+
+void
+FGEnvironment::set_pressure_sea_level_inhg (double p)
+{
+  pressure_sea_level_inhg = p;
+}
+
 void
 FGEnvironment::set_wind_from_heading_deg (double h)
 {
index 0b29970aa7a8cf8ba00ccf1b249c2f06fd22a14f..f3a77152de0e488070b9a1b00d1820882115f887 100644 (file)
@@ -51,22 +51,18 @@ public:
   FGEnvironment();
   virtual ~FGEnvironment();
   
-  inline virtual double get_visibility_m () const { return visibility_m; }
-  inline virtual double get_wind_from_heading_deg () const {
-    return wind_from_heading_deg;
-  }
-  inline virtual double get_wind_speed_kt () const { return wind_speed_kt; }
-  inline virtual double get_wind_from_north_fps () const {
-    return wind_from_north_fps;
-  }
-  inline virtual double get_wind_from_east_fps () const {
-    return wind_from_east_fps;
-  }
-  inline virtual double get_wind_from_down_fps () const {
-    return wind_from_down_fps;
-  }
+  virtual double get_visibility_m () const;
+  virtual double get_temperature_sea_level_degc () const;
+  virtual double get_pressure_sea_level_inhg () const;
+  virtual double get_wind_from_heading_deg () const;
+  virtual double get_wind_speed_kt () const;
+  virtual double get_wind_from_north_fps () const;
+  virtual double get_wind_from_east_fps () const;
+  virtual double get_wind_from_down_fps () const;
 
   virtual void set_visibility_m (double v);
+  virtual void set_temperature_sea_level_degc (double t);
+  virtual void set_pressure_sea_level_inhg (double p);
   virtual void set_wind_from_heading_deg (double h);
   virtual void set_wind_speed_kt (double s);
   virtual void set_wind_from_north_fps (double n);
@@ -79,6 +75,8 @@ private:
   void _recalc_ne ();
 
   double visibility_m;
+  double temperature_sea_level_degc;
+  double pressure_sea_level_inhg;
 
   double wind_from_heading_deg;
   double wind_speed_kt;
index 9840d6de25ce066bd52366aebb4f462a4eab2c5b..188d73a208402dde1a075393917df821d7188b21 100644 (file)
@@ -50,6 +50,14 @@ FGEnvironmentMgr::bind ()
   fgTie("/environment/visibility-m", _environment,
        &FGEnvironment::get_visibility_m, &FGEnvironment::set_visibility_m);
   fgSetArchivable("/environment/visibility-m");
+  fgTie("/environment/temperature-sea-level-degc", _environment,
+       &FGEnvironment::get_temperature_sea_level_degc,
+       &FGEnvironment::set_temperature_sea_level_degc);
+  fgSetArchivable("/environment/temperature-sea-level-degc");
+  fgTie("/environment/pressure-sea-level-inhg", _environment,
+       &FGEnvironment::get_pressure_sea_level_inhg,
+       &FGEnvironment::set_pressure_sea_level_inhg);
+  fgSetArchivable("/environment/pressure-sea-level-inhg");
   fgTie("/environment/wind-from-heading-deg", _environment,
        &FGEnvironment::get_wind_from_heading_deg,
        &FGEnvironment::set_wind_from_heading_deg);
index 243eacbe43ba21a5cddce9066dd016066b92eb73..06122defdc0dd2380a1306ddd1e379d2740c3bca 100644 (file)
 #include <Cockpit/panel_io.hxx>
 #include <GUI/gui.h>
 
-#ifndef FG_NEW_ENVIRONMENT
-#  include <WeatherCM/FGLocalWeatherDatabase.h>
-#else
-#  include <Environment/environment.hxx>
-#endif
-
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 
index 787e9869ec1d8a1b9b03764ac314171a1cf0786b..846e8ad89f38e699bf65dcd1c4e02d5ac78fedf6 100644 (file)
 #ifndef FG_NEW_ENVIRONMENT
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#  include <Environment/environment.hxx>
+#  include <Environment/environment_mgr.hxx>
 #endif
 
 #include "fg_init.hxx"
index 59712dca7c1f870b24deac54d57db47616f500b0..e26abf6949549be8449c1a0ac498f02242303f22 100644 (file)
@@ -21,6 +21,8 @@
 // $Id$
 
 
+#include <Environment/environment_mgr.hxx>
+
 #include "globals.hxx"
 #include "fg_props.hxx"
 
@@ -82,5 +84,17 @@ FGGlobals::restoreInitialState ()
   }
 }
 
+const FGEnvironment *
+FGGlobals::get_environment () const
+{
+  return environment_mgr->getEnvironment();
+}
+
+const FGEnvironment *
+FGGlobals::get_environment (double lat, double lon, double alt) const
+{
+  return environment_mgr->getEnvironment(lat, lon, alt);
+}
+
 
 // end of globals.cxx
index b2e1001091ec08a1daa7801b28c38592937ea6a1..07cc680d42ba054fb89e351b9aa91df8cde8fcfb 100644 (file)
@@ -42,8 +42,6 @@ SG_USING_STD( string );
 
 typedef vector<string> string_list;
 
-#include <Environment/environment_mgr.hxx>
-
 
 // Forward declarations
 class FGEnvironmentMgr;
@@ -168,13 +166,9 @@ public:
     inline void set_environment_mgr(FGEnvironmentMgr * mgr) {
       environment_mgr = mgr;
     }
-    inline const FGEnvironment * get_environment() const {
-      return environment_mgr->getEnvironment();
-    }
-    inline const FGEnvironment * get_environment(double lat, double lon,
-                                                double alt) const {
-      return environment_mgr->getEnvironment(lat, lon, alt);
-    }
+    const FGEnvironment * get_environment() const;
+    const FGEnvironment * get_environment(double lat, double lon,
+                                         double alt) const;
 
     inline FGSoundMgr *get_soundmgr() const { return soundmgr; }
     inline void set_soundmgr( FGSoundMgr *sm ) { soundmgr = sm; }
index 6d6d4f045d6e1c4bbc5add9539dc31b544e47574..0b7b22968667fad54bd5c381fed3e818a6450765 100644 (file)
 #include <Main/viewer.hxx>
 #include <Objects/obj.hxx>
 
-#ifndef FG_NEW_ENVIRONMENT
-#  include <WeatherCM/FGLocalWeatherDatabase.h>
-#else
-#  include <Environment/environment.hxx>
-#endif
-
 #include "newcache.hxx"
 #include "scenery.hxx"
 #include "tilemgr.hxx"