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