John Wojnaroski wrote:
> ran ./configure --with-threads --with-weathercm
> 
> Upon compiling:
> 
> g++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src
-I/usr/
> X11R
> 6/include  -g -O2 -D_REENTRANT -c -o atis.o `test -f atis.cxx || echo
> './'`atis.
> cxx
> In file included from atis.cxx:40:
> ../../src/WeatherCM/FGLocalWeatherDatabase.h:63: Main/fgfs.hxx: No such
file
> or
> directory
> make[2]: *** [atis.o] Error 1
> make[2]: Leaving directory `/usr/local/SimFG/source/src/ATC'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/SimFG/source/src'
> make: *** [all-recursive] Error 1
> 
> Looking back it appears this file no longer exists in 0.9.3.
> 

The following diffs will get FG compiling with WeatherCM.  There's an
obvious hack in fg_commands.cxx!  It still doesn't run well though - the
vacuum instruments don't work, visibility isn't respected, clouds aren't
generated as per dialog settings.  As far as I can see, unless it is made
into a runtime option instead of compile time no-one will test against it,
since that requires two full FG rebuilds, and the interface will continue
to change from under it.

I'm still not entirely sure what it was meant to do - can anyone give a
simple explanation of the differences (current and planned) between the two
weather subsystems?

Now, can I change 'ATC' to 'ZTC' so that stuff like this breaks when called
from someone elses code ;-)

Cheers - Dave

Index: src/Main/fg_commands.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_commands.cxx,v
retrieving revision 1.50
diff -u -r1.50 fg_commands.cxx
--- src/Main/fg_commands.cxx    31 Jan 2004 19:47:46 -0000      1.50
+++ src/Main/fg_commands.cxx    2 Feb 2004 21:54:47 -0000
@@ -529,11 +529,16 @@
     static const SGPropertyNode *altitude_ft
       = fgGetNode("/position/altitude-ft");

-    FGEnvironment dummy;       // instantiate a dummy so we can leech a
method
+#ifdef FG_WEATHERCM
+    // FIXME
+    double temp_sea_level_degc = 15.0;
+#else
+    FGEnvironment dummy;       // instantiate a dummy so we can leech a
method
     dummy.set_elevation_ft( altitude_ft->getDoubleValue() );
     dummy.set_temperature_degc( atof( temp_str.c_str() ) );
     double temp_sea_level_degc = dummy.get_temperature_sea_level_degc();
-
+#endif
+
     cout << "Altitude = " << altitude_ft->getDoubleValue() << endl;
     cout << "Temp at alt (C) = " << atof( temp_str.c_str() ) << endl;
     cout << "Temp sea level (C) = " << temp_sea_level_degc << endl;
Index: src/Main/fg_init.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_init.cxx,v
retrieving revision 1.84
diff -u -r1.84 fg_init.cxx
--- src/Main/fg_init.cxx        31 Jan 2004 19:47:46 -0000      1.84
+++ src/Main/fg_init.cxx        2 Feb 2004 21:54:48 -0000
@@ -1583,7 +1583,7 @@
     WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;

     // register the periodic update of the weather
-    globals->get_event_mgr()->add( "weather update",
+    globals->get_event_mgr()->addTask( "weather update",
                                    &fgUpdateWeatherDatabase, 30000);
 #else
     globals->add_subsystem("environment", new FGEnvironmentMgr);
Index: src/Main/fg_props.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_props.cxx,v
retrieving revision 1.16
diff -u -r1.16 fg_props.cxx
--- src/Main/fg_props.cxx       25 Nov 2003 17:10:36 -0000      1.16
+++ src/Main/fg_props.cxx       2 Feb 2004 21:54:49 -0000
@@ -443,7 +443,7 @@
 static void
 setWindEast (double speed)
 {
-  SG_LOG(SG_GENERAL, SG_INFO,, "Set wind-east to " << speed );
+  SG_LOG(SG_GENERAL, SG_INFO, "Set wind-east to " << speed );
   current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
                                                           speed,
                                                           getWindDown());
Index: src/Main/options.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/options.cxx,v
retrieving revision 1.49
diff -u -r1.49 options.cxx
--- src/Main/options.cxx        31 Jan 2004 19:47:46 -0000      1.49
+++ src/Main/options.cxx        2 Feb 2004 21:54:50 -0000
@@ -590,8 +590,8 @@
   while (min_hdg <= 0)
     min_hdg += 360;
   min_hdg *= SGD_DEGREES_TO_RADIANS;
-  fgSetDouble("/environment/wind-from-north-fps", speed * cos(dir));
-  fgSetDouble("/environment/wind-from-east-fps", speed * sin(dir));
+  fgSetDouble("/environment/wind-from-north-fps", speed * cos(min_hdg));
+  fgSetDouble("/environment/wind-from-east-fps", speed * sin(min_hdg));
 #endif // FG_WEATHERCM
 }

Index: src/WeatherCM/FGLocalWeatherDatabase.h
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/FlightGear/src/WeatherCM/FGLocalWeatherDatabase.h,v
retrieving revision 1.2
diff -u -r1.2 FGLocalWeatherDatabase.h
--- src/WeatherCM/FGLocalWeatherDatabase.h      6 May 2003 23:54:20 -0000
    1.2
+++ src/WeatherCM/FGLocalWeatherDatabase.h      2 Feb 2004 21:54:50 -0000
@@ -60,7 +60,7 @@

 #include <plib/sg.h>

-#include <Main/fgfs.hxx>
+#include <Main/globals.hxx>

 #include <simgear/constants.h>
 #include <simgear/props/props.hxx>
@@ -94,7 +94,7 @@
     FGPhysicalProperty last_known_property;
 };

-class FGLocalWeatherDatabase : public FGSubsystem
+class FGLocalWeatherDatabase : public SGSubsystem
 {
 private:
 protected:



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to