1
0
Fork 0

GPS bug fix: restore startup mode.

- the 'default to current airport' behaviour got broken by the
changes to the scratch. 
- expose a 'valid' flag on WP1
This commit is contained in:
James Turner 2014-01-14 13:04:52 +00:00
parent 9993e0a588
commit 976f3115a9
2 changed files with 11 additions and 1 deletions

View file

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

View file

@ -268,6 +268,7 @@ private:
const char* getWP0Ident() const; const char* getWP0Ident() const;
const char* getWP0Name() const; const char* getWP0Name() const;
bool getWP1IValid() const;
const char* getWP1Ident() const; const char* getWP1Ident() const;
const char* getWP1Name() const; const char* getWP1Name() const;