]> git.mxchange.org Git - flightgear.git/commitdiff
Move FGEventMgr and FGSubsystemMgr over to SimGear, add SGEventMgr to FlightGear...
authorehofman <ehofman>
Wed, 24 Sep 2003 17:20:55 +0000 (17:20 +0000)
committerehofman <ehofman>
Wed, 24 Sep 2003 17:20:55 +0000 (17:20 +0000)
88 files changed:
src/ATC/AIMgr.cxx
src/ATC/AIMgr.hxx
src/ATC/ATC.cxx
src/ATC/ATCDialog.cxx
src/ATC/ATCdisplay.hxx
src/ATC/ATCmgr.cxx
src/ATC/ATCmgr.hxx
src/Aircraft/aircraft.cxx
src/Autopilot/newauto.hxx
src/Cockpit/dme.cxx
src/Cockpit/dme.hxx
src/Cockpit/hud.cxx
src/Cockpit/kr_87.cxx
src/Cockpit/kr_87.hxx
src/Cockpit/kt_70.hxx
src/Cockpit/marker_beacon.cxx
src/Cockpit/marker_beacon.hxx
src/Cockpit/navcom.cxx
src/Cockpit/navcom.hxx
src/Cockpit/panel.hxx
src/Cockpit/panel_io.cxx
src/Cockpit/radiostack.cxx
src/Cockpit/radiostack.hxx
src/Controls/controls.hxx
src/Environment/environment.hxx
src/Environment/environment_ctrl.hxx
src/Environment/environment_mgr.cxx
src/Environment/environment_mgr.hxx
src/FDM/flight.hxx
src/GUI/gui.cxx
src/GUI/gui.h
src/GUI/new_gui.cxx
src/GUI/new_gui.hxx
src/GUI/preset_dlg.cxx
src/Include/Makefile.am
src/Input/input.hxx
src/Instrumentation/airspeed_indicator.hxx
src/Instrumentation/altimeter.hxx
src/Instrumentation/annunciator.hxx
src/Instrumentation/attitude_indicator.hxx
src/Instrumentation/clock.hxx
src/Instrumentation/dme.hxx
src/Instrumentation/gps.hxx
src/Instrumentation/heading_indicator.hxx
src/Instrumentation/instrument_mgr.hxx
src/Instrumentation/mag_compass.hxx
src/Instrumentation/slip_skid_ball.hxx
src/Instrumentation/turn_indicator.hxx
src/Instrumentation/vertical_speed_indicator.hxx
src/Main/Makefile.am
src/Main/bootstrap.cxx
src/Main/fg_commands.cxx
src/Main/fg_commands.hxx
src/Main/fg_init.cxx
src/Main/fg_io.hxx
src/Main/fg_props.cxx
src/Main/fgfs.cxx [deleted file]
src/Main/fgfs.hxx [deleted file]
src/Main/globals.cxx
src/Main/globals.hxx
src/Main/logger.hxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/viewer.hxx
src/Main/viewmgr.hxx
src/Model/acmodel.cxx
src/Model/acmodel.hxx
src/Model/model_panel.cxx
src/Model/modelmgr.hxx
src/Network/generic.cxx
src/Network/httpd.cxx
src/Network/props.cxx
src/Replay/replay.hxx
src/Scenery/scenery.hxx
src/Scenery/tilemgr.cxx
src/Scripting/scriptmgr.hxx
src/Sound/fg_fx.cxx
src/Sound/fg_fx.hxx
src/Systems/electrical.cxx
src/Systems/electrical.hxx
src/Systems/pitot.hxx
src/Systems/static.hxx
src/Systems/system_mgr.hxx
src/Systems/vacuum.hxx
src/Time/FGEventMgr.cxx [deleted file]
src/Time/FGEventMgr.hxx [deleted file]
src/Time/Makefile.am
src/Time/light.hxx

index 871feb8b461f58ed6ef5511c85470c2179c8d471..c0a6ec9a8326c1149547fd0b9c11ccf8312ce97e 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-#include <Main/fgfs.hxx>
+#include <simgear/misc/sg_path.hxx>
+
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
-#include <simgear/misc/sg_path.hxx>
 
 #include <list>
 
index a186d1307ccde231cdcf0f6307dad8a56abc2d10..2c67eb020fb3bd946cfe0d687b9d6fa2e22d37e7 100644 (file)
@@ -22,7 +22,8 @@
 #ifndef _FG_AIMGR_HXX
 #define _FG_AIMGR_HXX
 
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
+
 #include <Main/fg_props.hxx>
 
 #include <list>
@@ -33,7 +34,7 @@
 SG_USING_STD(list);
 
 
-class FGAIMgr : public FGSubsystem
+class FGAIMgr : public SGSubsystem
 {
 
 private:
index 2a51b89a5ff738f98ca726b95b18fd16693c8ec5..d8fc4b737c6538aae41652f52a121235c07e6aa3 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <simgear/sound/soundmgr.hxx>
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include "ATC.hxx"
index 9566e1da682411203516df123e28e7b31fd87c03..1a4aefa3fe3d9ff67be42fa5feb4096e20a0e27b 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+#include <simgear/structure/commands.hxx>
+
 #include <Main/globals.hxx>
-#include <Main/fgfs.hxx>
 #include <GUI/gui.h>
-#include <simgear/misc/commands.hxx>
 
 #include "ATCDialog.hxx"
 #include "ATC.hxx"
index ba50fd6c52d261ba215d178c86b1e0cd9c131036..c41bb72f8fc0477af09919bda578ddc1443fe11e 100644 (file)
@@ -27,7 +27,7 @@
 #  include <config.h>
 #endif
 
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include <vector>
 #include <string>
@@ -49,7 +49,7 @@ struct atcMessage {
 typedef vector<atcMessage> atcMessageList;
 typedef atcMessageList::iterator atcMessageListIterator;
 
-class FGATCDisplay : public FGSubsystem 
+class FGATCDisplay : public SGSubsystem 
 {
 
 private:
index fca3054171ae50210976327cad984505b42cde0f..fc300d1af1239ad234fbcb7e31b845ba38fac233 100644 (file)
@@ -18,8 +18,6 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-//#include <Time/event.hxx>
-
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <Airports/simple.hxx>
@@ -36,6 +34,7 @@ static void fgATCSearch( void ) {
        globals->get_ATC_mgr()->Search();
 }
 */ //This wouldn't compile - including Time/event.hxx breaks it :-(
+   // Is this still true?? -EMH-
 
 AirportATC::AirportATC() :
     lon(0.0),
@@ -90,9 +89,12 @@ void FGATCMgr::init() {
        atc_list_itr = atc_list.begin();
        
        // Search for connected ATC stations once per 0.8 seconds or so
-       // global_events.Register( "fgATCSearch()", fgATCSearch,
-       //                  fgEVENT::FG_EVENT_READY, 800);
+       // globals->get_event_mgr()->add( "fgATCSearch()", fgATCSearch,
+        //                                 FGEvent::FG_EVENT_READY, 800);
+        //  
        // For some reason the above doesn't compile - including Time/event.hxx stops compilation.
+        // Is this still true after the reorganization of the event managar??
+        // -EMH-
        
        // Initialise the frequency search map
     current_commlist = new FGCommList;
index 6c1960fe2271e71586c5a25d0864bb7cf1848b8a..f4c363d0efa71cf5068f652bd0c96d77a68703a8 100644 (file)
@@ -22,7 +22,8 @@
 #ifndef _FG_ATCMGR_HXX
 #define _FG_ATCMGR_HXX
 
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
+
 #include <Main/fg_props.hxx>
 #include <GUI/gui.h>
 
@@ -72,7 +73,7 @@ struct AirportATC {
     bool set_by_comm[2];       // true when the relevant comm_freq has activated this station
 };
 
-class FGATCMgr : public FGSubsystem
+class FGATCMgr : public SGSubsystem
 {
 
 private:
index bfe7c81ba9b5ee9b362b4b44aab703e35a2cb7c1..1fe90e128c82cc8dc2152da2a43e2896f4682fec 100644 (file)
@@ -30,8 +30,8 @@
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
-#include <simgear/misc/commands.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/commands.hxx>
+#include <simgear/structure/exception.hxx>
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
@@ -41,7 +41,6 @@
 #include <Cockpit/panel_io.hxx>
 #include <Model/acmodel.hxx>
 #include <Autopilot/newauto.hxx>
-#include <Main/fgfs.hxx>
 
 #include "aircraft.hxx"
 
index 9e95c72780e588ddc639c0e2b011a2e1fab093b6..49e88c4516e7485d62665cf83d5b03f7459cec84 100644 (file)
 
 
 #include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/route/waypoint.hxx>
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 // Structures
-class FGAutopilot : public FGSubsystem
+class FGAutopilot : public SGSubsystem
 {
 
 public:
@@ -165,7 +165,7 @@ public:
 
 \f
     ////////////////////////////////////////////////////////////////////
-    // Implementation of FGSubsystem.
+    // Implementation of SGSubsystem.
     ////////////////////////////////////////////////////////////////////
 
     void init ();
index aa07a7559ac15540e47bf6f7fe3f7cbd66435f21..7fe470c9fa928ef54b5a34a7f1c0833baafbc2ea 100644 (file)
@@ -34,7 +34,6 @@
 #include <Navaids/ilslist.hxx>
 #include <Navaids/mkrbeacons.hxx>
 #include <Navaids/navlist.hxx>
-#include <Time/FGEventMgr.hxx>
 
 #include "dme.hxx"
 
index e16acfe7ed8d591853cb7bd5d9cac0fe9677e62c..5b1483fc505775c77ab8c4300f8143824adffb83 100644 (file)
 #define _FG_DME_HXX
 
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include <simgear/compiler.h>
-
+#include <simgear/structure/subsystem_mgr.hxx>
 // #include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -42,7 +41,7 @@
 // #include "kt_70.hxx"            // Transponder
 // #include "navcom.hxx"
 
-class FGDME : public FGSubsystem
+class FGDME : public SGSubsystem
 {
     SGPropertyNode *lon_node;
     SGPropertyNode *lat_node;
index 10762dbd8f5e2ffbad9461cb812e5fe6ee5a65eb..3b3285dfa5299487faf2d3b3e1c2b02b0a8f6c02 100644 (file)
@@ -21,7 +21,7 @@
 // $Id$
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 
 #include STL_STRING
 #include STL_FSTREAM
index 34489803ca23cc9a8e7af719bd48aa92ab5a5058..94e7acca310d90b3aa221485f53db645c92892c3 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <Aircraft/aircraft.hxx>
 #include <Navaids/navlist.hxx>
-#include <Time/FGEventMgr.hxx>
 
 #include "kr_87.hxx"
 
index 77ec6d4a8ec61df5e33fc2ff002f81c0a09b4d1a..b056f5e8dcc5ff6466acc4d59cebdba2c0248f76 100644 (file)
 #define _FG_KR_87_HXX
 
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include <simgear/compiler.h>
-
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/timing/timestamp.hxx>
 
 #include <Navaids/navlist.hxx>
 #include <Sound/morse.hxx>
 
 
-class FGKR_87 : public FGSubsystem
+class FGKR_87 : public SGSubsystem
 {
     FGMorse morse;
 
index 8355bdd16de72943e58fe893be2d6c9704724fa9..7fdb649e128bc1197243fe4c126f8f73de82dc6f 100644 (file)
 #define _FG_KT_70_HXX
 
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include <simgear/compiler.h>
-
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -38,7 +37,7 @@
 #include <Sound/morse.hxx>
 
 
-class FGKT_70 : public FGSubsystem
+class FGKT_70 : public SGSubsystem
 {
     SGPropertyNode *lon_node;
     SGPropertyNode *lat_node;
index b668f550ec09317f54bf791a843250ddb1062b35..88e3e03708ca964299039485c412dbbe3a4baa4b 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <Aircraft/aircraft.hxx>
 #include <Navaids/mkrbeacons.hxx>
-#include <Time/FGEventMgr.hxx>
 
 #include "marker_beacon.hxx"
 
index 6182f2759c4cd40814b1a7a78d2a77d4a4e31330..aa6d930bf02b7f46abfd8666d29d85b82cd1c753 100644 (file)
 #define _FG_MARKER_BEACON_HXX
 
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include <simgear/compiler.h>
-
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -37,7 +36,7 @@
 #include <Sound/morse.hxx>
 
 
-class FGMarkerBeacon : public FGSubsystem
+class FGMarkerBeacon : public SGSubsystem
 {
     FGBeacon beacon;
     FGMorse morse;
index 9fe214a517763a1ca9159cfb389584c79de95798..a3525f5e4d66f9b750b57f02d9cfe6050308674a 100644 (file)
@@ -34,7 +34,6 @@
 #include <Aircraft/aircraft.hxx>
 #include <Navaids/ilslist.hxx>
 #include <Navaids/navlist.hxx>
-#include <Time/FGEventMgr.hxx>
 
 #include "navcom.hxx"
 
index 5e6434aee43294138ed92b5692c690dfe2043f9f..b05a2f9c42833661ebe621a72a80126157415b1e 100644 (file)
 #define _FG_NAVCOM_HXX
 
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include <simgear/compiler.h>
-
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -37,7 +36,7 @@
 #include <Navaids/navlist.hxx>
 #include <Sound/morse.hxx>
 
-class FGNavCom : public FGSubsystem
+class FGNavCom : public SGSubsystem
 {
     FGMorse morse;
 
index d39a2a2d5d4b5b807a27486ebdeead18de135c20..624ccfc16f1ec69416ab3510cdc824717434374a 100644 (file)
 #  include <config.h>
 #endif
 
-#include <simgear/compiler.h>
-
-#ifdef HAVE_WINDOWS_H          
+#ifdef HAVE_WINDOWS_H
 #  include <windows.h>
 #endif
 
 #include <plib/ssg.h>
+#include <plib/fnt.h>
 
-#include <simgear/math/interpolater.hxx>
+#include <simgear/compiler.h>
 #include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
 #include <cmath>
 #include <vector>
 #include <map>
-#include <plib/fnt.h>
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
-
 #include <Input/input.hxx>
 
 SG_USING_STD(vector);
@@ -130,7 +128,7 @@ private:
  * redraw themselves when necessary, and will pass mouse clicks on to
  * the appropriate instruments for processing.
  */
-class FGPanel : public FGSubsystem
+class FGPanel : public SGSubsystem
 {
 public:
 
index 28435e20fdd5320d512ddaf6daa4c6a0307085b5..e24aafc62b8744c987520ea750721735754e4615 100644 (file)
@@ -29,8 +29,7 @@
 #include <string.h>            // for strcmp()
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
-
+#include <simgear/structure/exception.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
index 6566daf7e8d9e9d929c7a6c226a88dd0979b09c8..9af2567dc713d44008b4a14e822a723d77be4a86 100644 (file)
@@ -34,7 +34,6 @@
 #include <Navaids/ilslist.hxx>
 #include <Navaids/mkrbeacons.hxx>
 #include <Navaids/navlist.hxx>
-#include <Time/FGEventMgr.hxx>
 
 #include "radiostack.hxx"
 
@@ -78,9 +77,8 @@ FGRadioStack::init ()
     update(0);                 // FIXME: use dt
 
     // Search radio database once per second
-    global_events.Register( "fgRadioSearch()",
-                           current_radiostack, &FGRadioStack::search,
-                           1000 );
+    globals->get_event_mgr()->add( "fgRadioSearch()", current_radiostack,
+                                   &FGRadioStack::search, 1000 );
 }
 
 
index 42093a4a68282afb14ed7e189ef2a941795c5c51..4d2255214ce2a800763f92621795d1432d8c6a54 100644 (file)
 #define _FG_RADIOSTACK_HXX
 
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 #include <simgear/compiler.h>
-
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -45,7 +44,7 @@
 #include "navcom.hxx"
 
 
-class FGRadioStack : public FGSubsystem
+class FGRadioStack : public SGSubsystem
 {
     FGDME dme;
     FGKR_87 adf;                // King KR 87 Digital ADF model
index 2e467a5ae5fdb02f1c670289c129d59cd546bb38..2f70b38f0d554b98759d2b30239affb506362d8f 100644 (file)
@@ -25,8 +25,8 @@
 #define _CONTROLS_HXX
 
 #include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
-#include <Main/fgfs.hxx>
 #include <Main/globals.hxx>
 
 #ifndef __cplusplus                                                          
@@ -36,7 +36,7 @@
 
 // Define a structure containing the control parameters
 
-class FGControls : public FGSubsystem
+class FGControls : public SGSubsystem
 {
 
 public:
@@ -240,7 +240,7 @@ public:
     FGControls();
     ~FGControls();
 
-    // Implementation of FGSubsystem.
+    // Implementation of SGSubsystem.
     void init ();
     void bind ();
     void unbind ();
index dafea47cf03f69a1dfed7adaba24a41c2dae2db4..73320de1e4aa69b0d5671958b89d0bdf9d9361f8 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <simgear/compiler.h>
 
-#include <Main/fgfs.hxx>
-
 #ifdef SG_HAVE_STD_INCLUDES
 #  include <cmath>
 #else
index f9e0d59304a319572bb27e957e0843374d20e689..75a8a00a74db1bacf598a338b1bea780802b7cca 100644 (file)
@@ -24,6 +24,7 @@
 #define _ENVIRONMENT_CTRL_HXX
 
 #include <simgear/compiler.h>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #ifdef SG_HAVE_STD_INCLUDES
 #  include <cmath>
@@ -37,8 +38,6 @@ SG_USING_STD(vector);
 
 class SGPropertyNode;
 
-#include <Main/fgfs.hxx>
-
 #include "environment.hxx"
 
 
@@ -46,7 +45,7 @@ class SGPropertyNode;
 /**
  * Interface to control environment information for a specific location.
  */
-class FGEnvironmentCtrl : public FGSubsystem
+class FGEnvironmentCtrl : public SGSubsystem
 {
 
 public:
index 48690bafe0a50ba4f58abcb1b4d70e65b5f55691..08984463a015017c2f6f041a4b7321459836823a 100644 (file)
@@ -50,7 +50,7 @@ void
 FGEnvironmentMgr::init ()
 {
   SG_LOG( SG_GENERAL, SG_INFO, "Initializing environment subsystem");
-  FGSubsystemGroup::init();
+  SGSubsystemGroup::init();
   _update_fdm();
 }
 
@@ -58,7 +58,7 @@ void
 FGEnvironmentMgr::reinit ()
 {
   SG_LOG( SG_GENERAL, SG_INFO, "Reinitializing environment subsystem");
-  FGSubsystemGroup::reinit();
+  SGSubsystemGroup::reinit();
   _update_fdm();
 }
 
@@ -176,7 +176,7 @@ FGEnvironmentMgr::unbind ()
 void
 FGEnvironmentMgr::update (double dt)
 {
-  FGSubsystemGroup::update(dt);
+  SGSubsystemGroup::update(dt);
 
                                // FIXME: the FDMs should update themselves
   current_aircraft.fdm_state
index 33204bc60182340f80fa69eb4a387e5b0f33d658..abef848f54fa0801d1a4158f178b2762dad60323 100644 (file)
@@ -24,8 +24,7 @@
 #define _ENVIRONMENT_MGR_HXX
 
 #include <simgear/compiler.h>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #ifdef SG_HAVE_STD_INCLUDES
 #  include <cmath>
@@ -40,7 +39,7 @@ class FGEnvironmentCtrl;
 /**
  * Manage environment information.
  */
-class FGEnvironmentMgr : public FGSubsystemGroup
+class FGEnvironmentMgr : public SGSubsystemGroup
 {
 
 public:
index 810ec38b80ac2f84801628128c37ef03fb74b00d..6ecd8730c6eba2c0ab0804bdf869ced099ea0138 100644 (file)
  */
 
 
-#include <simgear/compiler.h>
-
 #include <math.h>
 
 #include <list>
 #include <vector>
 #include <string>
 
+#include <simgear/compiler.h>
 #include <simgear/constants.h>
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 SG_USING_STD(list);
 SG_USING_STD(vector);
@@ -102,7 +101,7 @@ class FGAircraftModel;
 typedef double FG_VECTOR_3[3];
 
 // This is based heavily on LaRCsim/ls_generic.h
-class FGInterface : public FGSubsystem {
+class FGInterface : public SGSubsystem {
 
 private:
   
index 42272e8651073e8735b847a113e5947f7fd2e756..4f07a7049cffe9a23171221e4e90c10f7c09b1c2 100644 (file)
@@ -34,7 +34,7 @@
 #  include <windows.h>
 #endif
 
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
index 18794e5a761532f6c99967ad246c7e889b51c884..33bf3def5294c8b7c98a3313765670e09cf9a84f 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <plib/pu.h>           // plib include
 
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 
 #define TR_HIRES_SNAP   1
 
index 63f41cba969ed3dc994eedf5b7233f6b6ee30a07..f6e087ca91a1ad602d9ee7c8ac60cc103561a9db 100644 (file)
@@ -6,7 +6,8 @@
 #include <plib/ul.h>
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
+
 #include <Main/fg_props.hxx>
 
 #include "menubar.hxx"
index 35cc3d831532f782d188c561d17b62b657e5f9b3..c0cda22b31f27a4d30bb51f89d8cd253366aebae 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <simgear/compiler.h>  // for SG_USING_STD
 #include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include <vector>
 SG_USING_STD(vector);
@@ -18,7 +19,6 @@ SG_USING_STD(vector);
 #include <map>
 SG_USING_STD(map);
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 
 class FGMenuBar;
@@ -35,7 +35,7 @@ class FGBinding;
  * for XML-configured dialog boxes found in $FG_ROOT/gui/dialogs/.  It
  * can show or hide the menubar, and can display any dialog by name.
  */
-class NewGUI : public FGSubsystem
+class NewGUI : public SGSubsystem
 {
 public:
 
index 97e9f9803b9ac518e4bb1ae12722e95a2d77005d..d13ad4787b36c15114cacba18070a4a68755ce10 100644 (file)
@@ -31,7 +31,7 @@
 #  include <windows.h>
 #endif
 
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/misc/sg_path.hxx>
 
 #include <Main/fg_props.hxx>
index fd432745da7b69d9cf519a7efa0da74d6815405b..6764b99aa401a311178ca655d8316771e15685db 100644 (file)
@@ -3,7 +3,6 @@ EXTRA_DIST = \
        config.h.in \
        config.h-msvc6 \
        cmdargs.h \
-       fg_callback.hxx \
        fg_typedefs.h \
        fg_stl_config.h \
        general.hxx
index 690619ec3f478bddc13b6f36e4c8641268a23e0b..c3f980f0d1d5a44a3783d931e930b87e3c53d14f 100644 (file)
 
 #include <simgear/compiler.h>
 
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/props/condition.hxx>
 #include <simgear/props/props.hxx>
 
-#include <Main/fgfs.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 
@@ -166,7 +166,7 @@ private:
  * keyboard, joystick, mouse, or even panel switches -- in a consistent
  * way, and to allow users to rebind any of the actions at runtime.</p>
  */
-class FGInput : public FGSubsystem
+class FGInput : public SGSubsystem
 {
 public:
 
@@ -192,7 +192,7 @@ public:
   virtual ~FGInput();
 
   //
-  // Implementation of FGSubsystem.
+  // Implementation of SGSubsystem.
   //
   virtual void init ();
   virtual void update (double dt);
index 8f0cfd45d699e3b35824b63b7166a9ef680b0727..0572a0eb120b5a97c2fec2a6c5cdcb72ccadb6e6 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -30,7 +29,7 @@
  *
  * /instrumentation/airspeed-indicator/indicated-speed-kt
  */
-class AirspeedIndicator : public FGSubsystem
+class AirspeedIndicator : public SGSubsystem
 {
 
 public:
index 0615e021a0a121f3ce19f93313b55d726256f1a9..73c1c2c02aa628f6b80fde0c28d7c65df4f83150 100644 (file)
@@ -12,7 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 class SGInterpTable;
@@ -31,7 +31,7 @@ class SGInterpTable;
  *
  * /instrumentation/altimeter/indicated-altitude-ft
  */
-class Altimeter : public FGSubsystem
+class Altimeter : public SGSubsystem
 {
 
 public:
index 8938de4c466b6fd7d8bd390f84fc403c19e923af..2834f8c25e3bff86878b1925488b57e2bac564ec 100644 (file)
@@ -10,8 +10,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -28,7 +27,7 @@
  *
  * /instrumentation/airspeed-indicator/indicated-speed-kt
  */
-class Annunciator : public FGSubsystem
+class Annunciator : public SGSubsystem
 {
 
     // timers
index db68dd98bda7ba75e96fd4b26620a3fcc06bd073..b71e742c21f188ee31668e98bb3c6afb75f66fc3 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include "gyro.hxx"
 
@@ -39,7 +38,7 @@
  * /instrumentation/attitude-indicator/indicated-roll-deg
  * /instrumentation/attitude-indicator/tumble-norm
  */
-class AttitudeIndicator : public FGSubsystem
+class AttitudeIndicator : public SGSubsystem
 {
 
 public:
index 25fcd659fc379940f5b3eee152d11876c1c971b6..0e35f0441dca13211fdc359fef955aa4d1b92ef4 100644 (file)
@@ -14,8 +14,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -31,7 +30,7 @@
  * /instrumentation/clock/indicated-sec
  * /instrumentation/clock/indicated-string
  */
-class Clock : public FGSubsystem
+class Clock : public SGSubsystem
 {
 
 public:
index c70c43ab8ca76e06294b889f5fefa3ec18f7a766..39fbf2eaab434d5c25013919d2a4995c596fc7a4 100644 (file)
@@ -13,8 +13,7 @@
 
 #include <simgear/math/point3d.hxx>
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -37,7 +36,7 @@
  * /instrumentation/dme/indicated-ground-speed-kt
  * /instrumentation/dme/indicated-time-kt
  */
-class DME : public FGSubsystem
+class DME : public SGSubsystem
 {
 
 public:
index 78025aae26da4ae6d4a306a9c06f48066ad48864..72578c61cb909dd0a61ab8d0c9bcf5eee7a166e4 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -37,7 +36,7 @@
  * /instrumentation/gps/indicated-track-magnetic-deg
  * /instrumentation/gps/indicated-ground-speed-kt
  */
-class GPS : public FGSubsystem
+class GPS : public SGSubsystem
 {
 
 public:
index 908495adc39ee140d8387a1f61567fd1828146be..75b1bc5c3c41493e149412a54dc9b87cd3aed067 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include "gyro.hxx"
 
@@ -35,7 +34,7 @@
  *
  * /instrumentation/heading-indicator/indicated-heading-deg
  */
-class HeadingIndicator : public FGSubsystem
+class HeadingIndicator : public SGSubsystem
 {
 
 public:
index f040e26c21a716924a49f85fdf0e16e21bfd8345..11649adabf21d88998fb28d3bf00bede1290ebf0 100644 (file)
@@ -16,8 +16,7 @@
 #endif
 
 #include <simgear/compiler.h>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -26,7 +25,7 @@
  * In the initial draft, the instruments present are hard-coded, but they
  * will soon be configurable for individual aircraft.
  */
-class FGInstrumentMgr : public FGSubsystemGroup
+class FGInstrumentMgr : public SGSubsystemGroup
 {
 public:
 
index f16a22287d38eb67d20c9970993225e43679deee..8f7aafe275f98957ea71f1876eb574f5bc7faec4 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -34,7 +33,7 @@
  *
  * /instrumentation/magnetic-compass/indicated-heading-deg
  */
-class MagCompass : public FGSubsystem
+class MagCompass : public SGSubsystem
 {
 
 public:
index d3e3e076b9922dd126c001a18f53fe84eea049d4..d8ed245c02897724d40bfdb824a14cccb31d147d 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include "gyro.hxx"
 
@@ -31,7 +30,7 @@
  *
  * /instrumentation/slip-skid-ball/indicated-slip-skid
  */
-class SlipSkidBall : public FGSubsystem
+class SlipSkidBall : public SGSubsystem
 {
 
 public:
index 89681cfea29e58f398e7451979611c7e248ff246..5d5028cf1c49805752d817472b75e0b6c6f5def2 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include "gyro.hxx"
 
@@ -36,7 +35,7 @@
  *
  * /instrumentation/turn-indicator/indicated-turn-rate
  */
-class TurnIndicator : public FGSubsystem
+class TurnIndicator : public SGSubsystem
 {
 
 public:
index 007d8ace5ba9bd289d54973cbaf565d5dc2e7e05..f7df642e8aefd6f1d2e8b2b8bf487167da836469 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -28,7 +27,7 @@
  *
  * /instrumentation/vertical-speed-indicator/indicated-speed-fpm
  */
-class VerticalSpeedIndicator : public FGSubsystem
+class VerticalSpeedIndicator : public SGSubsystem
 {
 
 public:
index 0a5134b1f256a32741466fc6f004ed32501b0a4b..a5492ddb015ac28fd6084c87aa8c49339ead3f03 100644 (file)
@@ -54,7 +54,6 @@ libMain_a_SOURCES = \
        fg_init.cxx fg_init.hxx \
        fg_io.cxx fg_io.hxx \
        fg_props.cxx fg_props.hxx \
-        fgfs.cxx fgfs.hxx \
        globals.cxx globals.hxx \
         logger.cxx logger.hxx \
        options.cxx options.hxx \
@@ -102,7 +101,7 @@ fgfs_LDADD = \
        $(CLOUD3D_LIBS) \
        -lsgroute -lsgsky -lsgsound -lsgephem -lsgmaterial -lsgtgdb -lsgmodel \
        -lsgtiming -lsgio -lsgscreen -lsgmath -lsgbucket -lsgprops -lsgdebug \
-       -lsgmagvar -lsgmisc -lsgxml -lsgsound -lsgserial \
+       -lsgmagvar -lsgmisc -lsgxml -lsgsound -lsgserial -lsgstructure \
        $(THREAD_LIBS) \
        -lplibpu -lplibfnt -lplibjs -lplibnet -lplibssg -lplibsg -lplibul \
        $(network_LIBS) \
index 6ee3eb1501494f274c3b77b436b3cbc696b8252f..588f1ab077f29f62019e9f59d160ebf253d02f40 100644 (file)
@@ -33,7 +33,7 @@
 #include <stdlib.h>
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/debug/logstream.hxx>
 
 #include STL_IOSTREAM
index 69ab356f376b0d19df2d4c62f87e27e56d7790ea..6769654f5ed3cf5af8cbd4960caa6049d30e503a 100644 (file)
@@ -3,7 +3,6 @@
 #include <string.h>            // strcmp()
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
 
 #include STL_STRING
 #include STL_FSTREAM
@@ -11,7 +10,8 @@
 #include <simgear/sg_inlines.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/sg_random.h>
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/exception.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/props/props.hxx>
 
 #include <Cockpit/panel.hxx>
@@ -202,7 +202,7 @@ do_reinit (const SGPropertyNode * arg)
     } else {
         for ( unsigned int i = 0; i < subsystems.size(); i++ ) {
             const char * name = subsystems[i]->getStringValue();
-            FGSubsystem * subsystem = globals->get_subsystem(name);
+            SGSubsystem * subsystem = globals->get_subsystem(name);
             if (subsystem == 0) {
                 result = false;
                 SG_LOG( SG_GENERAL, SG_ALERT,
@@ -213,6 +213,8 @@ do_reinit (const SGPropertyNode * arg)
         }
     }
 
+    globals->get_event_mgr()->reinit();
+
     return result;
 }
 
@@ -229,7 +231,7 @@ do_suspend (const SGPropertyNode * arg)
     vector<SGPropertyNode_ptr> subsystems = arg->getChildren("subsystem");
     for ( unsigned int i = 0; i < subsystems.size(); i++ ) {
         const char * name = subsystems[i]->getStringValue();
-        FGSubsystem * subsystem = globals->get_subsystem(name);
+        SGSubsystem * subsystem = globals->get_subsystem(name);
         if (subsystem == 0) {
             result = false;
             SG_LOG(SG_GENERAL, SG_ALERT, "Subsystem " << name << "not found");
@@ -253,7 +255,7 @@ do_resume (const SGPropertyNode * arg)
     vector<SGPropertyNode_ptr> subsystems = arg->getChildren("subsystem");
     for ( unsigned int i = 0; i < subsystems.size(); i++ ) {
         const char * name = subsystems[i]->getStringValue();
-        FGSubsystem * subsystem = globals->get_subsystem(name);
+        SGSubsystem * subsystem = globals->get_subsystem(name);
         if (subsystem == 0) {
             result = false;
             SG_LOG(SG_GENERAL, SG_ALERT, "Subsystem " << name << "not found");
index 92a75a8a6ce891d1942ad8967e7dafd08f6f8e7f..6bd3c6e2e1155da6c79ff73dc25fad2d81a3f7ff 100644 (file)
@@ -16,7 +16,7 @@
 #  include <windows.h>                     
 #endif
 
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/props/props.hxx>
 
 /**
index 10c52251062747cfa89ef517c17f683728c728aa..f308de7e869cf1d11eebae9f5be4db7b213d7b58 100644 (file)
 #endif
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
 
 #include STL_STRING
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
+#include <simgear/structure/exception.hxx>
+#include <simgear/structure/event_mgr.hxx>
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #endif
 #include <Sound/fg_fx.hxx>
 #include <Systems/system_mgr.hxx>
-#include <Time/FGEventMgr.hxx>
 #include <Time/light.hxx>
 #include <Time/moonpos.hxx>
 #include <Time/sunpos.hxx>
@@ -1410,6 +1410,18 @@ bool fgInitSubsystems() {
     SG_LOG( SG_GENERAL, SG_INFO, "Initialize Subsystems");
     SG_LOG( SG_GENERAL, SG_INFO, "========== ==========");
 
+    ////////////////////////////////////////////////////////////////////
+    // Initialize the event manager subsystem.
+    ////////////////////////////////////////////////////////////////////
+
+     globals->get_event_mgr()->bind();
+     globals->get_event_mgr()->init();
+
+     // Output event stats every 60 seconds
+     globals->get_event_mgr()->add( "SGEventMgr::print_stats()",
+                                    globals->get_event_mgr(),
+                                    &SGEventMgr::print_stats,
+                                    60000 );
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the material property subsystem.
@@ -1422,17 +1434,6 @@ bool fgInitSubsystems() {
         exit(-1);
     }
 
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the event manager subsystem.
-    ////////////////////////////////////////////////////////////////////
-
-    global_events.init();
-
-    // Output event stats every 60 seconds
-    global_events.Register( "FGEventMgr::print_stats()",
-                            &global_events, &FGEventMgr::print_stats,
-                            60000 );
-
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the scenery management subsystem.
@@ -1449,10 +1450,10 @@ bool fgInitSubsystems() {
     }
 
     // cause refresh of viewer scenery timestamps every 15 seconds...
-    global_events.Register( "FGTileMgr::refresh_view_timestamps()",
-                            globals->get_tile_mgr(),
-                            &FGTileMgr::refresh_view_timestamps,
-                            15000 );
+    globals->get_event_mgr()->add( "FGTileMgr::refresh_view_timestamps()",
+                                   globals->get_tile_mgr(),
+                                   &FGTileMgr::refresh_view_timestamps,
+                                   15000 );
 
     SG_LOG( SG_GENERAL, SG_DEBUG,
             "Current terrain elevation after tile mgr init " <<
@@ -1477,12 +1478,6 @@ bool fgInitSubsystems() {
     fgInitView();
 
 
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the lighting subsystem.
-    ////////////////////////////////////////////////////////////////////
-
-    globals->add_subsystem("lighting", new FGLight);
-
     ////////////////////////////////////////////////////////////////////
     // Create and register the logger.
     ////////////////////////////////////////////////////////////////////
@@ -1503,7 +1498,7 @@ bool fgInitSubsystems() {
     // Create and register the XML GUI.
     ////////////////////////////////////////////////////////////////////
 
-    globals->add_subsystem("gui", new NewGUI, FGSubsystemMgr::INIT);
+    globals->add_subsystem("gui", new NewGUI, SGSubsystemMgr::INIT);
 
 
     ////////////////////////////////////////////////////////////////////
@@ -1511,8 +1506,8 @@ bool fgInitSubsystems() {
     ////////////////////////////////////////////////////////////////////
 
     // update the current timezone each 30 minutes
-    global_events.Register( "fgUpdateLocalTime()", &fgUpdateLocalTime,
-                            30*60*1000 );
+    globals->get_event_mgr()->add( "fgUpdateLocalTime()",
+                                   &fgUpdateLocalTime, 30*60*1000 );
 
 
     ////////////////////////////////////////////////////////////////////
@@ -1558,12 +1553,20 @@ bool fgInitSubsystems() {
     WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;
 
     // register the periodic update of the weather
-    global_events.Register( "weather update", &fgUpdateWeatherDatabase,
-                            30000);
+    globals->get_event_mgr()->add( "weather update",
+                                   &fgUpdateWeatherDatabase, 30000);
 #else
     globals->add_subsystem("environment", new FGEnvironmentMgr);
 #endif
 
+
+    ////////////////////////////////////////////////////////////////////
+    // Initialize the lighting subsystem.
+    ////////////////////////////////////////////////////////////////////
+
+    globals->add_subsystem("lighting", new FGLight);
+
+
 #ifdef FG_USE_CLOUDS_3D
     ////////////////////////////////////////////////////////////////////
     // Initialize the 3D cloud subsystem.
@@ -1740,7 +1743,6 @@ bool fgInitSubsystems() {
     globals->get_subsystem_mgr()->bind();
     globals->get_subsystem_mgr()->init();
 
-
 #ifdef FG_MPLAYER_AS
     ////////////////////////////////////////////////////////////////////
     // Initialize multiplayer subsystem
index 3f81f94177cdc2e2cc97e862edae218a9a1dc2be..aa377c18298eff61e6f7d318c0293dce8d2fa969 100644 (file)
 
 
 #include <simgear/compiler.h>
+#include <simgear/structure/subsystem_mgr.hxx>
+
 #include <vector>
 #include STL_STRING
 
-#include "fgfs.hxx"
-
 SG_USING_STD(vector);
 SG_USING_STD(string);
 
 class FGProtocol;
 
-class FGIO : public FGSubsystem
+class FGIO : public SGSubsystem
 {
 public:
     FGIO();
index 0311fcd93dd333361398df7dab2ef7db8965465a..22b1d0901522ccbfcdcbd4257dc45231ffd8ae58 100644 (file)
@@ -24,7 +24,7 @@
 #  include <simgear/compiler.h>
 #endif
 
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/magvar/magvar.hxx>
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/misc/sg_path.hxx>
@@ -46,7 +46,6 @@
 #include <GUI/gui.h>
 
 #include "globals.hxx"
-#include "fgfs.hxx"
 #include "fg_props.hxx"
 
 SG_USING_STD(istream);
diff --git a/src/Main/fgfs.cxx b/src/Main/fgfs.cxx
deleted file mode 100644 (file)
index c92e995..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-#include "fgfs.hxx"
-
-#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/exception.hxx>
-
-#include "globals.hxx"
-#include "fg_props.hxx"
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Implementation of FGSubsystem
-////////////////////////////////////////////////////////////////////////
-
-
-FGSubsystem::FGSubsystem ()
-  : _suspended(false)
-{
-}
-
-FGSubsystem::~FGSubsystem ()
-{
-}
-
-void
-FGSubsystem::init ()
-{
-}
-
-void
-FGSubsystem::reinit ()
-{
-}
-
-void
-FGSubsystem::bind ()
-{
-}
-
-void
-FGSubsystem::unbind ()
-{
-}
-
-void
-FGSubsystem::suspend ()
-{
-  _suspended = true;
-}
-
-void
-FGSubsystem::suspend (bool suspended)
-{
-  _suspended = suspended;
-}
-
-void
-FGSubsystem::resume ()
-{
-  _suspended = false;
-}
-
-bool
-FGSubsystem::is_suspended () const
-{
-  if (!_freeze_master_node.valid())
-    _freeze_master_node = fgGetNode("/sim/freeze/master", true);
-  return _suspended || _freeze_master_node->getBoolValue();
-}
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Implementation of FGSubsystemGroup.
-////////////////////////////////////////////////////////////////////////
-
-FGSubsystemGroup::FGSubsystemGroup ()
-{
-}
-
-FGSubsystemGroup::~FGSubsystemGroup ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        delete _members[i];
-}
-
-void
-FGSubsystemGroup::init ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->subsystem->init();
-}
-
-void
-FGSubsystemGroup::reinit ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->subsystem->reinit();
-}
-
-void
-FGSubsystemGroup::bind ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->subsystem->bind();
-}
-
-void
-FGSubsystemGroup::unbind ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->subsystem->unbind();
-}
-
-void
-FGSubsystemGroup::update (double delta_time_sec)
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->update(delta_time_sec); // indirect call
-}
-
-void
-FGSubsystemGroup::suspend ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->subsystem->suspend();
-}
-
-void
-FGSubsystemGroup::resume ()
-{
-    for (unsigned int i = 0; i < _members.size(); i++)
-        _members[i]->subsystem->resume();
-}
-
-bool
-FGSubsystemGroup::is_suspended () const
-{
-    return false;
-}
-
-void
-FGSubsystemGroup::set_subsystem (const string &name, FGSubsystem * subsystem,
-                                 double min_step_sec)
-{
-    Member * member = get_member(name, true);
-    if (member->subsystem != 0)
-        delete member->subsystem;
-    member->name = name;
-    member->subsystem = subsystem;
-    member->min_step_sec = min_step_sec;
-}
-
-FGSubsystem *
-FGSubsystemGroup::get_subsystem (const string &name)
-{
-    Member * member = get_member(name);
-    if (member != 0)
-        return member->subsystem;
-    else
-        return 0;
-}
-
-void
-FGSubsystemGroup::remove_subsystem (const string &name)
-{
-    for (unsigned int i = 0; i < _members.size(); i++) {
-        if (name == _members[i]->name) {
-            _members.erase(_members.begin() + i);
-            return;
-        }
-    }
-}
-
-bool
-FGSubsystemGroup::has_subsystem (const string &name) const
-{
-    return (((FGSubsystemGroup *)this)->get_member(name) != 0);
-}
-
-FGSubsystemGroup::Member *
-FGSubsystemGroup::get_member (const string &name, bool create)
-{
-    for (unsigned int i = 0; i < _members.size(); i++) {
-        if (_members[i]->name == name)
-            return _members[i];
-    }
-    if (create) {
-        Member * member = new Member;
-        _members.push_back(member);
-        return member;
-    } else {
-        return 0;
-    }
-}
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Implementation of FGSubsystemGroup::Member
-////////////////////////////////////////////////////////////////////////
-
-
-FGSubsystemGroup::Member::Member ()
-    : name(""),
-      subsystem(0),
-      min_step_sec(0),
-      elapsed_sec(0)
-{
-}
-
-FGSubsystemGroup::Member::Member (const Member &)
-{
-    Member();
-}
-
-FGSubsystemGroup::Member::~Member ()
-{
-                                // FIXME: causes a crash
-//     delete subsystem;
-}
-
-void
-FGSubsystemGroup::Member::update (double delta_time_sec)
-{
-    elapsed_sec += delta_time_sec;
-    if (elapsed_sec >= min_step_sec) {
-        if (!subsystem->is_suspended()) {
-            subsystem->update(elapsed_sec);
-            elapsed_sec = 0;
-        }
-    }
-}
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Implementation of FGSubsystemMgr.
-////////////////////////////////////////////////////////////////////////
-
-
-FGSubsystemMgr::FGSubsystemMgr ()
-{
-}
-
-FGSubsystemMgr::~FGSubsystemMgr ()
-{
-}
-
-void
-FGSubsystemMgr::init ()
-{
-    for (int i = 0; i < MAX_GROUPS; i++)
-            _groups[i].init();
-}
-
-void
-FGSubsystemMgr::reinit ()
-{
-    for (int i = 0; i < MAX_GROUPS; i++)
-            _groups[i].reinit();
-}
-
-void
-FGSubsystemMgr::bind ()
-{
-    for (int i = 0; i < MAX_GROUPS; i++)
-        _groups[i].bind();
-}
-
-void
-FGSubsystemMgr::unbind ()
-{
-    for (int i = 0; i < MAX_GROUPS; i++)
-        _groups[i].unbind();
-}
-
-void
-FGSubsystemMgr::update (double delta_time_sec)
-{
-    for (int i = 0; i < MAX_GROUPS; i++) {
-        _groups[i].update(delta_time_sec);
-    }
-}
-
-void
-FGSubsystemMgr::suspend ()
-{
-    for (int i = 0; i < MAX_GROUPS; i++)
-        _groups[i].suspend();
-}
-
-void
-FGSubsystemMgr::resume ()
-{
-    for (int i = 0; i < MAX_GROUPS; i++)
-        _groups[i].resume();
-}
-
-bool
-FGSubsystemMgr::is_suspended () const
-{
-    return false;
-}
-
-void
-FGSubsystemMgr::add (const char * name, FGSubsystem * subsystem,
-                     GroupType group, double min_time_sec)
-{
-    SG_LOG(SG_GENERAL, SG_INFO, "Adding subsystem " << name);
-    get_group(group)->set_subsystem(name, subsystem, min_time_sec);
-
-    if (_subsystem_map.find(name) != _subsystem_map.end()) {
-        SG_LOG(SG_GENERAL, SG_ALERT, "Adding duplicate subsystem " << name);
-        throw sg_exception("duplicate subsystem");
-    }
-    _subsystem_map[name] = subsystem;
-}
-
-FGSubsystemGroup *
-FGSubsystemMgr::get_group (GroupType group)
-{
-    return &(_groups[group]);
-}
-
-FGSubsystem *
-FGSubsystemMgr::get_subsystem (const string &name)
-{
-    map<string,FGSubsystem *>::iterator s =_subsystem_map.find(name);
-
-    if (s == _subsystem_map.end())
-        return 0;
-    else
-        return s->second;
-}
-
-// end of fgfs.cxx
diff --git a/src/Main/fgfs.hxx b/src/Main/fgfs.hxx
deleted file mode 100644 (file)
index bc43589..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-// fgfs.hxx -- top level include file for FlightGear.
-//
-// Written by David Megginson, started 2000-12
-//
-// Copyright (C) 2000  David Megginson, david@megginson.com
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// $Id$
-
-
-#ifndef __FGFS_HXX
-#define __FGFS_HXX 1
-
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <simgear/compiler.h>
-
-// #ifdef SG_MATH_EXCEPTION_CLASH
-// #  include <math.h>
-// #endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>                     
-#  include <float.h>                    
-#endif
-
-#include STL_STRING
-SG_USING_STD(string);
-
-#include <vector>
-SG_USING_STD(vector);
-
-#include <map>
-SG_USING_STD(map);
-
-#include <simgear/props/props.hxx>
-
-
-\f
-/**
- * Basic interface for all FlightGear subsystems.
- *
- * <p>This is an abstract interface that all FlightGear subsystems
- * will eventually implement.  It defines the basic operations for
- * each subsystem: initialization, property binding and unbinding, and
- * updating.  Interfaces may define additional methods, but the
- * preferred way of exchanging information with other subsystems is
- * through the property tree.</p>
- *
- * <p>To publish information through a property, a subsystem should
- * bind it to a variable or (if necessary) a getter/setter pair in the
- * bind() method, and release the property in the unbind() method:</p>
- *
- * <pre>
- * void MySubsystem::bind ()
- * {
- *   fgTie("/controls/flight/elevator", &_elevator);
- *   fgSetArchivable("/controls/flight/elevator");
- * }
- *
- * void MySubsystem::unbind ()
- * {
- *   fgUntie("/controls/flight/elevator");
- * }
- * </pre>
- *
- * <p>To reference a property (possibly) from another subsystem, there
- * are two alternatives.  If the property will be referenced only
- * infrequently (say, in the init() method), then the fgGet* methods
- * declared in fg_props.hxx are the simplest:</p>
- *
- * <pre>
- * void MySubsystem::init ()
- * {
- *   _errorMargin = fgGetFloat("/display/error-margin-pct");
- * }
- * </pre>
- *
- * <p>On the other hand, if the property will be referenced frequently
- * (say, in the update() method), then the hash-table lookup required
- * by the fgGet* methods might be too expensive; instead, the
- * subsystem should obtain a reference to the actual property node in
- * its init() function and use that reference in the main loop:</p>
- *
- * <pre>
- * void MySubsystem::init ()
- * {
- *   _errorNode = fgGetNode("/display/error-margin-pct", true);
- * }
- *
- * void MySubsystem::update (double delta_time_sec)
- * {
- *   do_something(_errorNode.getFloatValue());
- * }
- * </pre>
- *
- * <p>The node returned will always be a pointer to SGPropertyNode,
- * and the subsystem should <em>not</em> delete it in its destructor
- * (the pointer belongs to the property tree, not the subsystem).</p>
- *
- * <p>The program may ask the subsystem to suspend or resume
- * sim-time-dependent operations; by default, the suspend() and
- * resume() methods set the protected variable <var>_suspended</var>,
- * which the subsystem can reference in its update() method, but
- * subsystems may also override the suspend() and resume() methods to
- * take different actions.</p>
- */
-class FGSubsystem
-{
-public:
-
-  /**
-   * Default constructor.
-   */
-  FGSubsystem ();
-
-  /**
-   * Virtual destructor to ensure that subclass destructors are called.
-   */
-  virtual ~FGSubsystem ();
-
-
-  /**
-   * Initialize the subsystem.
-   *
-   * <p>This method should set up the state of the subsystem, but
-   * should not bind any properties.  Note that any dependencies on
-   * the state of other subsystems should be placed here rather than
-   * in the constructor, so that FlightGear can control the
-   * initialization order.</p>
-   */
-  virtual void init ();
-
-
-  /**
-   * Reinitialize the subsystem.
-   *
-   * <p>This method should cause the subsystem to reinitialize itself,
-   * and (normally) to reload any configuration files.</p>
-   */
-  virtual void reinit ();
-
-
-  /**
-   * Acquire the subsystem's property bindings.
-   *
-   * <p>This method should bind all properties that the subsystem
-   * publishes.  It will be invoked after init, but before any
-   * invocations of update.</p>
-   */
-  virtual void bind ();
-
-
-  /**
-   * Release the subsystem's property bindings.
-   *
-   * <p>This method should release all properties that the subsystem
-   * publishes.  It will be invoked by FlightGear (not the destructor)
-   * just before the subsystem is removed.</p>
-   */
-  virtual void unbind ();
-
-
-  /**
-   * Update the subsystem.
-   *
-   * <p>FlightGear invokes this method every time the subsystem should
-   * update its state.</p>
-   *
-   * @param delta_time_sec The delta time, in seconds, since the last
-   * update.  On first update, delta time will be 0.
-   */
-  virtual void update (double delta_time_sec) = 0;
-
-
-  /**
-   * Suspend operation of this subsystem.
-   *
-   * <p>This method instructs the subsystem to suspend
-   * sim-time-dependent operations until asked to resume.  The update
-   * method will still be invoked so that the subsystem can take any
-   * non-time-dependent actions, such as updating the display.</p>
-   *
-   * <p>It is not an error for the suspend method to be invoked when
-   * the subsystem is already suspended; the invocation should simply
-   * be ignored.</p>
-   */
-  virtual void suspend ();
-
-
-  /**
-   * Suspend or resum operation of this subsystem.
-   *
-   * @param suspended true if the subsystem should be suspended, false
-   * otherwise.
-   */
-  virtual void suspend (bool suspended);
-
-
-  /**
-   * Resume operation of this subsystem.
-   *
-   * <p>This method instructs the subsystem to resume
-   * sim-time-depended operations.  It is not an error for the resume
-   * method to be invoked when the subsystem is not suspended; the
-   * invocation should simply be ignored.</p>
-   */
-  virtual void resume ();
-
-
-  /**
-   * Test whether this subsystem is suspended.
-   *
-   * @return true if the subsystem is suspended, false if it is not.
-   */
-  virtual bool is_suspended () const;
-
-
-protected:
-
-  mutable SGPropertyNode_ptr _freeze_master_node;
-  bool _suspended;
-
-};
-
-
-\f
-/**
- * A group of FlightGear subsystems.
- */
-class FGSubsystemGroup : public FGSubsystem
-{
-public:
-
-    FGSubsystemGroup ();
-    virtual ~FGSubsystemGroup ();
-
-    virtual void init ();
-    virtual void reinit ();
-    virtual void bind ();
-    virtual void unbind ();
-    virtual void update (double delta_time_sec);
-    virtual void suspend ();
-    virtual void resume ();
-    virtual bool is_suspended () const;
-
-    virtual void set_subsystem (const string &name,
-                                FGSubsystem * subsystem,
-                                double min_step_sec = 0);
-    virtual FGSubsystem * get_subsystem (const string &name);
-    virtual void remove_subsystem (const string &name);
-    virtual bool has_subsystem (const string &name) const;
-
-private:
-
-    struct Member {
-
-        Member ();
-        Member (const Member &member);
-        virtual ~Member ();
-
-        virtual void update (double delta_time_sec);
-
-        string name;
-        FGSubsystem * subsystem;
-        double min_step_sec;
-        double elapsed_sec;
-    };
-
-    Member * get_member (const string &name, bool create = false);
-
-    vector<Member *> _members;
-};
-
-
-\f
-/**
- * Manage subsystems for FlightGear.
- *
- * This top-level subsystem will eventually manage all of the
- * subsystems in FlightGear: it broadcasts its life-cycle events
- * (init, bind, etc.) to all of the subsystems it manages.  Subsystems
- * are grouped to guarantee order of initialization and execution --
- * currently, the only two groups are INIT and GENERAL, but others
- * will appear in the future.
- *
- * All subsystems are named as well as grouped, and subsystems can be
- * looked up by name and cast to the appropriate subtype when another
- * subsystem needs to invoke specialized methods.
- *
- * The subsystem manager owns the pointers to all the subsystems in
- * it.
- */
-class FGSubsystemMgr : public FGSubsystem
-{
-public:
-
-    /**
-     * Types of subsystem groups.
-     */
-    enum GroupType {
-        INIT = 0,
-        GENERAL,
-        MAX_GROUPS
-    };
-
-    FGSubsystemMgr ();
-    virtual ~FGSubsystemMgr ();
-
-    virtual void init ();
-    virtual void reinit ();
-    virtual void bind ();
-    virtual void unbind ();
-    virtual void update (double delta_time_sec);
-    virtual void suspend ();
-    virtual void resume ();
-    virtual bool is_suspended () const;
-
-    virtual void add (const char * name,
-                      FGSubsystem * subsystem,
-                      GroupType group = GENERAL, 
-                      double min_time_sec = 0);
-
-    virtual FGSubsystemGroup * get_group (GroupType group);
-
-    virtual FGSubsystem * get_subsystem(const string &name);
-
-private:
-
-    FGSubsystemGroup _groups[MAX_GROUPS];
-    map<string,FGSubsystem *> _subsystem_map;
-
-};
-
-
-
-#endif // __FGFS_HXX
-
-// end of fgfs.hxx
index 0c90fe26085aa1c11e2f5c0d8a6a00b2270a0a5e..4008ba180beff8bae54abdeb6897e84405b2c3be 100644 (file)
@@ -21,7 +21,7 @@
 // $Id$
 
 
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/misc/sg_path.hxx>
 
 #include "globals.hxx"
@@ -41,7 +41,8 @@ FGGlobals *globals;
 
 // Constructor
 FGGlobals::FGGlobals() :
-    subsystem_mgr( new FGSubsystemMgr ),
+    subsystem_mgr( new SGSubsystemMgr ),
+    event_mgr( new SGEventMgr ),
     sim_time_sec( 0.0 ),
     fg_root( "" ),
     fg_scenery( "" ),
@@ -73,8 +74,7 @@ FGGlobals::FGGlobals() :
     channel_options_list( NULL ),
     scenery( NULL ),
     tile_mgr( NULL ),
-    io( new FGIO ),
-    cur_light_params( NULL )
+    io( new FGIO )
 {
 }
 
@@ -83,6 +83,7 @@ FGGlobals::FGGlobals() :
 FGGlobals::~FGGlobals() 
 {
   delete subsystem_mgr;
+  delete event_mgr;
   delete initial_state;
   delete props;
   delete commands;
@@ -104,13 +105,13 @@ void FGGlobals::set_fg_root (const string &root) {
 }
 
 
-FGSubsystemMgr *
+SGSubsystemMgr *
 FGGlobals::get_subsystem_mgr () const
 {
     return subsystem_mgr;
 }
 
-FGSubsystem *
+SGSubsystem *
 FGGlobals::get_subsystem (const char * name)
 {
     return subsystem_mgr->get_subsystem(name);
@@ -118,20 +119,48 @@ FGGlobals::get_subsystem (const char * name)
 
 void
 FGGlobals::add_subsystem (const char * name,
-                          FGSubsystem * subsystem,
-                          FGSubsystemMgr::GroupType type,
+                          SGSubsystem * subsystem,
+                          SGSubsystemMgr::GroupType type,
                           double min_time_sec)
 {
     subsystem_mgr->add(name, subsystem, type, min_time_sec);
 }
 
 
+SGEventMgr *
+FGGlobals::get_event_mgr () const
+{
+    return event_mgr;
+}
+
+
+void
+FGGlobals::add_event (const char * name,
+                      int repeat_value,
+                      int initial_value)
+{
+    event_mgr->add(name, subsystem_mgr->get_subsystem(name),
+                   repeat_value, initial_value);
+}
+
+void
+FGGlobals::add_event (const char * name,
+                      const SGSubsystem * subsystem,
+                      int repeat_value,
+                      int initial_value)
+{
+    event_mgr->add(name, subsystem, repeat_value, initial_value);
+}
+
+
+
 // Save the current state as the initial state.
 void
 FGGlobals::saveInitialState ()
 {
   delete initial_state;
   initial_state = new SGPropertyNode();
+
   if (!copyProperties(props, initial_state))
     SG_LOG(SG_GENERAL, SG_ALERT, "Error saving initial state");
 }
index 75b18e6b0d48bdc7274d7571a29b63d0086408eb..3104989b21e4cdf0757bd092ff99b06173850354 100644 (file)
 #ifndef _GLOBALS_HXX
 #define _GLOBALS_HXX
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/compiler.h>
+#include <simgear/structure/callback.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/structure/event_mgr.hxx>
 
 #include <vector>
 #include STL_STRING
 
-#include "fgfs.hxx"
-
-
 SG_USING_STD( vector );
 SG_USING_STD( string );
 
@@ -84,12 +88,14 @@ class FGViewer;
 /**
  * Bucket for subsystem pointers representing the sim's state.
  */
+
 class FGGlobals
 {
 
 private:
 
-    FGSubsystemMgr * subsystem_mgr;
+    SGSubsystemMgr * subsystem_mgr;
+    SGEventMgr * event_mgr;
 
     // Number of milliseconds elapsed since the start of the program.
     double sim_time_sec;
@@ -185,9 +191,6 @@ private:
     // Input/Ouput subsystem
     FGIO *io;
 
-    // light parameters
-    FGLight *cur_light_params;
-
 #ifdef FG_MPLAYER_AS
     //Mulitplayer managers
     FGMultiplayTxMgr *multiplayer_tx_mgr;
@@ -200,16 +203,47 @@ public:
     FGGlobals();
     virtual ~FGGlobals();
 
-    virtual FGSubsystemMgr * get_subsystem_mgr () const;
+    virtual SGSubsystemMgr * get_subsystem_mgr () const;
 
-    virtual FGSubsystem * get_subsystem (const char * name);
+    virtual SGSubsystem * get_subsystem (const char * name);
 
     virtual void add_subsystem (const char * name,
-                                FGSubsystem * subsystem,
-                                FGSubsystemMgr::GroupType
-                                  type = FGSubsystemMgr::GENERAL,
+                                SGSubsystem * subsystem,
+                                SGSubsystemMgr::GroupType
+                                type = SGSubsystemMgr::GENERAL,
                                 double min_time_sec = 0);
 
+    virtual SGEventMgr * get_event_mgr () const;
+
+    virtual void add_event (const char * name,
+                            int repeat_value,
+                            int initial_value = -1 );
+
+    virtual void add_event (const char * name,
+                            const SGSubsystem * subsystem,
+                            int repeat_value,
+                            int initial_value = -1 );
+
+    template< typename Fun >
+    inline void add_event( const char * name,
+                           const Fun& func,
+                           SGEvent::interval_type repeat_value,
+                           SGEvent::interval_type initial_value = -1 )
+    {
+        event_mgr->add( name, get_subsystem( name ), func,
+                        repeat_value, initial_value);
+    }
+
+    template< typename Fun >
+    inline void add_event( const char * name,
+                           const SGSubsystem * subsystem,
+                           const Fun& func,
+                           SGEvent::interval_type repeat_value,
+                           SGEvent::interval_type initial_value = -1 )
+    {
+        event_mgr->add( name, subsystem, func, repeat_value, initial_value);
+    }
+
     inline double get_sim_time_sec () const { return sim_time_sec; }
     inline void inc_sim_time_sec (double dt) { sim_time_sec += dt; }
     inline void set_sim_time_sec (double t) { sim_time_sec = t; }
index 4818e44f087a414c70b50e81ebb1e045256cedf9..f1098d6790c38438c832294d00f5d9e409364afb 100644 (file)
 
 #include <simgear/compiler.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/props/props.hxx>
 
 SG_USING_STD(ostream);
 SG_USING_STD(vector);
 
-#include "fgfs.hxx"
-
 
 /**
  * Log any property values to any number of CSV files.
  */
-class FGLogger : public FGSubsystem
+class FGLogger : public SGSubsystem
 {
 public:
 
   FGLogger ();
   virtual ~FGLogger ();
 
-                               // Implementation of FGSubsystem
+                               // Implementation of SGSubsystem
   virtual void init ();
   virtual void reinit ();
   virtual void bind ();
index 0056925c2dc3eb28fdb3c76ce5f2dd1c1228cd48..3088b95706276daf73e90d97c56dbd04429c20da 100644 (file)
@@ -64,7 +64,6 @@
 
 #include <Include/general.hxx>
 #include <Scenery/tileentry.hxx>
-#include <Time/FGEventMgr.hxx>
 #include <Time/light.hxx>
 #include <Time/light.hxx>
 #include <Aircraft/aircraft.hxx>
@@ -133,8 +132,6 @@ bool glPointParameterIsSupported = false;
 #  include <console.h>         // -dw- for command line dialog
 #endif
 
-FGEventMgr global_events;
-
 // This is a record containing a bit of global housekeeping information
 FGGeneral general;
 
@@ -374,9 +371,6 @@ void fgRenderFrame() {
     GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
     GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
 
-    // Process/manage pending events
-    global_events.update( delta_time_sec );
-
     // static const SGPropertyNode *longitude
     //     = fgGetNode("/position/longitude-deg");
     // static const SGPropertyNode *latitude
@@ -510,18 +504,18 @@ void fgRenderFrame() {
         if ( skyblend ) {
             /*
              SG_LOG( SG_GENERAL, SG_BULK, "thesky->repaint() sky_color = "
-             << cur_light_params.sky_color[0] << " "
-             << cur_light_params.sky_color[1] << " "
-             << cur_light_params.sky_color[2] << " "
-             << cur_light_params.sky_color[3] );
+             << l->sky_color()[0] << " "
+             << l->sky_color()[1] << " "
+             << l->sky_color()[2] << " "
+             << l->sky_color()[3] );
             SG_LOG( SG_GENERAL, SG_BULK, "    fog = "
-             << cur_light_params.fog_color[0] << " "
-             << cur_light_params.fog_color[1] << " "
-             << cur_light_params.fog_color[2] << " "
-             << cur_light_params.fog_color[3] ); 
+             << l->fog_color()[0] << " "
+             << l->fog_color()[1] << " "
+             << l->fog_color()[2] << " "
+             << l->fog_color()[3] ); 
             SG_LOG( SG_GENERAL, SG_BULK,
-                    "    sun_angle = " << cur_light_params.sun_angle
-             << "    moon_angle = " << cur_light_params.moon_angle );
+                    "    sun_angle = " << l->sun_angle
+             << "    moon_angle = " << l->moon_angle );
             */
 
             static SGSkyColor scolor;
@@ -549,7 +543,7 @@ void fgRenderFrame() {
              << " lon = " << cur_fdm_state->get_Longitude()
              << " lat = " << cur_fdm_state->get_Latitude() );
             SG_LOG( SG_GENERAL, SG_BULK,
-                    "    sun_rot = " << cur_light_params.sun_rotation
+                    "    sun_rot = " << l->get_sun_rotation
              << " gst = " << SGTime::cur_time_params->getGst() );
             SG_LOG( SG_GENERAL, SG_BULK,
                  "    sun ra = " << globals->get_ephem()->getSunRightAscension()
@@ -1019,6 +1013,8 @@ static void fgMainLoop( void ) {
 
     SGTime *t = globals->get_time_params();
 
+    globals->get_event_mgr()->update(delta_time_sec);
+
     SGLocation * acmodel_location = 0;
     if(cur_fdm_state->getACModel() != 0) {
       acmodel_location = (SGLocation *)  cur_fdm_state->getACModel()->get3DModel()->getSGLocation();
index 8e8b228f3099049b6116594c85347c4529c713cd..53daa5c80716f8ebd4d4ec04b3b65f4215b3dcae 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/debug/logstream.hxx>
 
 #include <math.h>              // rint()
index 1aa49a366ec94a3be358b4c99ad93373dcbf42f2..30f17a0d0acdf0ffee4bf132ea55ac7eed83f502 100644 (file)
 
 #include <simgear/compiler.h>
 #include <simgear/constants.h>
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/scene/model/location.hxx>
 
 #include <plib/sg.h>           // plib include
 
-#include "fgfs.hxx"
-
 #define FG_FOV_MIN 0.1
 #define FG_FOV_MAX 179.9
 
@@ -49,7 +48,7 @@ enum fgViewType {
 };
 
 // Define a structure containing view information
-class FGViewer : public FGSubsystem {
+class FGViewer : public SGSubsystem {
 
 public:
 
@@ -74,7 +73,7 @@ public:
     virtual ~FGViewer( void );
 
     //////////////////////////////////////////////////////////////////////
-    // Part 1: standard FGSubsystem implementation.
+    // Part 1: standard SGSubsystem implementation.
     //////////////////////////////////////////////////////////////////////
 
     virtual void init ();
index f5812db122d80e30f8025b61ec0c5c0496294b17..b4a4fbf0eb1ebe06eed96ba2b7d34d5fec717176 100644 (file)
@@ -31,6 +31,7 @@
 
 
 #include <simgear/compiler.h>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 
 #include <vector>
 
-#include "fgfs.hxx"
 #include "viewer.hxx"
 
 SG_USING_STD(vector);
 
 
 // Define a structure containing view information
-class FGViewMgr : public FGSubsystem
+class FGViewMgr : public SGSubsystem
 {
 
 public:
index 7096473e810fb8b92a57075de2788a9606cbdbaa..e14c6bd263246e050bae6f1acbe9ef3d0df6e63a 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <simgear/compiler.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/scene/model/placement.hxx>
 
index 0e6fe2235c54df27607fe985d9f0b240f548d7e6..cf337bd5e20e100ce2a5c0aa99636aa996317f0b 100644 (file)
@@ -15,7 +15,7 @@
 SG_USING_STD(string);
 SG_USING_STD(vector);
 
-#include <Main/fgfs.hxx>       // for FGSubsystem
+#include <simgear/structure/subsystem_mgr.hxx> // for SGSubsystem
 
 
 // Don't pull in the headers, since we don't need them here.
@@ -24,7 +24,7 @@ class ssgSelector;
 class SGModelPlacement;
 
 
-class FGAircraftModel : public FGSubsystem
+class FGAircraftModel : public SGSubsystem
 {
 public:
 
index 492b39d29b1249541bdd9e223697cd7040ac7bbd..1c9994ed786b3a7640230a0202aea871f399b064 100644 (file)
@@ -17,7 +17,7 @@
 #include <plib/ssg.h>
 #include <plib/ul.h>
 
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
index 664e48425da3b8f5d25ae26c99df93b5a3ea3b4d..41376f47d1e469d6df7b89a6eed2456b220fa552 100644 (file)
@@ -13,8 +13,7 @@
 #include <vector>
 
 #include <simgear/compiler.h>  // for SG_USING_STD
-
-#include <Main/fgfs.hxx>       // for FGSubsystem
+#include <simgear/structure/subsystem_mgr.hxx>
 
 SG_USING_STD(vector);
 
@@ -27,7 +26,7 @@ class SGModelPlacement;
 /**
  * Manage a list of user-specified models.
  */
-class FGModelMgr : public FGSubsystem
+class FGModelMgr : public SGSubsystem
 {
 public:
 
index 7df1220d90dfd3596258e78c63cc9492a74bad2d..062ad9542944b02becd9cbee4599278fbe127a47 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/io/iochannel.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
index b020d89f4e14e672466f4b69da28896cc99c80e4..94a5a953265210b75722a5d0b063e592426b27ea 100644 (file)
@@ -39,7 +39,7 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/io/iochannel.hxx>
 #include <simgear/math/sg_types.hxx>
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/props/props.hxx>
 
 #include <Main/fg_props.hxx>
index 9d4fdc182a212968372fc6fecc791c23a0d6a28c..7268f6f633ddac2a6d2e3eab3a2bf5c4f657c7fb 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <simgear/compiler.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/misc/strutils.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
index 41f1a4a62d279670bacd1a010590b6f5a43f9be4..499b9c3497dcf450f63fa48aade8d7a127534daf 100644 (file)
 
 #include <simgear/math/sg_types.hxx>
 #include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 #include <Network/net_ctrls.hxx>
 #include <Network/net_fdm.hxx>
-#include <Main/fgfs.hxx>
 
 SG_USING_STD(deque);
 
@@ -60,7 +60,7 @@ typedef deque < FGReplayData > replay_list_type;
  * 
  */
 
-class FGReplay : public FGSubsystem
+class FGReplay : public SGSubsystem
 {
 
 public:
index 4d506e4b709b1ea4877c2216197ecc9a6e1e0c27..020405f83507147fed5f9e2326ad8a11795358b9 100644 (file)
 #include <plib/sg.h>
 #include <plib/ssg.h>
 
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/point3d.hxx>
 
-#include <Main/fgfs.hxx>
-
 
 // Define a structure containing global scenery parameters
-class FGScenery : public FGSubsystem {
+class FGScenery : public SGSubsystem {
     // center of current scenery chunk
     Point3D center;
 
@@ -74,7 +73,7 @@ public:
     FGScenery();
     ~FGScenery();
 
-    // Implementation of FGSubsystem.
+    // Implementation of SGSubsystem.
     void init ();
     void bind ();
     void unbind ();
index f1046c5524494a40d80c43110fbbabacb947b7b7..5467f6a7ab7dfb1fbb06e779f5e189748fd10c52 100644 (file)
@@ -33,7 +33,7 @@
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/vector.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/scene/model/modellib.hxx>
 
 #include <Main/globals.hxx>
index f521824882fa0d4d54b53d502204621309fb758c..cd5aacbe234003222cf7752bdef66a13f70cc823 100644 (file)
@@ -11,8 +11,7 @@
 #endif
 
 #include <simgear/compiler.h>  // for SG_USING_STD
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 class pslExtension;
 
@@ -32,7 +31,7 @@ class pslExtension;
  * get_property(name) - get a property value
  * set_property(name, value) - set a property value
  */
-class FGScriptMgr : public FGSubsystem
+class FGScriptMgr : public SGSubsystem
 {
 public:
 
index 939e2c8c606f0a366651179a09dc27f665bcca5a..93e8b779b770ac61e256ec4c6e93c633e2d674f7 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #ifdef __BORLANDC__
 #  define exception c_exception
 #endif
index a28ca9a7b80065574e702a618b50b06f698800f3..0cc29dc393ac10aab3b2e4fded1ad203006e8dc4 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __FGFX_HXX
 #define __FGFX_HXX 1
 
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 class SGSound;
 
@@ -35,7 +35,7 @@ class SGSound;
  * on current flight conditions.  The sound manager must be initialized
  * before this object is.
  */
-class FGFX : public FGSubsystem
+class FGFX : public SGSubsystem
 {
 
 public:
index 4905dbeb46e10aa56645339a53031cb796118375..b069407c4774d09abe49081e41e2849b581b8bf9 100644 (file)
@@ -21,7 +21,7 @@
 // $Id$
 
 
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
 
 #include <Main/fg_props.hxx>
index 9761a955c644b6297dac8e1542cf0bbd8363b8b0..fee71cf0b0886e39b9c4c4461132cee67d7ea822 100644 (file)
@@ -39,8 +39,7 @@ SG_USING_STD(string);
 SG_USING_STD(vector);
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 // Forward declaration
@@ -184,7 +183,7 @@ public:
  * 
  */
 
-class FGElectricalSystem : public FGSubsystem
+class FGElectricalSystem : public SGSubsystem
 {
 
 public:
index 0024f28827eb97a17972a93b864e7ff21cbb8c5e..80be710f09f3ca4be89623f3dae99e334bee01d6 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -33,7 +32,7 @@
  *
  * /systems/pitot[0]/total-pressure-inhg
  */
-class PitotSystem : public FGSubsystem
+class PitotSystem : public SGSubsystem
 {
 
 public:
index df7c650206c4c1557f2856d97a0b132832a40ba3..56a0a4ed14e42095d8bb39de45082af39e8e2da4 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -31,7 +30,7 @@
  * TODO: support multiple static ports and specific locations
  * TODO: support alternate air with errors
  */
-class StaticSystem : public FGSubsystem
+class StaticSystem : public SGSubsystem
 {
 
 public:
index 544b1e30ac7f07f15bc289b60a655f467ba6f93c..02c102a7e87e36c815bbcc92458e268e2ee364bd 100644 (file)
@@ -16,8 +16,7 @@
 #endif
 
 #include <simgear/compiler.h>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -26,7 +25,7 @@
  * In the initial draft, the systems present are hard-coded, but they
  * will soon be configurable for individual aircraft.
  */
-class FGSystemMgr : public FGSubsystemGroup
+class FGSystemMgr : public SGSubsystemGroup
 {
 public:
 
index 3087c46339236301ce3265264468605188847711..a18036c77b2ffaa76b30c60a70795d6ec22c1fa8 100644 (file)
@@ -12,8 +12,7 @@
 #endif
 
 #include <simgear/props/props.hxx>
-
-#include <Main/fgfs.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
 
 /**
@@ -31,7 +30,7 @@
  *
  * /systems/vacuum[n]/suction-inhg
  */
-class VacuumSystem : public FGSubsystem
+class VacuumSystem : public SGSubsystem
 {
 
 public:
diff --git a/src/Time/FGEventMgr.cxx b/src/Time/FGEventMgr.cxx
deleted file mode 100644 (file)
index f9cc429..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// FGEventMgr.cxx -- Event Manager
-//
-// Written by Bernie Bright, started April 2002.
-//
-// Copyright (C) 2002  Curtis L. Olson  - curt@me.umn.edu
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// $Id$
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <simgear/compiler.h>
-#include <simgear/debug/logstream.hxx>
-
-#include "FGEventMgr.hxx"
-
-FGEventMgr::FGEvent::FGEvent()
-    : name_(""),
-      callback_(0),
-      repeat_value_(0),
-      initial_value_(0),
-      ms_to_go_(0),
-      cum_time(0),
-      min_time(100000),
-      max_time(0),
-      count(0)
-{
-}
-
-FGEventMgr::FGEvent::FGEvent( const char* name,
-                             fgCallback* cb,
-                             interval_type repeat_value,
-                             interval_type initial_value )
-    : name_(name),
-      callback_(cb),
-      repeat_value_(repeat_value),
-      initial_value_(initial_value),
-      //ms_to_go_(repeat_value_),
-      cum_time(0),
-      min_time(100000),
-      max_time(0),
-      count(0)
-{
-    if (initial_value_ < 0)
-    {
-       this->run();
-       ms_to_go_ = repeat_value_;
-    }
-    else
-    {
-       ms_to_go_ = initial_value_;
-    }
-}
-
-
-FGEventMgr::FGEvent::~FGEvent()
-{
-    //delete callback_;
-}
-
-void
-FGEventMgr::FGEvent::run()
-{
-    SGTimeStamp start_time;
-    SGTimeStamp finish_time;
-
-    start_time.stamp();
-
-    // run the event
-    (*callback_)();
-
-    finish_time.stamp();
-
-    ++count;
-
-    unsigned long duration = finish_time - start_time;
-
-    cum_time += duration;
-
-    if ( duration < min_time ) {
-       min_time = duration;
-    }
-
-    if ( duration > max_time ) {
-       max_time = duration;
-    }
-}
-
-void
-FGEventMgr::FGEvent::print_stats() const
-{
-    SG_LOG( SG_EVENT, SG_INFO, 
-            "  " << name_
-            << " int=" << repeat_value_ / 1000.0
-            << " cum=" << cum_time
-            << " min=" << min_time
-            << " max=" <<  max_time
-            << " count=" << count
-            << " ave=" << cum_time / (double)count );
-}
-
-FGEventMgr::FGEventMgr()
-{
-}
-
-FGEventMgr::~FGEventMgr()
-{
-}
-
-void
-FGEventMgr::init()
-{
-    SG_LOG( SG_EVENT, SG_INFO, "Initializing event manager" );
-
-    event_table.clear();
-}
-
-void
-FGEventMgr::bind()
-{
-}
-
-void
-FGEventMgr::unbind()
-{
-}
-
-void
-FGEventMgr::update( double dt )
-{
-    int dt_ms = int(dt * 1000);
-
-    if (dt_ms < 0)
-    {
-       SG_LOG( SG_GENERAL, SG_ALERT,
-               "FGEventMgr::update() called with negative delta T" );
-       return;
-    }
-
-    int min_value = 0;
-    event_container_type::iterator first = event_table.begin();
-    event_container_type::iterator last = event_table.end();
-    event_container_type::iterator event = event_table.end();
-
-    // Scan all events.  Run one whose interval has expired.
-    while (first != last)
-    {
-       if (first->update( dt_ms ))
-       {
-           if (first->value() < min_value)
-           {
-               // Select event with largest negative value.
-               // Its been waiting longest.
-               min_value = first->value();
-               event = first;
-           }
-       }
-       ++first;
-    }
-
-    if (event != last)
-    {
-       event->run();
-
-       if (event->repeat_value() > 0)
-       {
-           event->reset();
-       }
-       else
-       {
-           SG_LOG( SG_GENERAL, SG_DEBUG, "Deleting event " << event->name() );
-           event_table.erase( event );
-       }
-    }
-}
-
-void
-FGEventMgr::Register( const FGEvent& event )
-{
-    event_table.push_back( event );
-
-    SG_LOG( SG_EVENT, SG_INFO, "Registered event " << event.name()
-           << " to run every " << event.repeat_value() << "ms" );
-}
-
-void
-FGEventMgr::print_stats() const
-{
-    SG_LOG( SG_EVENT, SG_INFO, "" );
-    SG_LOG( SG_EVENT, SG_INFO, "Event Stats" );
-    SG_LOG( SG_EVENT, SG_INFO, "-----------" );
-
-    event_container_type::const_iterator first = event_table.begin();
-    event_container_type::const_iterator last = event_table.end();
-    for (; first != last; ++first)
-    {
-       first->print_stats();
-    }
-
-    SG_LOG( SG_EVENT, SG_INFO, "" );
-}
diff --git a/src/Time/FGEventMgr.hxx b/src/Time/FGEventMgr.hxx
deleted file mode 100644 (file)
index 54ec6ae..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-// FGEventMgr.hxx -- Flight Gear periodic event scheduler
-//
-// Written by Curtis Olson, started December 1997.
-// Modified by Bernie Bright, April 2002.
-//
-// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// $Id$
-
-#ifndef FG_EVENT_MGR_H_INCLUDED
-#define FG_EVENT_MGR_H_INCLUDED 1
-
-#include <simgear/compiler.h>
-#include <simgear/timing/timestamp.hxx>
-
-#include <Main/fgfs.hxx>
-#include <Include/fg_callback.hxx>
-
-#include <vector>
-#include <string>
-
-SG_USING_STD(vector);
-SG_USING_STD(string);
-
-/**
- * 
- */
-class FGEventMgr : public FGSubsystem
-{
-public:
-
-    typedef int interval_type;
-
-private:
-
-    /**
-     * 
-     */
-    class FGEvent
-    {
-    public:
-       /**
-        * 
-        */
-       FGEvent();
-
-       FGEvent( const char* desc,
-                fgCallback* cb,
-                interval_type repeat_value,
-                interval_type initial_value );
-
-       /**
-        * 
-        */
-       ~FGEvent();
-
-       /**
-        * 
-        */
-       void reset()
-       {
-           ms_to_go_ = repeat_value_;
-       }
-
-       /**
-        * Execute this event's callback.
-        */
-       void run();
-
-       string name() const { return name_; }
-       interval_type repeat_value() const { return repeat_value_; }
-       int value() const { return ms_to_go_; }
-
-       /**
-        * Display event statistics.
-        */
-       void print_stats() const;
-
-       /**
-        * Update the elapsed time for this event.
-        * @param dt_ms elapsed time in milliseconds.
-        * @return true if elapsed time has expired.
-        */
-       bool update( int dt_ms )
-       {
-           ms_to_go_ -= dt_ms;
-           return ms_to_go_ <= 0;
-       }
-
-    private:
-       string name_;
-       fgCallback* callback_;
-       interval_type repeat_value_;
-       interval_type initial_value_;
-       int ms_to_go_;
-
-       unsigned long cum_time;    // cumulative processor time of this event
-       unsigned long min_time;    // time of quickest execution
-       unsigned long max_time;    // time of slowest execution
-       unsigned long count;       // number of times executed
-    };
-
-public:
-    FGEventMgr();
-    ~FGEventMgr();
-
-    /**
-     * Initialize the scheduling subsystem.
-     */
-    void init();
-
-    void bind();
-
-    void unbind();
-
-    /*
-     * Update the elapsed time for all events.
-     * @param dt elapsed time in seconds.
-     */
-    void update( double dt );
-
-    /**
-     * Register a free standing function to be executed some time in the future.
-     * @param desc A brief description of this callback for logging.
-     * @param cb The callback function to be executed.
-     * @param repeat_value repetition rate in milliseconds.
-     * @param initial_value initial delay value in milliseconds.  A value of
-     * -1 means run immediately.
-     */
-    template< typename Fun >
-    void Register( const char* name,
-                  const Fun& f,
-                  interval_type repeat_value,
-                  interval_type initial_value = -1 )
-    {
-       this->Register( FGEvent( name,
-                                make_callback(f),
-                                repeat_value,
-                                initial_value ) );
-    }
-
-    template< class ObjPtr, typename MemFn >
-    void Register( const char* name,
-                  const ObjPtr& p,
-                  MemFn pmf,
-                  interval_type repeat_value,
-                  interval_type initial_value = -1 )
-    {
-       this->Register( FGEvent( name,
-                                make_callback(p,pmf),
-                                repeat_value,
-                                initial_value ) );
-    }
-
-    /**
-     * Display statistics for all registered events.
-     */
-    void print_stats() const;
-
-private:
-    void Register( const FGEvent& event );
-
-private:
-
-    typedef vector< FGEvent > event_container_type;
-
-    // Registered events.
-    event_container_type event_table;
-};
-
-extern FGEventMgr global_events;
-
-#endif //FG_ EVENT_MGR_H_INCLUDED
index 02e4ef5d3dea47986ec2d476517c1e3e39de5cc2..41180d3a7490e4de94ca92227280588a277f010d 100644 (file)
@@ -1,7 +1,6 @@
 noinst_LIBRARIES = libTime.a
 
 libTime_a_SOURCES = \
-       FGEventMgr.cxx FGEventMgr.hxx \
        fg_timer.cxx fg_timer.hxx \
        light.cxx light.hxx \
        moonpos.cxx moonpos.hxx \
index 864668d00320df76e73d72a8fa8efcc2cae1e5fb..2a24f0b5dce11f7f9b8f07ea41a73a62688cc6d5 100644 (file)
 
 #include <plib/sg.h>                   // plib include
 
+#include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
 #include <simgear/math/point3d.hxx>
 
 
 // Define a structure containing the global lighting parameters
-class FGLight : public FGSubsystem
+class FGLight : public SGSubsystem
 {
 
 private: