]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/instrument_mgr.cxx
Support for multiple data dirs.
[flightgear.git] / src / Instrumentation / instrument_mgr.cxx
index 2a707448c42d2003938870d6a57f9bb5ccc25e46..dbf557eb63ae3590fe9ceadc8c67d66c6451de98 100644 (file)
@@ -110,7 +110,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
 {
     for ( int i = 0; i < config_props->nChildren(); ++i ) {
         SGPropertyNode *node = config_props->getChild(i);
-        string name = node->getName();
+        std::string name = node->getName();
 
         std::ostringstream subsystemname;
         subsystemname << "instrument-" << i << '-'
@@ -118,7 +118,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
         int index = node->getIntValue("number", 0);
         if (index > 0)
             subsystemname << '['<< index << ']';
-        string id = subsystemname.str();
+        std::string id = subsystemname.str();
       
         if ( name == "adf" ) {
             set_subsystem( id, new ADF( node ), 0.15 );
@@ -127,7 +127,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
             set_subsystem( id, new AirspeedIndicator( node ) );
 
         } else if ( name == "altimeter" ) {
-            set_subsystem( id, new Altimeter( node ) );
+            set_subsystem( id, new Altimeter( node, "altimeter" ) );
 
         } else if ( name == "attitude-indicator" ) {
             set_subsystem( id, new AttitudeIndicator( node ) );
@@ -139,10 +139,14 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
             set_subsystem( id, new DME( node ), 1.0 );
 
         } else if ( name == "encoder" ) {
-            set_subsystem( id, new Altimeter( node ), 0.15 );
+            set_subsystem( id, new Altimeter( node, "encoder" ), 0.15 );
 
         } else if ( name == "gps" ) {
-            set_subsystem( id, new GPS( node ) );
+            // post 2.12.0, add a new name (distinct from 'gps'), so
+            // it is possible to create non-default GPS instruments.
+            // then authors of realistic GPS and FMSs can transition to using
+            // that name as they choose.
+            set_subsystem( id, new GPS( node, true /* default GPS mode */ ) );
             _explicitGps = true;
         } else if ( name == "gsdi" ) {
             set_subsystem( id, new GSDI( node ) );