]> git.mxchange.org Git - flightgear.git/commitdiff
Stub in a place holder for the electrical system model.
authorcurt <curt>
Tue, 24 Sep 2002 15:24:04 +0000 (15:24 +0000)
committercurt <curt>
Tue, 24 Sep 2002 15:24:04 +0000 (15:24 +0000)
src/Main/Makefile.am
src/Systems/Makefile.am
src/Systems/electrical.cxx [new file with mode: 0644]
src/Systems/electrical.hxx [new file with mode: 0644]
src/Systems/system_mgr.cxx

index 90b1d5d96774aff9747e41cc397352bd434f1647..27a68b1c191c51d7aaa31ab5f5929cb3cd59d285 100644 (file)
@@ -59,6 +59,8 @@ fgfs_LDADD = \
        $(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 \
@@ -69,8 +71,6 @@ fgfs_LDADD = \
        $(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 \
index 15d9b863e768cd95258c3e194c91beed5cc4af1f..d254cde857bf74c9bb12570cf7f19abd2c80b853 100644 (file)
@@ -1,6 +1,8 @@
 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
diff --git a/src/Systems/electrical.cxx b/src/Systems/electrical.cxx
new file mode 100644 (file)
index 0000000..283d94f
--- /dev/null
@@ -0,0 +1,73 @@
+// 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)
+{
+}
diff --git a/src/Systems/electrical.hxx b/src/Systems/electrical.hxx
new file mode 100644 (file)
index 0000000..adf46ae
--- /dev/null
@@ -0,0 +1,68 @@
+// 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
index 0feedc134512d7f700f1906a567d97bf07f4cb6e..562231b68e4a751a058a5c580c9acc9719846ddf 100644 (file)
@@ -5,6 +5,7 @@
 
 
 #include "system_mgr.hxx"
+#include "electrical.hxx"
 #include "vacuum.hxx"
 
 
@@ -25,6 +26,7 @@ void
 FGSystemMgr::init ()
 {
                                 // TODO: replace with XML configuration
+    _systems.push_back(new ElectricalSystem);
     _systems.push_back(new VacuumSystem);
 
                                 // Initialize the individual systems