X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Frnav_waypt_controller.cxx;h=e0f30e92a1edf1f20e8af537191eb97d4da5105d;hb=0f462d4a6e8ac37126dc91b52999e6bf47f5f17d;hp=09ac2b81274c908c1557e76dc18d594fca4aee0b;hpb=ebbd5bfd0542b2b3bb731f2964f5500a5f2bd12c;p=flightgear.git diff --git a/src/Instrumentation/rnav_waypt_controller.cxx b/src/Instrumentation/rnav_waypt_controller.cxx index 09ac2b812..e0f30e92a 100644 --- a/src/Instrumentation/rnav_waypt_controller.cxx +++ b/src/Instrumentation/rnav_waypt_controller.cxx @@ -86,12 +86,12 @@ bool geocRadialIntersection(const SGGeoc& a, double r1, const SGGeoc& b, double double ang2 = SGMiscd::normalizeAngle2(crs21-crs23); if ((sin(ang1) == 0.0) && (sin(ang2) == 0.0)) { - SG_LOG(SG_GENERAL, SG_WARN, "geocRadialIntersection: infinity of intersections"); + SG_LOG(SG_INSTR, SG_WARN, "geocRadialIntersection: infinity of intersections"); return false; } if ((sin(ang1)*sin(ang2))<0.0) { - SG_LOG(SG_GENERAL, SG_WARN, "geocRadialIntersection: intersection ambiguous"); + SG_LOG(SG_INSTR, SG_WARN, "geocRadialIntersection: intersection ambiguous"); return false; } @@ -221,7 +221,7 @@ private: /** * Special controller for runways. For runways, we want very narrow deviation - * contraints, and to understand that any point along the paved area is + * constraints, and to understand that any point along the paved area is * equivalent to being 'at' the runway. */ class RunwayCtl : public WayptController @@ -252,7 +252,7 @@ public: double _courseDev = brg - _targetTrack; SG_NORMALIZE_RANGE(_courseDev, -180.0, 180.0); - if (fabs(_courseDev) > 90.0) { + if ((fabs(_courseDev) > 90.0) && (_distanceM < _rnav->overflightArmDistanceM())) { setDone(); } } @@ -320,21 +320,21 @@ public: case RESTRICT_AT: { double d = curAlt - _waypt->altitudeFt(); if (fabs(d) < 50.0) { - SG_LOG(SG_GENERAL, SG_INFO, "ConstHdgToAltCtl, reached target altitude " << _waypt->altitudeFt()); + SG_LOG(SG_INSTR, SG_INFO, "ConstHdgToAltCtl, reached target altitude " << _waypt->altitudeFt()); setDone(); } } break; case RESTRICT_ABOVE: if (curAlt >= _waypt->altitudeFt()) { - SG_LOG(SG_GENERAL, SG_INFO, "ConstHdgToAltCtl, above target altitude " << _waypt->altitudeFt()); + SG_LOG(SG_INSTR, SG_INFO, "ConstHdgToAltCtl, above target altitude " << _waypt->altitudeFt()); setDone(); } break; case RESTRICT_BELOW: if (curAlt <= _waypt->altitudeFt()) { - SG_LOG(SG_GENERAL, SG_INFO, "ConstHdgToAltCtl, below target altitude " << _waypt->altitudeFt()); + SG_LOG(SG_INSTR, SG_INFO, "ConstHdgToAltCtl, below target altitude " << _waypt->altitudeFt()); setDone(); } break; @@ -342,6 +342,9 @@ public: case RESTRICT_NONE: assert(false); break; + case SPEED_RESTRICT_MACH: + assert(false); + break; } } @@ -392,7 +395,7 @@ public: double r = SGGeodesy::courseDeg(_waypt->position(), _rnav->position()); SG_LOG(SG_AUTOPILOT, SG_INFO, "current radial=" << r); if (fabs(r - _trueRadial) < 0.5) { - SG_LOG(SG_GENERAL, SG_INFO, "InterceptCtl, intercepted radial " << _trueRadial); + SG_LOG(SG_INSTR, SG_INFO, "InterceptCtl, intercepted radial " << _trueRadial); setDone(); } } @@ -437,7 +440,7 @@ public: _distanceNm = SGGeodesy::distanceNm(_rnav->position(), _dme->position()); double d = fabs(_distanceNm - _dme->dmeDistanceNm()); if (d < 0.1) { - SG_LOG(SG_GENERAL, SG_INFO, "DMEInterceptCtl, intercepted DME " << _dme->dmeDistanceNm()); + SG_LOG(SG_INSTR, SG_INFO, "DMEInterceptCtl, intercepted DME " << _dme->dmeDistanceNm()); setDone(); } }