]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/instrument_mgr.cxx
Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
[flightgear.git] / src / Instrumentation / instrument_mgr.cxx
index 646d3fba0bdf0b49070966d1e3e93388e6aa5c24..58fe89db1a4c5b5a5c7976cc9f133753b51573d3 100644 (file)
 #include "groundradar.hxx"
 #include "agradar.hxx"
 #include "rad_alt.hxx"
+#include "tcas.hxx"
 
 FGInstrumentMgr::FGInstrumentMgr () :
   _explicitGps(false)
 {
     set_subsystem("od_gauge", new FGODGauge);
-    set_subsystem("hud", new HUD);
+    
+    globals->add_subsystem("hud", new HUD, SGSubsystemMgr::DISPLAY);
 }
 
 FGInstrumentMgr::~FGInstrumentMgr ()
@@ -92,9 +94,17 @@ void FGInstrumentMgr::init()
     SGPropertyNode_ptr nd(new SGPropertyNode);
     nd->setStringValue("name", "gps");
     nd->setIntValue("number", 0);
+    _instruments.push_back("gps[0]");
     set_subsystem("gps[0]", new GPS(nd));
   }
 
+  // bind() created instruments before init.
+  for (unsigned int i=0; i<_instruments.size(); ++i) {
+    const std::string& nm(_instruments[i]);
+    SGSubsystem* instr = get_subsystem(nm);
+    instr->bind();
+  }
+
   SGSubsystemGroup::init();
 }
 
@@ -214,6 +224,9 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
         } else if ( name == "radar-altimeter" ) {
             set_subsystem( id, new radAlt( node ),1);
 
+        } else if ( name == "tcas" ) {
+            set_subsystem( id, new TCAS( node ) );
+
         } else {
             SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: "
                     << name );