]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/gps.cxx
Add back power button binding, but move the location to /instrumentation/nav
[flightgear.git] / src / Instrumentation / gps.cxx
index 9e2e9cdf493d1de2e819a8fcb9db38cbc5f120a3..e1fe6077bdfcda9559f6888f2c098d105167ffc5 100644 (file)
@@ -44,9 +44,9 @@ GPS::GPS ( SGPropertyNode *node)
         } else if ( cname == "number" ) {
             num = child->getIntValue();
         } else {
-            SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in gps config logic" );
+            SG_LOG( SG_INSTR, SG_WARN, "Error in gps config logic" );
             if ( name.length() ) {
-                SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name );
+                SG_LOG( SG_INSTR, SG_WARN, "Section = " << name );
             }
         }
     }
@@ -325,12 +325,12 @@ GPS::update (double delta_time_sec)
             FGAirport a;
             //cout << "Airport found" << endl;
             a = globals->get_airports()->search(longitude_deg, latitude_deg, false);
-            _wp1_ID_node->setStringValue(a.id.c_str());
-            wp1_longitude_deg = a.longitude;
-            wp1_latitude_deg = a.latitude;
-            _wp1_name_node->setStringValue(a.name.c_str());
+            _wp1_ID_node->setStringValue(a._id.c_str());
+            wp1_longitude_deg = a._longitude;
+            wp1_latitude_deg = a._latitude;
+            _wp1_name_node->setStringValue(a._name.c_str());
             _get_nearest_airport_node->setBoolValue(false);
-            _last_wp1_ID = wp1_ID = a.id.c_str();
+            _last_wp1_ID = wp1_ID = a._id.c_str();
         }
         
         // If the waypoint 0 ID has changed, try to find the new ID
@@ -341,11 +341,11 @@ GPS::update (double delta_time_sec)
             if (waypont_type == "airport") {
                 FGAirport a;
                 a = globals->get_airports()->search( wp0_ID );
-                if ( a.id == wp0_ID ) {
+                if ( a._id == wp0_ID ) {
                     //cout << "Airport found" << endl;
-                    wp0_longitude_deg = a.longitude;
-                    wp0_latitude_deg = a.latitude;
-                    _wp0_name_node->setStringValue(a.name.c_str());
+                    wp0_longitude_deg = a._longitude;
+                    wp0_latitude_deg = a._latitude;
+                    _wp0_name_node->setStringValue(a._name.c_str());
                 }
             }
             else if (waypont_type == "nav") {
@@ -380,11 +380,11 @@ GPS::update (double delta_time_sec)
             if (waypont_type == "airport") {
                 FGAirport a;
                 a = globals->get_airports()->search( wp1_ID );
-                if ( a.id == wp1_ID ) {
+                if ( a._id == wp1_ID ) {
                     //cout << "Airport found" << endl;
-                    wp1_longitude_deg = a.longitude;
-                    wp1_latitude_deg = a.latitude;
-                    _wp1_name_node->setStringValue(a.name.c_str());
+                    wp1_longitude_deg = a._longitude;
+                    wp1_latitude_deg = a._latitude;
+                    _wp1_name_node->setStringValue(a._name.c_str());
                 }
             }
             else if (waypont_type == "nav") {
@@ -692,6 +692,7 @@ GPS::update (double delta_time_sec)
             popWp->setBoolValue(false);
 
             route->delete_first();
+           _route->removeChild("Waypoint", 0, false);
         }
 
     } else {