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:
parent
9993e0a588
commit
976f3115a9
2 changed files with 11 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
|
@ -268,6 +268,7 @@ private:
|
|||
const char* getWP0Ident() const;
|
||||
const char* getWP0Name() const;
|
||||
|
||||
bool getWP1IValid() const;
|
||||
const char* getWP1Ident() const;
|
||||
const char* getWP1Name() const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue