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