1
0
Fork 0

Work around the penaltyForNav broken-ness, by ensuring GS behaves sanely even if non-matches LOC and GS transmitters are selected. Which happens. Yuck.

This commit is contained in:
jmt 2009-09-15 10:15:42 +00:00 committed by Tim Moore
parent c1598361ca
commit ebf5dcb828

View file

@ -819,14 +819,22 @@ void FGNavRadio::search()
int tmp = (int)(_gs->get_multiuse() / 1000.0); int tmp = (int)(_gs->get_multiuse() / 1000.0);
target_gs = (double)tmp / 100.0; target_gs = (double)tmp / 100.0;
// until penaltyForNav goes away, we cannot assume we always pick
// paired LOC/GS trasmsitters. As we pass over a runway threshold, we
// often end up picking the 'wrong' LOC, but the correct GS. To avoid
// breaking the basis computation, ensure we use the GS radial and not
// the (potentially reversed) LOC radial.
double gs_radial = fmod(_gs->get_multiuse(), 1000.0);
SG_NORMALIZE_RANGE(gs_radial, 0.0, 360.0);
// GS axis unit tangent vector // GS axis unit tangent vector
// (along the runway) // (along the runway)
_gsCart = _gs->cart(); _gsCart = _gs->cart();
_gsAxis = tangentVector(_gs->geod(), _gsCart, target_radial); _gsAxis = tangentVector(_gs->geod(), _gsCart, gs_radial);
// GS baseline unit tangent vector // GS baseline unit tangent vector
// (perpendicular to the runay along the ground) // (perpendicular to the runay along the ground)
SGVec3d baseline = tangentVector(_gs->geod(), _gsCart, target_radial + 90.0); SGVec3d baseline = tangentVector(_gs->geod(), _gsCart, gs_radial + 90.0);
_gsVertical = cross(baseline, _gsAxis); _gsVertical = cross(baseline, _gsAxis);
} // of have glideslope } // of have glideslope
} // of found LOC or ILS } // of found LOC or ILS