Set runway elevation to the airport elevation, and don't reset ILS/LOC elevation when aligning with runways.
This commit is contained in:
parent
2f6107982c
commit
80e67b17c2
2 changed files with 3 additions and 5 deletions
|
@ -257,7 +257,7 @@ private:
|
||||||
last_rwy_heading = heading;
|
last_rwy_heading = heading;
|
||||||
|
|
||||||
int surface_code = atoi( token[10].c_str() );
|
int surface_code = atoi( token[10].c_str() );
|
||||||
SGGeod pos(SGGeod::fromDegFt(lon, lat, 0.0));
|
SGGeod pos(SGGeod::fromDegFt(lon, lat, last_apt_elev));
|
||||||
|
|
||||||
if (rwy_no[0] == 'x') {
|
if (rwy_no[0] == 'x') {
|
||||||
// taxiway
|
// taxiway
|
||||||
|
|
|
@ -161,9 +161,7 @@ void FGNavRecord::processSceneryILS(SGPropertyNode* aILSNode)
|
||||||
void FGNavRecord::alignLocaliserWithRunway(double aThreshold)
|
void FGNavRecord::alignLocaliserWithRunway(double aThreshold)
|
||||||
{
|
{
|
||||||
// find the distance from the threshold to the localizer
|
// find the distance from the threshold to the localizer
|
||||||
SGGeod runwayThreshold(mRunway->threshold());
|
double dist = SGGeodesy::distanceM(mPosition, mRunway->threshold());
|
||||||
double dist, az1, az2;
|
|
||||||
SGGeodesy::inverse(mPosition, runwayThreshold, az1, az2, dist);
|
|
||||||
|
|
||||||
// back project that distance along the runway center line
|
// back project that distance along the runway center line
|
||||||
SGGeod newPos = mRunway->pointOnCenterline(dist);
|
SGGeod newPos = mRunway->pointOnCenterline(dist);
|
||||||
|
@ -172,7 +170,7 @@ void FGNavRecord::alignLocaliserWithRunway(double aThreshold)
|
||||||
SG_NORMALIZE_RANGE(hdg_diff, -180.0, 180.0);
|
SG_NORMALIZE_RANGE(hdg_diff, -180.0, 180.0);
|
||||||
|
|
||||||
if ( fabs(hdg_diff) <= aThreshold ) {
|
if ( fabs(hdg_diff) <= aThreshold ) {
|
||||||
mPosition = newPos;
|
mPosition = SGGeod::fromGeodFt(newPos, mPosition.getElevationFt());
|
||||||
set_multiuse( mRunway->headingDeg() );
|
set_multiuse( mRunway->headingDeg() );
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_GENERAL, SG_WARN, "localizer:" << ident() << ", aligning with runway "
|
SG_LOG(SG_GENERAL, SG_WARN, "localizer:" << ident() << ", aligning with runway "
|
||||||
|
|
Loading…
Reference in a new issue