1
0
Fork 0

Stub in a place holder for the electrical system model.

This commit is contained in:
curt 2002-09-24 15:24:04 +00:00
parent 512f37185a
commit 90e64f9430
5 changed files with 149 additions and 4 deletions

View 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 \

View 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

View file

@ -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)
{
}

View file

@ -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

View 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