From 63df45998f0c8f9f77b5c03e12371e3cf0e495d5 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 12 May 2000 14:09:52 +0000 Subject: [PATCH] More magvar fixes relating to vor/ils. --- src/Autopilot/newauto.cxx | 9 +++++++-- src/Cockpit/steam.cxx | 20 ++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index 664c8c7df..beb25aa6c 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -303,8 +303,13 @@ int FGAutopilot::run() { } else if ( heading_mode == FG_HEADING_NAV1 ) { double tgt_radial; double cur_radial; - tgt_radial = current_radiostack->get_nav1_radial() - + FGBFI::getMagVar(); + if ( current_radiostack->get_nav1_loc() ) { + // localizers radials are "true" + tgt_radial = current_radiostack->get_nav1_radial(); + } else { + tgt_radial = current_radiostack->get_nav1_radial() + + FGBFI::getMagVar(); + } cur_radial = current_radiostack->get_nav1_heading(); cout << "target rad (true) = " << tgt_radial << " current rad (true) = " << cur_radial diff --git a/src/Cockpit/steam.cxx b/src/Cockpit/steam.cxx index 15a071b29..567c7bc67 100644 --- a/src/Cockpit/steam.cxx +++ b/src/Cockpit/steam.cxx @@ -349,8 +349,14 @@ double FGSteam::get_HackVOR1_deg () { double r; if ( current_radiostack->get_nav1_inrange() ) { - r = current_radiostack->get_nav1_heading() - FGBFI::getMagVar() - - current_radiostack->get_nav1_radial(); + if ( current_radiostack->get_nav1_loc() ) { + // localizer doesn't need magvar offset + r = current_radiostack->get_nav1_heading() + - current_radiostack->get_nav1_radial(); + } else { + r = current_radiostack->get_nav1_heading() - FGBFI::getMagVar() + - current_radiostack->get_nav1_radial(); + } // cout << "Radial = " << current_radiostack->get_nav1_radial() // << " Bearing = " << current_radiostack->get_nav1_heading() // << endl; @@ -372,8 +378,14 @@ double FGSteam::get_HackVOR2_deg () { double r; if ( current_radiostack->get_nav2_inrange() ) { - r = current_radiostack->get_nav2_heading() - FGBFI::getMagVar() - - current_radiostack->get_nav2_radial(); + if ( current_radiostack->get_nav2_loc() ) { + // localizer doesn't need magvar offset + r = current_radiostack->get_nav2_heading() + - current_radiostack->get_nav2_radial(); + } else { + r = current_radiostack->get_nav2_heading() - FGBFI::getMagVar() + - current_radiostack->get_nav2_radial(); + } // cout << "Radial = " << current_radiostack->get_nav1_radial() // << " Bearing = " << current_radiostack->get_nav1_heading() << endl;