From e979f72ea6313e64ad711e54caf7339b260a467e Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 27 Jul 2006 14:28:51 +0000 Subject: [PATCH] - we could use the same property path names in fgUntie that we used int fgTie - cleanup --- src/Environment/environment.cxx | 26 +++++++++++++------------- src/Environment/environment_mgr.cxx | 12 ++++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Environment/environment.cxx b/src/Environment/environment.cxx index f4d21407b..f99c31e09 100644 --- a/src/Environment/environment.cxx +++ b/src/Environment/environment.cxx @@ -38,7 +38,6 @@ #include #include -#include
#include "environment.hxx" @@ -532,9 +531,8 @@ FGEnvironment::_recalc_sl_temperature () { // If we're in the stratosphere, leave sea-level temp alone if (elevation_ft < 38000) { - temperature_sea_level_degc = - (temperature_degc + 273.15) - /_temperature_degc_table->interpolate(elevation_ft) + temperature_sea_level_degc = (temperature_degc + 273.15) + / _temperature_degc_table->interpolate(elevation_ft) - 273.15; } } @@ -543,9 +541,8 @@ void FGEnvironment::_recalc_alt_temperature () { if (elevation_ft < 38000) { - temperature_degc = - (temperature_sea_level_degc + 273.15) * - _temperature_degc_table->interpolate(elevation_ft) - 273.15; + temperature_degc = (temperature_sea_level_degc + 273.15) * + _temperature_degc_table->interpolate(elevation_ft) - 273.15; } else { temperature_degc = -56.49; // Stratosphere is constant } @@ -612,12 +609,14 @@ void FGEnvironment::_recalc_density_tropo_avg_kgm3 () { double pressure_mb = pressure_inhg * 33.86; - double vaporpressure = 6.11 * pow ( 10, ((7.5 * dewpoint_degc) /( 237.7 + dewpoint_degc))); + double vaporpressure = 6.11 * pow(10, ((7.5 * dewpoint_degc) / (237.7 + dewpoint_degc))); double virtual_temp = (temperature_degc + 273.15) / (1 - 0.379 * (vaporpressure/pressure_mb)); - double density_half = (100* pressure_mb * exp (-altitude_half_to_sun_m / 8000)) / (287.05 * virtual_temp); - double density_tropo = (100* pressure_mb * exp ((-1 * altitude_tropo_top_m) / 8000)) /( 287.05 * virtual_temp); + double density_half = (100 * pressure_mb * exp(-altitude_half_to_sun_m / 8000)) + / (287.05 * virtual_temp); + double density_tropo = (100 * pressure_mb * exp((-1 * altitude_tropo_top_m) / 8000)) + / ( 287.05 * virtual_temp); density_tropo_avg_kgm3 = ((density_slugft3 * 515.379) + density_half + density_tropo) / 3; } @@ -625,9 +624,10 @@ FGEnvironment::_recalc_density_tropo_avg_kgm3 () void FGEnvironment::_recalc_relative_humidity () { - double vaporpressure = 6.11 * pow ( 10, ((7.5 * dewpoint_degc) /( 237.7 + dewpoint_degc))); - double sat_vaporpressure = 6.11 * pow ( 10, ((7.5 * temperature_degc) /( 237.7 + temperature_degc)) ); - relative_humidity = 100 *vaporpressure / sat_vaporpressure ; + double vaporpressure = 6.11 * pow(10, ((7.5 * dewpoint_degc) / ( 237.7 + dewpoint_degc))); + double sat_vaporpressure = 6.11 * pow(10, ((7.5 * temperature_degc) + / ( 237.7 + temperature_degc)) ); + relative_humidity = 100 * vaporpressure / sat_vaporpressure ; } diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 6cae314fa..905efc0dd 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -190,7 +190,7 @@ FGEnvironmentMgr::bind () fgTie("/sim/rendering/precipitation-enable", &sgEnviro, &SGEnviro::get_precipitation_enable_state, &SGEnviro::set_precipitation_enable_state); - fgTie("/environment/rebuild_layers", fgClouds, + fgTie("/environment/rebuild-layers", fgClouds, &FGClouds::get_update_event, &FGClouds::set_update_event); fgTie("/sim/rendering/lightning-enable", &sgEnviro, @@ -213,13 +213,13 @@ FGEnvironmentMgr::unbind () fgUntie("/environment/pressure-sea-level-inhg"); fgUntie("/environment/pressure-inhg"); fgUntie("/environment/density-inhg"); - fgUntie("/environment/relative_humidity"); - fgUntie("/environment/atmosphere/density_tropo_avg"); + fgUntie("/environment/relative-humidity"); + fgUntie("/environment/atmosphere/density-tropo-avg"); fgUntie("/environment/wind-from-north-fps"); fgUntie("/environment/wind-from-east-fps"); fgUntie("/environment/wind-from-down-fps"); - fgUntie("/environment/atmosphere/altitude_half_to_sun"); - fgUntie("/environment/atmosphere/altitude_troposphere_top"); + fgUntie("/environment/atmosphere/altitude-half-to-sun"); + fgUntie("/environment/atmosphere/altitude-troposphere-top"); for (int i = 0; i < MAX_CLOUD_LAYERS; i++) { char buf[128]; sprintf(buf, "/environment/clouds/layer[%d]/span-m", i); @@ -239,7 +239,7 @@ FGEnvironmentMgr::unbind () fgUntie("/sim/rendering/clouds3d-cache-size"); fgUntie("/sim/rendering/clouds3d-cache-resolution"); fgUntie("/sim/rendering/precipitation-enable"); - fgUntie("/environment/rebuild_layers"); + fgUntie("/environment/rebuild-layers"); fgUntie("/sim/rendering/lightning-enable"); fgUntie("/environment/turbulence/use-cloud-turbulence"); }