Move the submodels code from the Systems manager into it's own Subsystem manager.
This commit is contained in:
parent
a938b5b0df
commit
29b5147478
6 changed files with 18 additions and 18 deletions
|
@ -1,6 +1,7 @@
|
||||||
noinst_LIBRARIES = libAIModel.a
|
noinst_LIBRARIES = libAIModel.a
|
||||||
|
|
||||||
libAIModel_a_SOURCES = \
|
libAIModel_a_SOURCES = \
|
||||||
|
submodel.cxx submodel.hxx \
|
||||||
AIManager.hxx AIManager.cxx \
|
AIManager.hxx AIManager.cxx \
|
||||||
AIBase.hxx AIBase.cxx \
|
AIBase.hxx AIBase.cxx \
|
||||||
AIAircraft.hxx AIAircraft.cxx \
|
AIAircraft.hxx AIAircraft.cxx \
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
#include <AIModel/AIManager.hxx>
|
#include <AIModel/AIManager.hxx>
|
||||||
|
|
||||||
|
|
||||||
const double SubmodelSystem::lbs_to_slugs = 0.031080950172;
|
const double FGSubmodelMgr::lbs_to_slugs = 0.031080950172;
|
||||||
|
|
||||||
SubmodelSystem::SubmodelSystem ()
|
FGSubmodelMgr::FGSubmodelMgr ()
|
||||||
{
|
{
|
||||||
|
|
||||||
x_offset = y_offset = 0.0;
|
x_offset = y_offset = 0.0;
|
||||||
|
@ -28,12 +28,12 @@ SubmodelSystem::SubmodelSystem ()
|
||||||
string contents_node;
|
string contents_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubmodelSystem::~SubmodelSystem ()
|
FGSubmodelMgr::~FGSubmodelMgr ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::init ()
|
FGSubmodelMgr::init ()
|
||||||
{
|
{
|
||||||
load();
|
load();
|
||||||
_serviceable_node = fgGetNode("/sim/systems/submodels/serviceable", true);
|
_serviceable_node = fgGetNode("/sim/systems/submodels/serviceable", true);
|
||||||
|
@ -63,12 +63,12 @@ SubmodelSystem::init ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::bind ()
|
FGSubmodelMgr::bind ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::unbind ()
|
FGSubmodelMgr::unbind ()
|
||||||
{
|
{
|
||||||
submodel_iterator = submodels.begin();
|
submodel_iterator = submodels.begin();
|
||||||
while(submodel_iterator != submodels.end()) {
|
while(submodel_iterator != submodels.end()) {
|
||||||
|
@ -78,7 +78,7 @@ SubmodelSystem::unbind ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::update (double dt)
|
FGSubmodelMgr::update (double dt)
|
||||||
{
|
{
|
||||||
if (!(_serviceable_node->getBoolValue())) return;
|
if (!(_serviceable_node->getBoolValue())) return;
|
||||||
int i=-1;
|
int i=-1;
|
||||||
|
@ -98,7 +98,7 @@ SubmodelSystem::update (double dt)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SubmodelSystem::release (submodel* sm, double dt)
|
FGSubmodelMgr::release (submodel* sm, double dt)
|
||||||
{
|
{
|
||||||
sm->timer += dt;
|
sm->timer += dt;
|
||||||
if (sm->timer < sm->delay) return false;
|
if (sm->timer < sm->delay) return false;
|
||||||
|
@ -137,7 +137,7 @@ SubmodelSystem::release (submodel* sm, double dt)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::load ()
|
FGSubmodelMgr::load ()
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@ -205,7 +205,7 @@ SubmodelSystem::load ()
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::transform( submodel* sm)
|
FGSubmodelMgr::transform( submodel* sm)
|
||||||
{
|
{
|
||||||
|
|
||||||
// get initial conditions
|
// get initial conditions
|
||||||
|
@ -335,7 +335,7 @@ SubmodelSystem::transform( submodel* sm)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubmodelSystem::updatelat(double lat)
|
FGSubmodelMgr::updatelat(double lat)
|
||||||
{
|
{
|
||||||
double latitude = lat;
|
double latitude = lat;
|
||||||
ft_per_deg_latitude = 366468.96 - 3717.12 * cos(latitude / SG_RADIANS_TO_DEGREES);
|
ft_per_deg_latitude = 366468.96 - 3717.12 * cos(latitude / SG_RADIANS_TO_DEGREES);
|
|
@ -20,7 +20,7 @@ SG_USING_STD(vector);
|
||||||
SG_USING_STD(string);
|
SG_USING_STD(string);
|
||||||
|
|
||||||
|
|
||||||
class SubmodelSystem : public SGSubsystem
|
class FGSubmodelMgr : public SGSubsystem
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -73,8 +73,8 @@ public:
|
||||||
double mass;
|
double mass;
|
||||||
} IC_struct;
|
} IC_struct;
|
||||||
|
|
||||||
SubmodelSystem ();
|
FGSubmodelMgr ();
|
||||||
~SubmodelSystem ();
|
~FGSubmodelMgr ();
|
||||||
|
|
||||||
void load ();
|
void load ();
|
||||||
void init ();
|
void init ();
|
|
@ -100,6 +100,7 @@
|
||||||
#include <Input/input.hxx>
|
#include <Input/input.hxx>
|
||||||
#include <Instrumentation/instrument_mgr.hxx>
|
#include <Instrumentation/instrument_mgr.hxx>
|
||||||
#include <Model/acmodel.hxx>
|
#include <Model/acmodel.hxx>
|
||||||
|
#include <AIModel/submodel.hxx>
|
||||||
#include <AIModel/AIManager.hxx>
|
#include <AIModel/AIManager.hxx>
|
||||||
#include <Navaids/navdb.hxx>
|
#include <Navaids/navdb.hxx>
|
||||||
#include <Navaids/navlist.hxx>
|
#include <Navaids/navlist.hxx>
|
||||||
|
@ -1693,6 +1694,7 @@ bool fgInitSubsystems() {
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, " AI Model Manager");
|
SG_LOG(SG_GENERAL, SG_INFO, " AI Model Manager");
|
||||||
globals->add_subsystem("ai_model", new FGAIManager);
|
globals->add_subsystem("ai_model", new FGAIManager);
|
||||||
|
globals->add_subsystem("submodel_mgr", new FGSubmodelMgr);
|
||||||
|
|
||||||
|
|
||||||
// It's probably a good idea to initialize the top level traffic manager
|
// It's probably a good idea to initialize the top level traffic manager
|
||||||
|
|
|
@ -5,7 +5,6 @@ libSystems_a_SOURCES = \
|
||||||
electrical.cxx electrical.hxx \
|
electrical.cxx electrical.hxx \
|
||||||
pitot.cxx pitot.hxx \
|
pitot.cxx pitot.hxx \
|
||||||
static.cxx static.hxx \
|
static.cxx static.hxx \
|
||||||
vacuum.cxx vacuum.hxx \
|
vacuum.cxx vacuum.hxx
|
||||||
submodel.cxx submodel.hxx
|
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
|
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
|
||||||
|
|
|
@ -20,13 +20,11 @@
|
||||||
#include "pitot.hxx"
|
#include "pitot.hxx"
|
||||||
#include "static.hxx"
|
#include "static.hxx"
|
||||||
#include "vacuum.hxx"
|
#include "vacuum.hxx"
|
||||||
#include "submodel.hxx"
|
|
||||||
|
|
||||||
|
|
||||||
FGSystemMgr::FGSystemMgr ()
|
FGSystemMgr::FGSystemMgr ()
|
||||||
{
|
{
|
||||||
set_subsystem( "electrical", new FGElectricalSystem );
|
set_subsystem( "electrical", new FGElectricalSystem );
|
||||||
set_subsystem( "submodel", new SubmodelSystem() );
|
|
||||||
|
|
||||||
config_props = new SGPropertyNode;
|
config_props = new SGPropertyNode;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue