_turnRate(3.0), // degrees-per-second, so 180 degree turn takes 60 seconds
_overflightArmDistance(1.0),
_waypointAlertTime(30.0),
- _minRunwayLengthFt(0.0),
_requireHardSurface(true),
_cdiMaxDeflectionNm(3.0), // linear mode, 3nm at the peg
_driveAutopilot(true),
aOwner->tie(aCfg, "turn-rate-deg-sec", SGRawValuePointer<double>(&_turnRate));
aOwner->tie(aCfg, "turn-anticipation", SGRawValuePointer<bool>(&_enableTurnAnticipation));
aOwner->tie(aCfg, "wpt-alert-time", SGRawValuePointer<double>(&_waypointAlertTime));
- aOwner->tie(aCfg, "min-runway-length-ft", SGRawValuePointer<double>(&_minRunwayLengthFt));
aOwner->tie(aCfg, "hard-surface-runways-only", SGRawValuePointer<bool>(&_requireHardSurface));
aOwner->tie(aCfg, "cdi-max-deflection-nm", SGRawValuePointer<double>(&_cdiMaxDeflectionNm));
aOwner->tie(aCfg, "drive-autopilot", SGRawValuePointer<bool>(&_driveAutopilot));
// last thing, add the deprecated prop watcher
new DeprecatedPropListener(_gpsNode);
-
+}
+
+void
+GPS::reinit ()
+{
clearOutput();
}
}
if (_dataValid && (_mode == "init")) {
- // allow a realistic delay in the future, here
- SG_LOG(SG_INSTR, SG_INFO, "GPS initialisation complete");
if (_route_active_node->getBoolValue()) {
// GPS init with active route
selectOBSMode();
}
}
+
+ if (_mode != "init")
+ {
+ // allow a realistic delay in the future, here
+ SG_LOG(SG_INSTR, SG_INFO, "GPS initialisation complete");
+ }
} // of init mode check
_last_pos = _indicated_pos;
if (_ref_navaid) {
_ref_navaid_set = true;
- SG_LOG(SG_INSTR, SG_INFO, "GPS code set explict ref-navaid:" << _ref_navaid->ident());
+ SG_LOG(SG_INSTR, SG_INFO, "GPS code set explicit ref-navaid:" << _ref_navaid->ident());
_ref_navaid_id_node->setStringValue(_ref_navaid->ident().c_str());
_ref_navaid_name_node->setStringValue(_ref_navaid->name().c_str());
FGNavRecord* vor = (FGNavRecord*) _ref_navaid.ptr();
SG_LOG(SG_INSTR, SG_INFO, "GPS waypoint index is now " << index);
if (index > 0) {
- _prevWaypt = _routeMgr->previousWaypt();
+ _prevWaypt = _routeMgr->wayptAtIndex(index - 1);
if (_prevWaypt->flag(WPT_DYNAMIC)) {
_wp0_position = _indicated_pos;
} else {
// check for wp1 being on active route - resume leg mode
if (_routeMgr->isRouteActive()) {
- int index = _routeMgr->findWayptIndex(_currentWaypt->position());
+ int index = _routeMgr->flightPlan()->findWayptIndex(_currentWaypt->position());
if (index >= 0) {
SG_LOG(SG_INSTR, SG_INFO, "GPS DTO, resuming LEG mode at wp:" << index);
_mode = "leg";
{
_inTurn = true;
_turnSequenced = false;
- SG_LOG(SG_INSTR, SG_INFO, "begining turn");
+ SG_LOG(SG_INSTR, SG_INFO, "beginning turn");
}
void GPS::endTurn()
return;
}
- WayptRef next = _routeMgr->nextWaypt();
+ WayptRef next = _routeMgr->wayptAtIndex(_routeMgr->currentIndex() + 1);
if (!next || next->flag(WPT_DYNAMIC)) {
_anticipateTurn = false;
return;
FGPositioned::Filter* GPS::createFilter(FGPositioned::Type aTy)
{
if (aTy == FGPositioned::AIRPORT) {
- return new FGAirport::HardSurfaceFilter(_config.minRunwayLengthFt());
+ return new FGAirport::HardSurfaceFilter();
}
// if we were passed INVALID, assume it means 'all types interesting to a GPS'
string ident = _scratchNode->getStringValue("ident");
WayptRef wpt = new BasicWaypt(_scratchPos, ident, NULL);
- _routeMgr->insertWayptAtIndex(wpt, aIndex);
+ _routeMgr->flightPlan()->insertWayptAtIndex(wpt, aIndex);
}
void GPS::removeWaypointAtIndex(int aIndex)
throw sg_range_exception("GPS::removeWaypointAtIndex: index out of bounds");
}
- _routeMgr->removeWayptAtIndex(aIndex);
+ _routeMgr->removeLegAtIndex(aIndex);
}
void GPS::tieSGGeod(SGPropertyNode* aNode, SGGeod& aRef,