]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.cxx
James Turner:
[flightgear.git] / src / Autopilot / route_mgr.cxx
index 3cac4bd303e54ffc638294f07dedf7c2aad6bbb4..e657f2d634be58fd1a77f715904a4b1933fb03ea 100644 (file)
@@ -33,6 +33,7 @@
 #include <FDM/flight.hxx>
 #include <Main/fg_props.hxx>
 #include <Navaids/fixlist.hxx>
+#include <Navaids/fix.hxx>
 #include <Navaids/navlist.hxx>
 
 #include "route_mgr.hxx"
@@ -347,13 +348,13 @@ int FGRouteMgr::make_waypoint( SGWayPoint **wp, const string& tgt ) {
     }
 
     // check for fix id
-    FGFix f;
+    FGFix* f;
     double heading;
     double dist;
 
-    if ( globals->get_fixlist()->query_and_offset( target, lon, lat, 0, &f, &heading, &dist ) ) {
+    if ( globals->get_fixlist()->query_and_offset( target, lon, lat, 0, f, &heading, &dist ) ) {
         SG_LOG( SG_GENERAL, SG_INFO, "Adding waypoint (fix) = " << target );
-        *wp = new SGWayPoint( f.get_lon(), f.get_lat(), alt, SGWayPoint::WGS84, target );
+        *wp = new SGWayPoint( f->get_lon(), f->get_lat(), alt, SGWayPoint::WGS84, target );
         return 3;
     }
 
@@ -408,22 +409,22 @@ bool FGRouteMgr::near_ground() {
 
 // command interface /autopilot/route-manager/input:
 //
-//   @clear             ... clear route
-//   @pop               ... remove first entry
-//   @delete3           ... delete 4th entry
-//   @insert2:ksfo@900  ... insert "ksfo@900" as 3rd entry
-//   ksfo@900           ... append "ksfo@900"
+//   @CLEAR             ... clear route
+//   @POP               ... remove first entry
+//   @DELETE3           ... delete 4th entry
+//   @INSERT2:KSFO@900  ... insert "KSFO@900" as 3rd entry
+//   KSFO@900           ... append "KSFO@900"
 //
 void FGRouteMgr::Listener::valueChanged(SGPropertyNode *prop)
 {
     const char *s = prop->getStringValue();
-    if (!strcmp(s, "@clear"))
+    if (!strcmp(s, "@CLEAR"))
         mgr->init();
-    else if (!strcmp(s, "@pop"))
+    else if (!strcmp(s, "@POP"))
         mgr->pop_waypoint(0);
-    else if (!strncmp(s, "@delete", 7))
+    else if (!strncmp(s, "@DELETE", 7))
         mgr->pop_waypoint(atoi(s + 7));
-    else if (!strncmp(s, "@insert", 7)) {
+    else if (!strncmp(s, "@INSERT", 7)) {
         char *r;
         int pos = strtol(s + 7, &r, 10);
         if (*r++ != ':')