]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/instrument_mgr.cxx
Added a heading-indicator connected to the vacuum pump and a
[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 "altimeter.hxx"
9 #include "attitude_indicator.hxx"
10 #include "heading_indicator.hxx"
11 #include "vertical_speed_indicator.hxx"
12
13
14 FGInstrumentMgr::FGInstrumentMgr ()
15 {
16     // NO-OP
17 }
18
19 FGInstrumentMgr::~FGInstrumentMgr ()
20 {
21     for (unsigned int i = 0; i < _instruments.size(); i++) {
22         delete _instruments[i];
23         _instruments[i] = 0;
24     }
25 }
26
27 void
28 FGInstrumentMgr::init ()
29 {
30                                 // TODO: replace with XML configuration
31     _instruments.push_back(new Altimeter);
32     _instruments.push_back(new AttitudeIndicator);
33     _instruments.push_back(new HeadingIndicator);
34     _instruments.push_back(new VerticalSpeedIndicator);
35
36                                 // Initialize the individual instruments
37     for (unsigned int i = 0; i < _instruments.size(); i++)
38         _instruments[i]->init();
39 }
40
41 void
42 FGInstrumentMgr::bind ()
43 {
44     // NO-OP
45 }
46
47 void
48 FGInstrumentMgr::unbind ()
49 {
50     // NO-OP
51 }
52
53 void
54 FGInstrumentMgr::update (double dt)
55 {
56     for (unsigned int i = 0; i < _instruments.size(); i++)
57         _instruments[i]->update(dt);
58 }
59
60 // end of instrument_manager.cxx