#endif
#include <GL/glut.h>
-#include <XGL/xgl.h>
+#include <simgear/xgl.h>
#include <stdio.h>
#include <stdlib.h>
# define _G_NO_EXTERN_TEMPLATES
#endif
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
#include STL_STRING
-#include <Debug/logstream.hxx>
+#include <simgear/logstream.hxx>
+#include <simgear/constants.h>
+#include <simgear/fg_geodesy.hxx>
+#include <simgear/point3d.hxx>
+#include <simgear/polar3d.hxx>
+#include <simgear/fgpath.hxx>
+
#include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx>
#include <Astro/sky.hxx>
#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx>
-// #include <FDM/Balloon.h>
+#include <FDM/Balloon.h>
+#include <FDM/External.hxx>
#include <FDM/JSBsim.hxx>
#include <FDM/LaRCsim.hxx>
#include <FDM/MagicCarpet.hxx>
-#include <Include/fg_constants.h>
#include <Include/general.hxx>
#include <Joystick/joystick.hxx>
-#include <Math/fg_geodesy.hxx>
-#include <Math/point3d.hxx>
-#include <Math/polar3d.hxx>
-#include <Misc/fgpath.hxx>
#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Time/event.hxx>
#endif
#include "fg_init.hxx"
+#include "fg_io.hxx"
#include "options.hxx"
#include "views.hxx"
-#include "fg_serial.hxx"
#if defined(FX) && defined(XMESA)
#include <GL/xmesa.h>
return false;
}
- return true;
+ return true;
}
// General house keeping initializations
bool fgInitGeneral( void ) {
string root;
+
+#if defined(FX) && defined(XMESA)
char *mesa_win_state;
+#endif
FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" );
FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" );
cur_fdm_state = new FGLaRCsim;
} else if ( current_options.get_flight_model() == FGInterface::FG_JSBSIM ) {
cur_fdm_state = new FGJSBsim;
- // } else if ( current_options.get_flight_model() ==
- // FGInterface::FG_BALLOONSIM ) {
- // cur_fdm_state = new FGBalloonSim;
+ } else if ( current_options.get_flight_model() ==
+ FGInterface::FG_BALLOONSIM ) {
+ cur_fdm_state = new FGBalloonSim;
} else if ( current_options.get_flight_model() ==
FGInterface::FG_MAGICCARPET ) {
cur_fdm_state = new FGMagicCarpet;
+ } else if ( current_options.get_flight_model() ==
+ FGInterface::FG_EXTERNAL ) {
+ cur_fdm_state = new FGExternal;
} else {
FG_LOG( FG_GENERAL, FG_ALERT,
"No flight model, can't init aircraft" );
fgMethodCallback<fgLIGHT>( &cur_light_params,
&fgLIGHT::Update),
fgEVENT::FG_EVENT_READY, 30000 );
+ // update the current timezone each 30 minutes
+ global_events.Register( "fgTIME::updateLocal()",
+ fgMethodCallback<FGTime>(FGTime::cur_time_params,
+ &FGTime::updateLocal),
+ fgEVENT::FG_EVENT_READY, 1800000);
// Initialize the weather modeling subsystem
#ifndef FG_OLD_WEATHER
// Initialize the WeatherDatabase
FG_LOG(FG_GENERAL, FG_INFO, "Creating LocalWeatherDatabase");
+ sgVec3 position;
+ sgSetVec3( position, current_aircraft.fdm_state->get_Latitude(),
+ current_aircraft.fdm_state->get_Longitude(),
+ current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER );
FGLocalWeatherDatabase::theFGLocalWeatherDatabase =
- new FGLocalWeatherDatabase(
- Point3D( current_aircraft.fdm_state->get_Latitude(),
- current_aircraft.fdm_state->get_Longitude(),
- current_aircraft.fdm_state->get_Altitude()
- * FEET_TO_METER) );
+ new FGLocalWeatherDatabase( position );
+ // cout << theFGLocalWeatherDatabase << endl;
+ // cout << "visibility = "
+ // << theFGLocalWeatherDatabase->getWeatherVisibility() << endl;
WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;
-
+
// register the periodic update of the weather
global_events.Register( "weather update", fgUpdateWeatherDatabase,
- fgEVENT::FG_EVENT_READY, 30000);
+ fgEVENT::FG_EVENT_READY, 30000);
#else
current_weather.Init();
#endif
// Autopilot init added here, by Jeff Goeke-Smith
fgAPInit(¤t_aircraft);
- // Initialize serial ports
+ // Initialize I/O channels
#if ! defined( MACOS )
- fgSerialInit();
+ fgIOInit();
#endif
FG_LOG( FG_GENERAL, FG_INFO, endl);