]> git.mxchange.org Git - flightgear.git/commitdiff
Fix route-manager / GPS sequencing interaction; tied properties need help to fire...
authorjmt <jmt>
Sun, 18 Oct 2009 19:59:01 +0000 (19:59 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 19 Oct 2009 21:56:51 +0000 (23:56 +0200)
src/Autopilot/route_mgr.cxx
src/Autopilot/route_mgr.hxx

index bd6b47e07bea7d64f1686c911a00becd97d6fbbb..0ef72afb53d23bdeebbb332e0e85440bd2f95e13 100644 (file)
@@ -142,7 +142,8 @@ void FGRouteMgr::init() {
   _edited = fgGetNode(RM "signals/edited", true);
   _finished = fgGetNode(RM "signals/finished", true);
   
-  rm->tie("current-wp", SGRawValueMethods<FGRouteMgr, int>
+  _currentWpt = fgGetNode(RM "current-wp", true);
+  _currentWpt->tie(SGRawValueMethods<FGRouteMgr, int>
     (*this, &FGRouteMgr::currentWaypoint, &FGRouteMgr::jumpToIndex));
       
   // temporary distance / eta calculations, for backward-compatability
@@ -519,7 +520,7 @@ bool FGRouteMgr::activate()
     add_waypoint(SGWayPoint(destApt->geod(), destApt->ident(), destApt->name()));
   }
   
-  _route->set_current(0);
+  _route->set_current(1);
   
   double routeDistanceNm = _route->total_distance() * SG_METER_TO_NM;
   totalDistance->setDoubleValue(routeDistanceNm);
@@ -531,7 +532,6 @@ bool FGRouteMgr::activate()
   }
   
   active->setBoolValue(true);
-  sequence(); // sequence will sync up wp0, wp1 and current-wp
   SG_LOG(SG_AUTOPILOT, SG_INFO, "route-manager, activate route ok");
   return true;
 }
@@ -550,6 +550,7 @@ void FGRouteMgr::sequence()
   
   _route->increment_current();
   currentWaypointChanged();
+  _currentWpt->fireValueChanged();
 }
 
 bool FGRouteMgr::checkFinished()
index 2cc6b42f99882356408f1bab067a5ebbac182c4d..31a5041332667cf83d3d0fad209ac17f4dde7e30 100644 (file)
@@ -70,6 +70,8 @@ private:
     
     
     SGPropertyNode_ptr _pathNode;
+    SGPropertyNode_ptr _currentWpt;
+    
     
     /** 
      * Signal property to notify people that the route was edited