CVS: source/src/Instrumentation gps.cxx, 1.55, 1.56 gps.hxx, 1.21, 1.22

James Turner <[email protected]>
Newsgroups gmane.games.flightgear.cvc
Message-ID <[email protected]>
Update of /var/cvs/FlightGear-0.9/source/src/Instrumentation
In directory baron.flightgear.org:/tmp/cvs-serv13206/src/Instrumentation

Modified Files:
	gps.cxx gps.hxx 
Log Message:
Expose a flag indicating if the GPS is driving the AP (to give clearer user feedback when that is the case)


Index: gps.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/gps.cxx,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- gps.cxx	27 Mar 2010 11:37:25 -0000	1.55
+++ gps.cxx	27 Mar 2010 12:18:51 -0000	1.56
@@ -303,6 +303,7 @@
   fromFlag->alias(wp1_node->getChild("from-flag"));
     
 // autopilot drive properties
+  _apDrivingFlag = fgGetNode("/autopilot/settings/gps-driving-true-heading", true);
   _apTrueHeading = fgGetNode("/autopilot/settings/true-heading-deg",true);
   _apTargetAltitudeFt = fgGetNode("/autopilot/settings/target-altitude-ft", true);
   _apAltitudeLock = fgGetNode("/autopilot/locks/altitude", true);
@@ -958,12 +959,17 @@
 void GPS::driveAutopilot()
 {
   if (!_config.driveAutopilot() || !_realismSimpleGps->getBoolValue()) {
+    _apDrivingFlag->setBoolValue(false);
     return;
   }
  
   // compatability feature - allow the route-manager / GPS to drive the
   // generic autopilot heading hold *in leg mode only* 
-  if (_mode == "leg") {
+  
+  bool drive = _mode == "leg";
+  _apDrivingFlag->setBoolValue(drive);
+  
+  if (drive) {
     // FIXME: we want to set desired track, not heading, here
     _apTrueHeading->setDoubleValue(getWP1Bearing());
   }

Index: gps.hxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/gps.hxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- gps.hxx	27 Mar 2010 11:37:07 -0000	1.21
+++ gps.hxx	27 Mar 2010 12:18:53 -0000	1.22
@@ -413,6 +413,7 @@
   SGPropertyNode_ptr _realismSimpleGps; ///< should the GPS be simple or realistic?
   
 // autopilot drive properties
+  SGPropertyNode_ptr _apDrivingFlag;
   SGPropertyNode_ptr _apTrueHeading;
   SGPropertyNode_ptr _apTargetAltitudeFt;
   SGPropertyNode_ptr _apAltitudeLock;


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.