]> git.mxchange.org Git - flightgear.git/commitdiff
Backcourse ILS needle should move correct direction now.
authorcurt <curt>
Tue, 27 Feb 2001 23:52:52 +0000 (23:52 +0000)
committercurt <curt>
Tue, 27 Feb 2001 23:52:52 +0000 (23:52 +0000)
src/Autopilot/newauto.cxx
src/Cockpit/radiostack.cxx

index 7b904bb1e4ca4753038e48d28206b1ceb986958d..99bf553c1c182fc33b063c39f83f4bfc48e754a4 100644 (file)
@@ -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; }
index 62096af5d809bddc671c5c3f9b9a071ee1e67214..9b93cc8bc296bbfe95a274629f3803a090076823 100644 (file)
@@ -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;
     }