X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Finstrument_mgr.cxx;h=126faa19f4c3ecf369fb488d7d2640d42e39c428;hb=ef52b23e3a1aaf44d1a2283c920a70367960abff;hp=f95fe9f78050579a513655b144fd755ee7fd4ca8;hpb=7ece674857f66d4aef2bfcce2aa57ed110e3d867;p=flightgear.git diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index f95fe9f78..126faa19f 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -3,6 +3,10 @@ // // This file is in the Public Domain and comes with no warranty. +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -39,6 +43,7 @@ #include "od_gauge.hxx" #include "wxradar.hxx" #include "tacan.hxx" +#include "mk_viii.hxx" FGInstrumentMgr::FGInstrumentMgr () @@ -59,16 +64,10 @@ FGInstrumentMgr::FGInstrumentMgr () try { readProperties( config.str(), config_props ); - if ( build() ) { - enabled = true; - } else { - SG_LOG( SG_ALL, SG_ALERT, - "Detected an internal inconsistency 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: " @@ -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,6 +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 );