From: curt Date: Sun, 22 Feb 2004 02:06:05 +0000 (+0000) Subject: For metar, correctly update visibility and pressure/altimeter. Temp and X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b464703a6fc4825bccefbcf0826e0be881f87741;p=flightgear.git For metar, correctly update visibility and pressure/altimeter. Temp and clouds need to be implimented (and adjusted for station elevation.) --- diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index 6e6f350c9..e40c3805a 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -28,6 +28,7 @@ #include #include
+#include
#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();