1 // instrument_mgr.cxx - manage aircraft instruments.
2 // Written by David Megginson, started 2002.
4 // This file is in the Public Domain and comes with no warranty.
7 #include "instrument_mgr.hxx"
8 #include "airspeed_indicator.hxx"
9 #include "altimeter.hxx"
10 #include "attitude_indicator.hxx"
11 #include "heading_indicator.hxx"
12 #include "vertical_speed_indicator.hxx"
15 FGInstrumentMgr::FGInstrumentMgr ()
20 FGInstrumentMgr::~FGInstrumentMgr ()
22 for (unsigned int i = 0; i < _instruments.size(); i++) {
23 delete _instruments[i];
29 FGInstrumentMgr::init ()
31 // TODO: replace with XML configuration
32 _instruments.push_back(new AirspeedIndicator);
33 _instruments.push_back(new Altimeter);
34 _instruments.push_back(new AttitudeIndicator);
35 _instruments.push_back(new HeadingIndicator);
36 _instruments.push_back(new VerticalSpeedIndicator);
38 // Initialize the individual instruments
39 for (unsigned int i = 0; i < _instruments.size(); i++)
40 _instruments[i]->init();
44 FGInstrumentMgr::bind ()
50 FGInstrumentMgr::unbind ()
56 FGInstrumentMgr::update (double dt)
58 for (unsigned int i = 0; i < _instruments.size(); i++)
59 _instruments[i]->update(dt);
62 // end of instrument_manager.cxx