]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/instrument_mgr.cxx
Decrease the error (slightly) from a power glide.
[flightgear.git] / src / Instrumentation / instrument_mgr.cxx
1 // instrument_mgr.cxx - manage aircraft instruments.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain and comes with no warranty.
5
6
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"
13
14
15 FGInstrumentMgr::FGInstrumentMgr ()
16 {
17     // NO-OP
18 }
19
20 FGInstrumentMgr::~FGInstrumentMgr ()
21 {
22     for (unsigned int i = 0; i < _instruments.size(); i++) {
23         delete _instruments[i];
24         _instruments[i] = 0;
25     }
26 }
27
28 void
29 FGInstrumentMgr::init ()
30 {
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);
37
38                                 // Initialize the individual instruments
39     for (unsigned int i = 0; i < _instruments.size(); i++)
40         _instruments[i]->init();
41 }
42
43 void
44 FGInstrumentMgr::bind ()
45 {
46     // NO-OP
47 }
48
49 void
50 FGInstrumentMgr::unbind ()
51 {
52     // NO-OP
53 }
54
55 void
56 FGInstrumentMgr::update (double dt)
57 {
58     for (unsigned int i = 0; i < _instruments.size(); i++)
59         _instruments[i]->update(dt);
60 }
61
62 // end of instrument_manager.cxx