]> git.mxchange.org Git - flightgear.git/commitdiff
GPS bug fix: restore startup mode.
authorJames Turner <zakalawe@mac.com>
Tue, 14 Jan 2014 13:04:52 +0000 (13:04 +0000)
committerJames Turner <zakalawe@mac.com>
Tue, 14 Jan 2014 13:04:52 +0000 (13:04 +0000)
- the 'default to current airport' behaviour got broken by the
changes to the scratch.
- expose a 'valid' flag on WP1

src/Instrumentation/gps.cxx
src/Instrumentation/gps.hxx

index a50ee1ff73e2acdea0459d25c59298d5b8cbc058..8fd2b0432ea19292a6b518971bb6b67cad6862e3 100644 (file)
@@ -164,7 +164,8 @@ GPS::init ()
 // autopilot drive properties
   _apDrivingFlag = fgGetNode("/autopilot/settings/gps-driving-true-heading", true);
   _apTrueHeading = fgGetNode("/autopilot/settings/true-heading-deg",true);
-    
+
+  clearScratch();
   clearOutput();
 }
 
@@ -222,6 +223,9 @@ GPS::bind()
   tie(wp0_node, "ID", SGRawValueMethods<GPS, const char*>
       (*this, &GPS::getWP0Ident, NULL));
     
+
+  tie(_currentWayptNode, "valid", SGRawValueMethods<GPS, bool>
+       (*this, &GPS::getWP1IValid, NULL));
     
   tie(_currentWayptNode, "ID", SGRawValueMethods<GPS, const char*>
     (*this, &GPS::getWP1Ident, NULL));
@@ -927,6 +931,11 @@ const char* GPS::getWP0Name() const
   return "";
 }
 
+bool GPS::getWP1IValid() const
+{
+    return _dataValid && _currentWaypt.get();
+}
+
 const char* GPS::getWP1Ident() const
 {
   if ((!_dataValid)||(!_currentWaypt)) {
index 444f029d25d15aed55f5559d89929a57c834f428..a142330ce54742a9c062fe72fc2a5b1d7fc00354 100644 (file)
@@ -268,6 +268,7 @@ private:
     const char* getWP0Ident() const;
     const char* getWP0Name() const;
 
+    bool getWP1IValid() const;
     const char* getWP1Ident() const;
     const char* getWP1Name() const;