Converted to a simple FGSubsystemGroup.
This commit is contained in:
parent
70dde366bc
commit
91c8dd3196
2 changed files with 5 additions and 52 deletions
|
@ -13,48 +13,14 @@
|
|||
|
||||
FGSystemMgr::FGSystemMgr ()
|
||||
{
|
||||
// NO-OP
|
||||
set_subsystem("electrical", new FGElectricalSystem);
|
||||
set_subsystem("pitot", new PitotSystem);
|
||||
set_subsystem("static", new StaticSystem);
|
||||
set_subsystem("vacuum", new VacuumSystem);
|
||||
}
|
||||
|
||||
FGSystemMgr::~FGSystemMgr ()
|
||||
{
|
||||
for (unsigned 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 FGElectricalSystem);
|
||||
_systems.push_back(new PitotSystem);
|
||||
_systems.push_back(new StaticSystem);
|
||||
_systems.push_back(new VacuumSystem);
|
||||
|
||||
// Initialize the individual systems
|
||||
for (unsigned 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 (unsigned int i = 0; i < _systems.size(); i++)
|
||||
_systems[i]->update(dt);
|
||||
}
|
||||
|
||||
// end of system_manager.cxx
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
|
||||
#include <Main/fgfs.hxx>
|
||||
|
||||
#include <vector>
|
||||
|
||||
SG_USING_STD(vector);
|
||||
|
||||
|
||||
/**
|
||||
* Manage aircraft systems.
|
||||
|
@ -30,21 +26,12 @@ SG_USING_STD(vector);
|
|||
* In the initial draft, the systems present are hard-coded, but they
|
||||
* will soon be configurable for individual aircraft.
|
||||
*/
|
||||
class FGSystemMgr : public FGSubsystem
|
||||
class FGSystemMgr : public FGSubsystemGroup
|
||||
{
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue