]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/instrument_mgr.cxx
Make more use of SGGeod
[flightgear.git] / src / Instrumentation / instrument_mgr.cxx
index 37f4da0e3fac346585ac84814f965f0e9e5b7f5b..126faa19f4c3ecf369fb488d7d2640d42e39c428 100644 (file)
@@ -3,6 +3,10 @@
 //
 // This file is in the Public Domain and comes with no warranty.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <iostream>
 #include <string>
 #include <sstream>
@@ -39,6 +43,7 @@
 #include "od_gauge.hxx"
 #include "wxradar.hxx"
 #include "tacan.hxx" 
+#include "mk_viii.hxx"
 
 
 FGInstrumentMgr::FGInstrumentMgr ()
@@ -59,17 +64,11 @@ FGInstrumentMgr::FGInstrumentMgr ()
         try {
             readProperties( config.str(), config_props );
 
-            if ( build() ) {
-                enabled = true;
-            } else {
-                SG_LOG( SG_ALL, SG_ALERT,
-                        "Detected an internal inconsistancy in the instrumentation");
-                SG_LOG( SG_ALL, SG_ALERT,
-                        " system specification file.  See earlier errors for" );
-                SG_LOG( SG_ALL, SG_ALERT,
-                        " details.");
-                exit(-1);
-            }        
+            if ( !build() ) {
+                throw sg_throwable(string(
+                        "Detected an internal inconsistency in the instrumentation\n"
+                        "system specification file.  See earlier errors for details."));
+            }
         } catch (const sg_exception& exc) {
             SG_LOG( SG_ALL, SG_ALERT, "Failed to load instrumentation system model: "
                     << config.str() );
@@ -96,7 +95,6 @@ bool FGInstrumentMgr::build ()
     for ( i = 0; i < count; ++i ) {
         node = config_props->getChild(i);
         string name = node->getName();
-        cout<< "instrument name: " << name << endl;
         std::ostringstream temp;
         temp << i;
         if ( name == "adf" ) {
@@ -162,7 +160,9 @@ bool FGInstrumentMgr::build ()
         } else if ( name == "tacan" ) { 
             set_subsystem( "instrument" + temp.str(), 
                            new TACAN( node ) );
-                           
+        } else if ( name == "mk-viii" ) { 
+            set_subsystem( "instrument" + temp.str(), 
+                           new MK_VIII( node ) );
         } else {
             SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: " 
                     << name );