Backcourse ILS needle should move correct direction now.
This commit is contained in:
parent
79cabb6a8a
commit
4a61945285
2 changed files with 18 additions and 8 deletions
|
@ -400,8 +400,13 @@ int FGAutopilot::run() {
|
|||
|
||||
// determine our current radial position relative to the
|
||||
// navaid in "true" heading.
|
||||
double cur_radial = current_radiostack->get_nav1_heading() +
|
||||
current_radiostack->get_nav1_magvar();
|
||||
double cur_radial = current_radiostack->get_nav1_heading();
|
||||
if ( current_radiostack->get_nav1_loc() ) {
|
||||
// ILS localizers radials are already "true" in our
|
||||
// database
|
||||
} else {
|
||||
cur_radial += current_radiostack->get_nav1_magvar();
|
||||
}
|
||||
if ( current_radiostack->get_nav1_from_flag() ) {
|
||||
cur_radial += 180.0;
|
||||
while ( cur_radial >= 360.0 ) { cur_radial -= 360.0; }
|
||||
|
|
|
@ -455,14 +455,19 @@ double FGRadioStack::get_nav1_heading_needle_deflection() const {
|
|||
// cout << "Radial = " << nav1_radial
|
||||
// << " Bearing = " << nav1_heading << endl;
|
||||
|
||||
while (r> 180.0) r-=360.0;
|
||||
while (r<-180.0) r+=360.0;
|
||||
if ( fabs(r) > 90.0 )
|
||||
while ( r > 180.0 ) { r -= 360.0;}
|
||||
while ( r < -180.0 ) { r += 360.0;}
|
||||
if ( fabs(r) > 90.0 ) {
|
||||
r = ( r<0.0 ? -r-180.0 : -r+180.0 );
|
||||
if ( nav1_loc ) {
|
||||
r = -r;
|
||||
}
|
||||
}
|
||||
|
||||
// According to Robin Peel, the ILS is 4x more sensitive than a vor
|
||||
if ( nav1_loc ) r *= 4.0;
|
||||
if ( r < -10.0 ) r = -10.0;
|
||||
if ( r > 10.0 ) r = 10.0;
|
||||
if ( nav1_loc ) { r *= 4.0; }
|
||||
if ( r < -10.0 ) { r = -10.0; }
|
||||
if ( r > 10.0 ) { r = 10.0; }
|
||||
} else {
|
||||
r = 0.0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue