2002-09-24 14:51:37 +00:00
|
|
|
// instrument_mgr.cxx - manage aircraft instruments.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#include "instrument_mgr.hxx"
|
2002-09-27 18:27:58 +00:00
|
|
|
#include "altimeter.hxx"
|
2002-09-24 14:51:37 +00:00
|
|
|
#include "attitude_indicator.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
FGInstrumentMgr::FGInstrumentMgr ()
|
|
|
|
{
|
|
|
|
// NO-OP
|
|
|
|
}
|
|
|
|
|
|
|
|
FGInstrumentMgr::~FGInstrumentMgr ()
|
|
|
|
{
|
|
|
|
for (unsigned int i = 0; i < _instruments.size(); i++) {
|
|
|
|
delete _instruments[i];
|
|
|
|
_instruments[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGInstrumentMgr::init ()
|
|
|
|
{
|
|
|
|
// TODO: replace with XML configuration
|
2002-09-27 18:27:58 +00:00
|
|
|
_instruments.push_back(new Altimeter);
|
2002-09-24 14:51:37 +00:00
|
|
|
_instruments.push_back(new AttitudeIndicator);
|
|
|
|
|
|
|
|
// Initialize the individual instruments
|
|
|
|
for (unsigned int i = 0; i < _instruments.size(); i++)
|
|
|
|
_instruments[i]->init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGInstrumentMgr::bind ()
|
|
|
|
{
|
|
|
|
// NO-OP
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGInstrumentMgr::unbind ()
|
|
|
|
{
|
|
|
|
// NO-OP
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGInstrumentMgr::update (double dt)
|
|
|
|
{
|
|
|
|
for (unsigned int i = 0; i < _instruments.size(); i++)
|
|
|
|
_instruments[i]->update(dt);
|
|
|
|
}
|
|
|
|
|
|
|
|
// end of instrument_manager.cxx
|