]> git.mxchange.org Git - flightgear.git/commitdiff
Updates to JSBsim from Jon's CVS.
authorcurt <curt>
Thu, 6 Jul 2000 22:13:24 +0000 (22:13 +0000)
committercurt <curt>
Thu, 6 Jul 2000 22:13:24 +0000 (22:13 +0000)
Massaging some names inside of SimGear.

28 files changed:
src/Cockpit/cockpit.cxx
src/Cockpit/sp_panel.cxx
src/GUI/gui.cxx
src/Main/bfi.cxx
src/Main/fg_init.cxx
src/Main/keyboard.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/options.hxx
src/Main/views.cxx
src/Main/views.hxx
src/Network/garmin.cxx
src/Network/native.cxx
src/Network/nmea.cxx
src/Network/pve.cxx
src/Network/ray.cxx
src/Network/ray.hxx
src/Network/rul.cxx
src/Scenery/tilemgr.cxx
src/Time/event.hxx
src/Time/fg_timer.cxx
src/Time/light.cxx
src/Time/moonpos.cxx
src/Time/sunpos.cxx
src/Time/tmp.cxx
src/WeatherCM/FGLocalWeatherDatabase.cpp
src/WeatherCM/FGLocalWeatherDatabase.h
src/WeatherCM/FGWeatherDefs.h

index 802c9c2e1818e0d3e16363b248d52068067fbad2..9b14ab5ad4aee87c6add7b2ae4b046b4fc93e6e6 100644 (file)
@@ -101,7 +101,7 @@ char*
 get_formated_gmt_time( void )
 {
     static char buf[32];
-    FGTime *t = FGTime::cur_time_params;
+    SGTime *t = SGTime::cur_time_params;
     const struct tm *p = t->getGmt();
     sprintf( buf, "%d/%d/%4d %d:%02d:%02d", 
          p->tm_mon+1, p->tm_mday, 1900 + p->tm_year,
index 40af43aa15a3b2870cfc0c6a3338580f47385b1f..933099ec6c516ed48e0c3c00bdd147687cb02d28 100644 (file)
@@ -29,7 +29,7 @@
 #include <map>
 
 #include <simgear/debug/logstream.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Main/bfi.hxx>
 
@@ -63,7 +63,7 @@ FG_USING_STD(map);
 static char * panelGetTime ()
 {
   static char buf[1024];       // FIXME: not thread-safe
-  struct tm * t = FGTime::cur_time_params->getGmt();
+  struct tm * t = SGTime::cur_time_params->getGmt();
   sprintf(buf, " %.2d:%.2d:%.2d",
          t->tm_hour, t->tm_min, t->tm_sec);
   return buf;
index b96598e5f9f8e98e9a70b46238e1afe9ccb4b6b9..c6e227ad677f9ac77c9f6d2faccce497db493a4a 100644 (file)
@@ -55,7 +55,6 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/fgpath.hxx>
 #include <simgear/screen/screen-dump.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include <Include/general.hxx>
 #include <Aircraft/aircraft.hxx>
index 8ab40e4e5db4aad28612b68719976cffc02f0af0..441004135d6b5ae6430efe415deb0efa7e768e6e 100644 (file)
@@ -36,7 +36,7 @@
 #include <simgear/ephemeris/ephemeris.hxx>
 #include <simgear/math/fg_types.hxx>
 #include <simgear/misc/props.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
@@ -377,7 +377,7 @@ FGBFI::setAircraftDir (const string &dir)
 time_t
 FGBFI::getTimeGMT ()
 {
-  return FGTime::cur_time_params->get_cur_time();
+  return SGTime::cur_time_params->get_cur_time();
 }
 
 
@@ -391,12 +391,12 @@ FGBFI::setTimeGMT (time_t time)
                                // and solar system
   current_options.set_time_offset(time);
   current_options.set_time_offset_type(SG_TIME_GMT_ABSOLUTE);
-  FGTime::cur_time_params->init( cur_fdm_state->get_Longitude(),
+  SGTime::cur_time_params->init( cur_fdm_state->get_Longitude(),
                                 cur_fdm_state->get_Latitude(),
                                 current_options.get_fg_root(),
                                 current_options.get_time_offset(),
                                 current_options.get_time_offset_type() );
-  FGTime::cur_time_params->update( cur_fdm_state->get_Longitude(),
+  SGTime::cur_time_params->update( cur_fdm_state->get_Longitude(),
                                   cur_fdm_state->get_Latitude(),
                                   cur_fdm_state->get_Altitude()
                                   * FEET_TO_METER );
index a1c2d82ca502f7c602631a9c6fa05e0a08d9a3ad..cbd19bf915ac7b6bceecb2f0e0b84978db31414c 100644 (file)
@@ -54,7 +54,7 @@
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/misc/fgpath.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Airports/simple.hxx>
@@ -245,7 +245,7 @@ bool fgInitGeneral( void ) {
 // Returns non-zero if a problem encountered.
 bool fgInitSubsystems( void ) {
     fgLIGHT *l = &cur_light_params;
-    FGTime *t = FGTime::cur_time_params;
+    SGTime *t = SGTime::cur_time_params;
 
     FG_LOG( FG_GENERAL, FG_INFO, "Initialize Subsystems");
     FG_LOG( FG_GENERAL, FG_INFO, "========== ==========");
@@ -454,7 +454,7 @@ bool fgInitSubsystems( void ) {
               current_aircraft.fdm_state->get_Longitude(),
               current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER );
     FGLocalWeatherDatabase::theFGLocalWeatherDatabase = 
-       new FGLocalWeatherDatabase( position );
+       new FGLocalWeatherDatabase( position, current_options.get_fg_root() );
     // cout << theFGLocalWeatherDatabase << endl;
     // cout << "visibility = " 
     //      << theFGLocalWeatherDatabase->getWeatherVisibility() << endl;
index cf9b5a867f081354b74079bcf7c6dfbfca489c8f..328e15146e9c0b82493f2e12180915acd35692ea 100644 (file)
@@ -48,7 +48,7 @@
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/fgpath.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Autopilot/auto_gui.hxx>
 // Handle keyboard events
 void GLUTkey(unsigned char k, int x, int y) {
     FGInterface *f;
-    FGTime *t;
+    SGTime *t;
     FGView *v;
     float fov, tmp;
     static bool winding_ccw = true;
     int speed;
 
     f = current_aircraft.fdm_state;
-    t = FGTime::cur_time_params;
+    t = SGTime::cur_time_params;
     v = &current_view;
 
     FG_LOG( FG_INPUT, FG_DEBUG, "Key hit = " << k );
index bd760dda45e14e18b76e5fa8b6ae9b30187e9ef3..db96444358022045576349d3228390a68a8d093e 100644 (file)
@@ -72,7 +72,7 @@
 #include <simgear/math/fg_random.h>
 #include <simgear/misc/fgpath.hxx>
 #include <simgear/sky/sky.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Include/general.hxx>
 
@@ -276,7 +276,7 @@ void fgRenderFrame( void ) {
     FGBFI::update();
 
     fgLIGHT *l = &cur_light_params;
-    FGTime *t = FGTime::cur_time_params;
+    SGTime *t = SGTime::cur_time_params;
     // FGView *v = &current_view;
     static double last_visibility = -9999;
 
@@ -428,7 +428,7 @@ void fgRenderFrame( void ) {
                 << " lon = " << cur_fdm_state->get_Longitude()
                 << " lat = " << cur_fdm_state->get_Latitude() << endl;
            cout << "    sun_rot = " << cur_light_params.sun_rotation
-                << " gst = " << FGTime::cur_time_params->getGst() << endl;
+                << " gst = " << SGTime::cur_time_params->getGst() << endl;
            cout << "    sun ra = " << ephem->getSunRightAscension()
                 << " sun dec = " << ephem->getSunDeclination() 
                 << " moon ra = " << ephem->getMoonRightAscension()
@@ -440,7 +440,7 @@ void fgRenderFrame( void ) {
                                cur_fdm_state->get_Latitude(),
                                cur_fdm_state->get_Altitude() * FEET_TO_METER,
                                cur_light_params.sun_rotation,
-                               FGTime::cur_time_params->getGst(),
+                               SGTime::cur_time_params->getGst(),
                                ephem->getSunRightAscension(),
                                ephem->getSunDeclination(), 50000.0,
                                ephem->getMoonRightAscension(),
@@ -607,7 +607,7 @@ void fgUpdateTimeDepCalcs(int multi_loop, int remainder) {
     static fdm_state_list fdm_list;
     // FGInterface fdm_state;
     fgLIGHT *l = &cur_light_params;
-    FGTime *t = FGTime::cur_time_params;
+    SGTime *t = SGTime::cur_time_params;
     // FGView *v = &current_view;
     int i;
 
@@ -722,7 +722,7 @@ static const double alt_adjust_m = alt_adjust_ft * FEET_TO_METER;
 // What should we do when we have nothing else to do?  Let's get ready
 // for the next move and update the display?
 static void fgMainLoop( void ) {
-    FGTime *t;
+    SGTime *t;
     static long remainder = 0;
     long elapsed;
 #ifdef FANCY_FRAME_COUNTER
@@ -733,7 +733,7 @@ static void fgMainLoop( void ) {
     static int frames = 0;
 #endif // FANCY_FRAME_COUNTER
 
-    t = FGTime::cur_time_params;
+    t = SGTime::cur_time_params;
 
     FG_LOG( FG_ALL, FG_DEBUG, "Running Main Loop");
     FG_LOG( FG_ALL, FG_DEBUG, "======= ==== ====");
@@ -808,7 +808,7 @@ static void fgMainLoop( void ) {
     cur_magvar.update( cur_fdm_state->get_Longitude(),
                       cur_fdm_state->get_Latitude(),
                       cur_fdm_state->get_Altitude()* FEET_TO_METER,
-                      FGTime::cur_time_params->getJD() );
+                      SGTime::cur_time_params->getJD() );
 
     // Get elapsed time (in usec) for this past frame
     elapsed = fgGetTimeInterval();
@@ -1306,15 +1306,15 @@ int main( int argc, char **argv ) {
     guiInit();
 
     // Initialize time
-    FGTime::cur_time_params = new FGTime( current_options.get_fg_root() );
-    // FGTime::cur_time_params->init( cur_fdm_state->get_Longitude(), 
+    SGTime::cur_time_params = new SGTime( current_options.get_fg_root() );
+    // SGTime::cur_time_params->init( cur_fdm_state->get_Longitude(), 
     //                                cur_fdm_state->get_Latitude() );
-    // FGTime::cur_time_params->update( cur_fdm_state->get_Longitude() );
-    FGTime::cur_time_params->init( 0.0, 0.0,
+    // SGTime::cur_time_params->update( cur_fdm_state->get_Longitude() );
+    SGTime::cur_time_params->init( 0.0, 0.0,
                                   current_options.get_fg_root(), 
                                   current_options.get_time_offset(),
                                   current_options.get_time_offset_type() );
-    FGTime::cur_time_params->update( 0.0, 0.0, 0.0 );
+    SGTime::cur_time_params->update( 0.0, 0.0, 0.0 );
 
     // Do some quick general initializations
     if( !fgInitGeneral()) {
@@ -1347,7 +1347,7 @@ int main( int argc, char **argv ) {
     FGPath ephem_data_path( current_options.get_fg_root() );
     ephem_data_path.append( "Astro" );
     ephem = new FGEphemeris( ephem_data_path.c_str() );
-    ephem->update( FGTime::cur_time_params, 0.0 );
+    ephem->update( SGTime::cur_time_params, 0.0 );
 
     FGPath sky_tex_path( current_options.get_fg_root() );
     sky_tex_path.append( "Textures" );
index cef597878e38fb7eed57e5dca0cda8bf87344671..4554821787fbd6be7224e2c60602845fdcbf6ffd 100644 (file)
@@ -42,7 +42,7 @@ bool global_fullscreen = true;
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/fgstream.hxx>
 #include <simgear/misc/props.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Include/general.hxx>
 #include <Cockpit/cockpit.hxx>
@@ -432,7 +432,7 @@ long int fgOPTIONS::parse_date( const string& date)
        num[i] = '\0';
        gmt.tm_sec = atoi(num);
     }
-    time_t theTime = FGTime::cur_time_params->get_gmt(gmt.tm_year,
+    time_t theTime = SGTime::cur_time_params->get_gmt(gmt.tm_year,
                                                       gmt.tm_mon,
                                                      gmt.tm_mday,
                                                      gmt.tm_hour,
index f6830d236e862515060d9ca363f10c8baf31a915..90d02ad84c3ceb697719919d3a776c2e0985d3f9 100644 (file)
@@ -47,7 +47,7 @@ extern bool global_fullscreen;
 #endif
 
 #include <simgear/math/fg_types.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include STL_STRING
 #include <vector>
index 09a0836f117686ce9f28176ae6c54e93bd8d3f7a..f9d6f682a079ea34331338092e8ca78d483aa62a 100644 (file)
@@ -33,7 +33,6 @@
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/vector.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Cockpit/panel.hxx>
index d4c660a73e63f153ca2418b73538a73d8cdb149f..ec5bc00d00a989d925ddb5b544c0f98089854a28 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <simgear/compiler.h>
 #include <simgear/math/point3d.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <list>
 
index 1e3a0464a277065ae55cb56c4b131e9b50e862ab..2505c39db560a47691fe4a64961139761b4dea7a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <FDM/flight.hxx>
 
@@ -67,7 +67,7 @@ bool FGGarmin::gen_message() {
     int deg;
     double min;
 
-    FGTime *t = FGTime::cur_time_params;
+    SGTime *t = SGTime::cur_time_params;
 
     char utc[10];
     sprintf( utc, "%02d%02d%02d", 
index 3586a64f2473a858648c057623eb972776e29c1a..f60f0cc90ae308816e4bf2ed25c08f74aff9b2e2 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include "iochannel.hxx"
 #include "native.hxx"
index 8966a11b19950f896541a071c0e42fb634b831be..c5f33701fcde746bd44e33f7fd28acf0b2e55a85 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <FDM/flight.hxx>
 
@@ -68,7 +68,7 @@ bool FGNMEA::gen_message() {
     int deg;
     double min;
 
-    FGTime *t = FGTime::cur_time_params;
+    SGTime *t = SGTime::cur_time_params;
 
     char utc[10];
     sprintf( utc, "%02d%02d%02d", 
index e3d83808a03a8ee7219fba539b935998e1daac41..d54c3b11b2b12a74f218288a1e567d898907f5ce 100644 (file)
@@ -21,9 +21,9 @@
 // $Id$
 
 
+#include <stdio.h>             // sprintf()
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include <FDM/flight.hxx>
 
index ea6b7e82db4094a683a6f797589a7217a11454b7..df991197476532d8d38d76eb1a1fdd13db08e7e3 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include <FDM/flight.hxx>
 
index 8343b604daa24c70b195be9b041346cd7d5c7c2a..2de08544c7641529f8802e765599c4ac26728bbb 100644 (file)
@@ -25,6 +25,8 @@
 #define _FG_RAY_HXX
 
 
+#include <stdio.h>             // FILE
+
 #include <simgear/compiler.h>
 
 #include STL_STRING
index fcb2ef703cfba52334d86e74d6f66e82923abb22..343e6b154097aa968d288a5c2119c2d6e8f2dea0 100644 (file)
 // $Id$
 
 
+#include <stdio.h>             // sprintf()
+
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include <FDM/flight.hxx>
 
index 2f71d6bff73ae270499d85c233f7c0b1356bea68..56290a48f408e064a9c7c43c3b31529478f7c15a 100644 (file)
@@ -86,13 +86,30 @@ FGTileMgr::~FGTileMgr ( void ) {
 int FGTileMgr::init( void ) {
     FG_LOG( FG_TERRAIN, FG_INFO, "Initializing Tile Manager subsystem." );
 
+    if ( state != Start ) {
+       FG_LOG( FG_TERRAIN, FG_INFO,
+               "ReInitializing the Tile Manager subsystem." );
+
+       // This is necessay to keep bookeeping straight for the
+       // tile_cache   -- which actually handles all the
+       // (de)allocations  
+       while( load_queue.size() ) {
+           FG_LOG( FG_TERRAIN, FG_INFO, 
+                   "Load queue not empty, popping a tile" );
+           FGLoadRec pending = load_queue.front();
+           load_queue.pop_front();
+           load_tile( pending.b, pending.cache_index );
+       }
+    } else {
+       FG_LOG( FG_TERRAIN, FG_INFO,
+               "Initializing Tile Manager subsystem." );
+    }
+
     global_tile_cache.init();
     hit_list.clear();
 
     state = Inited;
 
-    // last_hit = 0;
-
     tile_diameter = current_options.get_tile_diameter();
     FG_LOG( FG_TERRAIN, FG_INFO, "Tile Diameter = " << tile_diameter);
     
@@ -108,15 +125,6 @@ int FGTileMgr::init( void ) {
     return 1;
 }
 
-#if 0
-// schedule a tile for loading
-static void disable_tile( int cache_index ) {
-    // see if tile already exists in the cache
-    // cout << "DISABLING CACHE ENTRY = " << cache_index << endl;
-    FGTileEntry *t = global_tile_cache.get_tile( cache_index );
-    t->ssg_disable();
-}
-#endif
 
 // schedule a tile for loading
 int FGTileMgr::sched_tile( const FGBucket& b ) {
index e1e9ff6fd0470797494e75435918a9c23c35cb6f..c99fc357f5c07039522225ccd360353dae238cdf 100644 (file)
@@ -31,7 +31,6 @@
 
 
 #include <simgear/compiler.h>
-#include <simgear/timing/fg_time.hxx>
 
 #include <Include/fg_callback.hxx>
 
index 8f507a069afa796628e92c4646b2299a86e504e6..192a95180af9b99ec2d2e591c1db29702dbe5cc7 100644 (file)
@@ -36,8 +36,6 @@
 #  include <sys/time.h>  // for get/setitimer, gettimeofday, struct timeval
 #endif
 
-#include <simgear/timing/fg_time.hxx>
-
 #include "fg_timer.hxx"
 #include "timestamp.hxx"
 
index 6850c6475b3887f52cd309e4f4fb456af7204960..56099286c6bc95f734d8c6f81e5aa92cd038e8fd 100644 (file)
@@ -54,7 +54,7 @@ FG_USING_STD(string);
 #include <simgear/math/interpolater.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/misc/fgpath.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Main/options.hxx>
@@ -100,7 +100,7 @@ void fgLIGHT::Init( void ) {
 // update lighting parameters based on current sun position
 void fgLIGHT::Update( void ) {
     FGInterface *f;
-    FGTime *t;
+    SGTime *t;
     // if the 4th field is 0.0, this specifies a direction ...
     GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
     // base sky color
@@ -110,7 +110,7 @@ void fgLIGHT::Update( void ) {
     double deg, ambient, diffuse, sky_brightness;
 
     f = current_aircraft.fdm_state;
-    t = FGTime::cur_time_params;
+    t = SGTime::cur_time_params;
 
     FG_LOG( FG_EVENT, FG_INFO, "Updating light parameters." );
 
index e9c43776954af7ba3bf287423d9109a9e4faafc7..ca6c7abfdcf521c1bb2fc63409e9b75833a440f3 100644 (file)
@@ -58,7 +58,7 @@
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/vector.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Main/views.hxx>
 #include <Scenery/scenery.hxx>
@@ -337,7 +337,7 @@ static void fgMoonPositionGST(double gst, double *lon, double *lat) {
 // update the cur_time_params structure with the current moon position
 void fgUpdateMoonPos( void ) {
     fgLIGHT *l;
-    FGTime *t;
+    SGTime *t;
     FGView *v;
     sgVec3 nup, nmoon, v0, surface_to_moon;
     Point3D p, rel_moonpos;
@@ -345,7 +345,7 @@ void fgUpdateMoonPos( void ) {
     double moon_gd_lat, sl_radius;
 
     l = &cur_light_params;
-    t = FGTime::cur_time_params;
+    t = SGTime::cur_time_params;
     v = &current_view;
 
     FG_LOG( FG_EVENT, FG_INFO, "  Updating Moon position" );
index 918314eecda2be4cd88200e3ad1b00a87265830f..a79d7d2600648e03d54a00c6baf7af53d94c8cd1 100644 (file)
@@ -60,7 +60,7 @@
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/vector.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Main/views.hxx>
 #include <Scenery/scenery.hxx>
@@ -246,7 +246,7 @@ static void fgSunPositionGST(double gst, double *lon, double *lat) {
 // update the cur_time_params structure with the current sun position
 void fgUpdateSunPos( void ) {
     fgLIGHT *l;
-    FGTime *t;
+    SGTime *t;
     FGView *v;
     sgVec3 nup, nsun, v0, surface_to_sun;
     Point3D p, rel_sunpos;
@@ -254,7 +254,7 @@ void fgUpdateSunPos( void ) {
     double sun_gd_lat, sl_radius;
 
     l = &cur_light_params;
-    t = FGTime::cur_time_params;
+    t = SGTime::cur_time_params;
     v = &current_view;
 
     FG_LOG( FG_EVENT, FG_INFO, "  Updating Sun position" );
index 0d5b0cba88c1c2d2a918e89dd551f1c3c4ef6b45..d2fec7dcc00eff5c547565aeed1ac56abf392af0 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 #include <simgear/magvar/magvar.hxx>
-#include <simgear/timing/fg_time.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <FDM/flight.hxx>
 #include <Main/options.hxx>
@@ -58,7 +58,7 @@ FGMagVar cur_magvar;
 // periodic time updater wrapper
 void fgUpdateLocalTime() {
 
-    FGTime::cur_time_params->updateLocal( cur_fdm_state->get_Longitude(),
+    SGTime::cur_time_params->updateLocal( cur_fdm_state->get_Longitude(),
                                          cur_fdm_state->get_Latitude(),
                                          current_options.get_fg_root() );
 }
index 8afe06ef7f7cfb375f4c3e9bf54b3baad83c4202..da85deea137eda0e9db06927520242782d5440c4 100644 (file)
@@ -49,6 +49,7 @@ HISTORY
 /****************************************************************************/
 #include <simgear/compiler.h>
 #include <simgear/constants.h>
+#include <simgear/misc/fgpath.hxx>
 
 #include <Aircraft/aircraft.hxx>
 
@@ -63,7 +64,9 @@ HISTORY
 FGLocalWeatherDatabase* FGLocalWeatherDatabase::theFGLocalWeatherDatabase = 0;
 FGLocalWeatherDatabase *WeatherDatabase;
 
-void FGLocalWeatherDatabase::init(const WeatherPrecision visibility, const DatabaseWorkingType type)
+void FGLocalWeatherDatabase::init( const WeatherPrecision visibility,
+                                  const DatabaseWorkingType type,
+                                  const string& root )
 {
     cerr << "Initializing FGLocalWeatherDatabase\n";
     cerr << "-----------------------------------\n";
@@ -95,7 +98,10 @@ void FGLocalWeatherDatabase::init(const WeatherPrecision visibility, const Datab
        {
            FGWeatherParse *parsed_data = new FGWeatherParse();
 
-           parsed_data->input( "weather/current.gz" );
+           FGPath file( root );
+           file.append( "Weather" );
+           file.append( "current.txt.gz" );
+           parsed_data->input( file.c_str() );
            unsigned int n = parsed_data->stored_stations();
 
            sgVec2               *p = new sgVec2              [n];
@@ -263,15 +269,15 @@ void fgUpdateWeatherDatabase(void)
 
     FGPhysicalProperty my_value = WeatherDatabase->get(position);
     current_aircraft.fdm_state->set_Static_temperature(my_value.Temperature*KTOR);
-       current_aircraft.fdm_state->set_Static_pressure(my_value.AirPressure*PATOPSF);
-       float density=rho0 * 273.15 * my_value.AirPressure / (101300 *my_value.Temperature )*KGMTOSGF;
-       current_aircraft.fdm_state->set_Density(density*KGMTOSGF);
+    current_aircraft.fdm_state->set_Static_pressure(my_value.AirPressure*PATOPSF);
+    float density=rho0 * 273.15 * my_value.AirPressure / (101300 *my_value.Temperature )*KGMTOSGF;
+    current_aircraft.fdm_state->set_Density(density*KGMTOSGF);
        
-       #define KPHTOFPS 0.9113 //km/hr to ft/s
-       #define MSTOFPS  3.2808 //m/s to ft/s
-       current_aircraft.fdm_state->set_Velocities_Local_Airmass(my_value.Wind[1]*KPHTOFPS,
-               my_value.Wind[0]*KPHTOFPS,
-               my_value.Wind[2]*KPHTOFPS);
+#define KPHTOFPS 0.9113 //km/hr to ft/s
+#define MSTOFPS  3.2808 //m/s to ft/s
+    current_aircraft.fdm_state->set_Velocities_Local_Airmass(my_value.Wind[1]*KPHTOFPS,
+                                                            my_value.Wind[0]*KPHTOFPS,
+                                                            my_value.Wind[2]*KPHTOFPS);
        
 }
 
index 7155854ae70dcad9193ea2604a657c55b337cb9e..8dd8aeeb642267149e9287d4bebc5effb4e71717 100644 (file)
@@ -54,6 +54,7 @@ HISTORY
 /* INCLUDES                                                                */
 /****************************************************************************/
 #include <vector>
+#include STL_STRING
 
 #include <plib/sg.h>
 
@@ -71,6 +72,7 @@ HISTORY
 /* DEFINES                                                                 */
 /****************************************************************************/
 FG_USING_STD(vector);
+FG_USING_STD(string);
 FG_USING_NAMESPACE(std);
 
 /****************************************************************************/
@@ -110,19 +112,22 @@ public:
 
     DatabaseWorkingType DatabaseStatus;
 
-    void init( const WeatherPrecision visibility, const DatabaseWorkingType type );
+    void init( const WeatherPrecision visibility,
+              const DatabaseWorkingType type,
+              const string& root );
 
     /************************************************************************/
     /* Constructor and Destructor                                          */
     /************************************************************************/
     FGLocalWeatherDatabase(
        const sgVec3&             position,
+       const string&             root,
        const WeatherPrecision    visibility = DEFAULT_WEATHER_VISIBILITY,
        const DatabaseWorkingType type       = PREFERED_WORKING_TYPE)
     {
        sgCopyVec3( last_known_position, position );
 
-       init( visibility, type );
+       init( visibility, type, root );
 
        theFGLocalWeatherDatabase = this;
     }
@@ -131,12 +136,13 @@ public:
        const WeatherPrecision    position_lat,
        const WeatherPrecision    position_lon,
        const WeatherPrecision    position_alt,
+       const string&             root,
        const WeatherPrecision    visibility = DEFAULT_WEATHER_VISIBILITY,
        const DatabaseWorkingType type       = PREFERED_WORKING_TYPE)
     {
        sgSetVec3( last_known_position, position_lat, position_lon, position_alt );
 
-       init( visibility, type );
+       init( visibility, type, root );
 
        theFGLocalWeatherDatabase = this;
     }
index f1476b0c88c7a507521cebe03e73e3264e6e5a61..f0af6fcfbc3b10990ccd9103a06747042e11c979 100644 (file)
@@ -57,7 +57,8 @@ typedef float WeatherPrecision;
 #define MINIMUM_WEATHER_VISIBILITY 10.0    /* metres */
 #define DEFAULT_WEATHER_VISIBILITY 32000.0 /* metres */
 //prefered way the database is working
-#define PREFERED_WORKING_TYPE default_mode
+// #define PREFERED_WORKING_TYPE default_mode
+#define PREFERED_WORKING_TYPE use_internet
 
 #define FG_WEATHER_DEFAULT_TEMPERATURE   (15.0+273.16)     /*15°C or 288.16°K*/
 #define FG_WEATHER_DEFAULT_VAPORPRESSURE (0.0)             /*in Pascal 1 Pa = N/m^2*/