initial simplistic vacuum system that's not yet connected to anything.
src/Objects/Makefile \
src/Scenery/Makefile \
src/Sound/Makefile \
+ src/Systems/Makefile \
+ src/Systems/Vacuum/Makefile \
src/Time/Makefile \
src/WeatherCM/Makefile \
tests/Makefile \
$(top_builddir)/src/Airports/libAirports.a \
$(NETWORK_LIBS) \
$(top_builddir)/src/Objects/libObjects.a \
+ $(top_builddir)/src/Systems/libSystems.a \
+ $(top_builddir)/src/Systems/Vacuum/libVacuum.a \
$(top_builddir)/src/Time/libTime.a \
$(WEATHER_LIBS) \
$(top_builddir)/src/Input/libInput.a \
#include <Scenery/tilemgr.hxx>
#include <Sound/fg_fx.hxx>
#include <Sound/soundmgr.hxx>
+#include <Systems/system_mgr.hxx>
#include <Time/FGEventMgr.hxx>
#include <Time/light.hxx>
#include <Time/sunpos.hxx>
#endif
+ ////////////////////////////////////////////////////////////////////
+ // Initialize the aircraft systems.
+ ////////////////////////////////////////////////////////////////////
+ globals->get_systemmgr()->init();
+ globals->get_systemmgr()->bind();
+
////////////////////////////////////////////////////////////////////
// Initialize the radio stack subsystem.
////////////////////////////////////////////////////////////////////
#include <simgear/misc/commands.hxx>
#include <Environment/environment_mgr.hxx>
+#include <Systems/system_mgr.hxx>
#include "globals.hxx"
#include "viewmgr.hxx"
warp( 0 ),
warp_delta( 0 ),
logger(0),
+ systemmgr(new FGSystemMgr),
props(new SGPropertyNode),
initial_state(0),
commands(new SGCommandMgr),
class FGControls;
class FGSteam;
class FGSoundMgr;
+class FGSystemMgr;
class FGAutopilot;
class FGFX;
class FGViewMgr;
// sound-effects manager
FGFX *fx;
+ // aircraft system manager
+ FGSystemMgr * systemmgr;
+
// environment information
FGEnvironmentMgr * environment_mgr;
inline FGSoundMgr *get_soundmgr() const { return soundmgr; }
inline void set_soundmgr( FGSoundMgr *sm ) { soundmgr = sm; }
+ inline FGSystemMgr *get_systemmgr() const { return systemmgr; }
+
inline FGFX *get_fx() const { return fx; }
inline void set_fx( FGFX *x ) { fx = x; }
# include <Sound/fg_fx.hxx>
# include <Sound/morse.hxx>
#endif
+#include <Systems/system_mgr.hxx>
#include <Time/FGEventMgr.hxx>
#include <Time/fg_timer.hxx>
#include <Time/light.hxx>
}
#endif
+ globals->get_systemmgr()->update( delta_time_sec );
+
//
// Tile Manager updates - see if we need to load any new scenery tiles.
// this code ties together the fdm, viewer and scenery classes...
endif
SUBDIRS = \
- Include \
+ Include \
Aircraft \
Airports \
ATC \
Controls \
FDM \
GUI \
- Input \
+ Input \
Model \
- Navaids \
+ Navaids \
$(NETWORK_DIRS) \
Objects \
Scenery \
- Sound \
+ Sound \
+ Systems \
Time \
$(WEATHER_DIR) \
Main
--- /dev/null
+SUBDIRS = Vacuum
+
+noinst_LIBRARIES = libSystems.a
+
+libSystems_a_SOURCES = system_mgr.cxx system_mgr.hxx
+
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
--- /dev/null
+// system_mgr.cxx - manage aircraft systems.
+// Written by David Megginson, started 2002.
+//
+// This file is in the Public Domain and comes with no warranty.
+
+
+#include "system_mgr.hxx"
+#include "Vacuum/vacuum.hxx"
+
+
+FGSystemMgr::FGSystemMgr ()
+{
+ // NO-OP
+}
+
+FGSystemMgr::~FGSystemMgr ()
+{
+ for (int i = 0; i < _systems.size(); i++) {
+ delete _systems[i];
+ _systems[i] = 0;
+ }
+}
+
+void
+FGSystemMgr::init ()
+{
+ // TODO: replace with XML configuration
+ _systems.push_back(new VacuumSystem);
+
+ // Initialize the individual systems
+ for (int i = 0; i < _systems.size(); i++)
+ _systems[i]->init();
+}
+
+void
+FGSystemMgr::bind ()
+{
+ // NO-OP
+}
+
+void
+FGSystemMgr::unbind ()
+{
+ // NO-OP
+}
+
+void
+FGSystemMgr::update (double dt)
+{
+ for (int i = 0; i < _systems.size(); i++)
+ _systems[i]->update(dt);
+}
+
+// end of system_manager.cxx
--- /dev/null
+// system_mgr.hxx - manage aircraft systems.
+// Written by David Megginson, started 2002.
+//
+// This file is in the Public Domain and comes with no warranty.
+
+
+#ifndef __SYSTEM_MGR_HXX
+#define __SYSTEM_MGR_HXX 1
+
+#ifndef __cplusplus
+# error This library requires C++
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#include <Main/fgfs.hxx>
+
+#include <vector>
+
+SG_USING_STD(vector);
+
+
+/**
+ * Manage aircraft systems.
+ *
+ * In the initial draft, the systems present are hard-coded, but they
+ * will soon be configurable for individual aircraft.
+ */
+class FGSystemMgr : public FGSubsystem
+{
+public:
+
+ FGSystemMgr ();
+ virtual ~FGSystemMgr ();
+
+ virtual void init ();
+ virtual void bind ();
+ virtual void unbind ();
+ virtual void update (double dt);
+
+private:
+ vector<FGSubsystem *> _systems;
+
+};
+
+#endif // __SYSTEM_MGR_HXX