]> git.mxchange.org Git - flightgear.git/commitdiff
For metar, correctly update visibility and pressure/altimeter. Temp and
authorcurt <curt>
Sun, 22 Feb 2004 02:06:05 +0000 (02:06 +0000)
committercurt <curt>
Sun, 22 Feb 2004 02:06:05 +0000 (02:06 +0000)
clouds need to be implimented (and adjusted for station elevation.)

src/Environment/environment_ctrl.cxx

index 6e6f350c99296bb644c3674fdc1a162bf2304982..e40c3805af78622d1ec616ebefec158a99dba42c 100644 (file)
@@ -28,6 +28,7 @@
 #include <simgear/structure/exception.hxx>
 
 #include <Main/fg_props.hxx>
+#include <Main/util.hxx>
 
 #include "environment_mgr.hxx"
 #include "environment_ctrl.hxx"
@@ -346,14 +347,19 @@ FGMetarEnvironmentCtrl::init ()
                  fgGetDouble("/environment/metar/base-wind-speed-kt"),
                  fgGetDouble("/environment/metar/gust-wind-speed-kt") );
 
-    fgSetDouble("/environment/visibility-m",
-        fgGetDouble("/environment/metar/min-visibility-m"));
+    fgDefaultWeatherValue( "visibility-m",
+                           fgGetDouble("/environment/metar/min-visibility-m") );
+
+    // FIXME: this isn't the correct place in the property tree to set
+    // the weather and it doesn't account for weather station
+    // elevation.
     fgSetDouble("/environment/temperature-degc",
         fgGetDouble("/environment/metar/temperature-degc"));
     fgSetDouble("/environment/dewpoint-degc",
         fgGetDouble("/environment/metar/dewpoint-degc"));
-    fgSetDouble("/environment/pressure-inhg",
-        fgGetDouble("/environment/metar/pressure-inhg"));
+
+    fgDefaultWeatherValue( "pressure-sea-level-inhg",
+                           fgGetDouble("/environment/metar/pressure-inhg") );
 
     env->init();
 }
@@ -373,16 +379,19 @@ FGMetarEnvironmentCtrl::reinit ()
                  fgGetDouble("/environment/metar/base-wind-speed-kt"),
                  fgGetDouble("/environment/metar/gust-wind-speed-kt") );
 
-    fgSetDouble("/environment/visibility-m",
-        fgGetDouble("/environment/metar/min-visibility-m"));
-    fgSetDouble("/environment/pressure-inhg",
-        fgGetDouble("/environment/metar/pressure-inhg"));
+    fgDefaultWeatherValue( "visibility-m",
+                           fgGetDouble("/environment/metar/min-visibility-m") );
 
-    // FIXME: The following seem to egt overriden?
+    // FIXME: this isn't the correct place in the property tree to set
+    // the weather and it doesn't account for weather station
+    // elevation.
     fgSetDouble("/environment/temperature-degc",
         fgGetDouble("/environment/metar/temperature-degc"));
     fgSetDouble("/environment/dewpoint-degc",
         fgGetDouble("/environment/metar/dewpoint-degc"));
+
+    fgDefaultWeatherValue( "pressure-sea-level-inhg",
+                           fgGetDouble("/environment/metar/pressure-inhg") );
 #endif
 
     env->reinit();