$(top_builddir)/src/FDM/LaRCsim/libLaRCsim.a \
$(top_builddir)/src/FDM/UIUCModel/libUIUCModel.a \
$(top_builddir)/src/GUI/libGUI.a \
+ $(top_builddir)/src/Input/libInput.a \
+ $(top_builddir)/src/Instrumentation/libInstrumentation.a \
$(top_builddir)/src/Model/libModel.a \
$(top_builddir)/src/Navaids/libNavaids.a \
$(top_builddir)/src/Scenery/libScenery.a \
$(top_builddir)/src/Systems/libSystems.a \
$(top_builddir)/src/Time/libTime.a \
$(WEATHER_LIBS) \
- $(top_builddir)/src/Input/libInput.a \
- $(top_builddir)/src/Instrumentation/libInstrumentation.a \
-lsgroute -lsgsky -lsgclouds3d -lsgephem -lsgtiming -lsgio -lsgscreen \
-lsgmath -lsgbucket -lsgdebug -lsgmagvar -lsgmisc -lsgxml \
-lsgserial \
noinst_LIBRARIES = libSystems.a
-libSystems_a_SOURCES = system_mgr.cxx system_mgr.hxx \
- vacuum.cxx vacuum.hxx
+libSystems_a_SOURCES = \
+ system_mgr.cxx system_mgr.hxx \
+ electrical.cxx electrical.hxx \
+ vacuum.cxx vacuum.hxx
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
--- /dev/null
+// electrical.cxx - a flexible, generic electrical system model.
+//
+// Written by Curtis Olson, started September 2002.
+//
+// Copyright (C) 2002 Curtis L. Olson - curt@flightgear.org
+//
+// 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$
+
+
+#include <simgear/misc/exception.hxx>
+#include <simgear/misc/sg_path.hxx>
+
+#include <Main/fg_props.hxx>
+#include <Main/globals.hxx>
+
+#include "electrical.hxx"
+
+ElectricalSystem::ElectricalSystem ()
+{
+}
+
+ElectricalSystem::~ElectricalSystem ()
+{
+}
+
+void
+ElectricalSystem::init ()
+{
+ config_props = new SGPropertyNode;
+
+ SGPath config( globals->get_fg_root() );
+ config.append( fgGetString("/systems/electrical/path") );
+
+ SG_LOG( SG_ALL, SG_ALERT, "Reading electrical system model from "
+ << config.str() );
+ try {
+ readProperties( config.str(), config_props );
+ } catch (const sg_exception& exc) {
+ SG_LOG( SG_ALL, SG_ALERT, "Failed to load electrical system model: "
+ << config.str() );
+ }
+
+ delete config_props;
+}
+
+void
+ElectricalSystem::bind ()
+{
+}
+
+void
+ElectricalSystem::unbind ()
+{
+}
+
+void
+ElectricalSystem::update (double dt)
+{
+}
--- /dev/null
+// electrical.hxx - a flexible, generic electrical system model.
+//
+// Written by Curtis Olson, started September 2002.
+//
+// Copyright (C) 2002 Curtis L. Olson - curt@flightgear.org
+//
+// 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 _SYSTEMS_ELECTRICAL_HXX
+#define _SYSTEMS_ELECTRICAL_HXX 1
+
+#ifndef __cplusplus
+# error This library requires C++
+#endif
+
+#include <simgear/misc/props.hxx>
+#include <Main/fgfs.hxx>
+
+
+/**
+ * Model an electrical system. This is a simple system with the
+ * alternator hardwired to engine[0]/rpm
+ *
+ * Input properties:
+ *
+ * /engines/engine[0]/rpm
+ *
+ * Output properties:
+ *
+ *
+ */
+
+class ElectricalSystem : public FGSubsystem
+{
+
+public:
+
+ ElectricalSystem ();
+ virtual ~ElectricalSystem ();
+
+ virtual void init ();
+ virtual void bind ();
+ virtual void unbind ();
+ virtual void update (double dt);
+
+private:
+
+ SGPropertyNode *config_props;
+ // SGPropertyNode_ptr _serviceable_node;
+
+};
+
+#endif // _SYSTEMS_ELECTRICAL_HXX
#include "system_mgr.hxx"
+#include "electrical.hxx"
#include "vacuum.hxx"
FGSystemMgr::init ()
{
// TODO: replace with XML configuration
+ _systems.push_back(new ElectricalSystem);
_systems.push_back(new VacuumSystem);
// Initialize the individual systems