From 371b5314a8c22ca2b7f5c2e256e2b8979380db4d Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 3 Feb 2003 20:04:56 +0000 Subject: [PATCH] Updates to use new FGILSList api (updated to better match NavList api) --- src/Cockpit/dme.cxx | 18 +++++++++--------- src/Cockpit/navcom.cxx | 42 +++++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/Cockpit/dme.cxx b/src/Cockpit/dme.cxx index e9a10b21c..cc18217d9 100644 --- a/src/Cockpit/dme.cxx +++ b/src/Cockpit/dme.cxx @@ -217,20 +217,20 @@ void FGDME::search() inrange = false; } - FGILS ils; + FGILS *ils; FGNav *nav; - if ( current_ilslist->query( lon, lat, elev, freq, &ils ) ) { - if (ils.get_has_dme()) { + if ( (ils = current_ilslist->findByFreq( freq, lon, lat, elev )) != NULL ) { + if ( ils->get_has_dme() ) { valid = true; - lon = ils.get_loclon(); - lat = ils.get_loclat(); - elev = ils.get_gselev(); + lon = ils->get_loclon(); + lat = ils->get_loclat(); + elev = ils->get_gselev(); range = FG_ILS_DEFAULT_RANGE; effective_range = kludgeRange(elev, elev, range); - x = ils.get_dme_x(); - y = ils.get_dme_y(); - z = ils.get_dme_z(); + x = ils->get_dme_x(); + y = ils->get_dme_y(); + z = ils->get_dme_z(); } } else if ( (nav = current_navlist->findByFreq(freq, lon, lat, elev)) != NULL ) { if (nav->get_has_dme()) { diff --git a/src/Cockpit/navcom.cxx b/src/Cockpit/navcom.cxx index bf2e522ca..b148b4897 100644 --- a/src/Cockpit/navcom.cxx +++ b/src/Cockpit/navcom.cxx @@ -450,42 +450,42 @@ void FGNavCom::search() double lat = lat_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS; double elev = alt_node->getDoubleValue() * SG_FEET_TO_METER; - FGILS ils; + FGILS *ils; FGNav *nav; //////////////////////////////////////////////////////////////////////// // Nav. //////////////////////////////////////////////////////////////////////// - if ( current_ilslist->query( lon, lat, elev, nav_freq, &ils ) ) { - nav_id = ils.get_locident(); + if ( (ils = current_ilslist->findByFreq(nav_freq, lon, lat, elev)) != NULL ) { + nav_id = ils->get_locident(); nav_valid = true; if ( last_nav_id != nav_id || last_nav_vor ) { - nav_trans_ident = ils.get_trans_ident(); + nav_trans_ident = ils->get_trans_ident(); last_nav_id = nav_id; last_nav_vor = false; nav_loc = true; - nav_has_dme = ils.get_has_dme(); - nav_has_gs = ils.get_has_gs(); - - nav_loclon = ils.get_loclon(); - nav_loclat = ils.get_loclat(); - nav_gslon = ils.get_gslon(); - nav_gslat = ils.get_gslat(); - nav_elev = ils.get_gselev(); + nav_has_dme = ils->get_has_dme(); + nav_has_gs = ils->get_has_gs(); + + nav_loclon = ils->get_loclon(); + nav_loclat = ils->get_loclat(); + nav_gslon = ils->get_gslon(); + nav_gslat = ils->get_gslat(); + nav_elev = ils->get_gselev(); nav_magvar = 0; nav_range = FG_ILS_DEFAULT_RANGE; nav_effective_range = nav_range; - nav_target_gs = ils.get_gsangle(); - nav_radial = ils.get_locheading(); + nav_target_gs = ils->get_gsangle(); + nav_radial = ils->get_locheading(); while ( nav_radial < 0.0 ) { nav_radial += 360.0; } while ( nav_radial > 360.0 ) { nav_radial -= 360.0; } - nav_x = ils.get_x(); - nav_y = ils.get_y(); - nav_z = ils.get_z(); - nav_gs_x = ils.get_gs_x(); - nav_gs_y = ils.get_gs_y(); - nav_gs_z = ils.get_gs_z(); + nav_x = ils->get_x(); + nav_y = ils->get_y(); + nav_z = ils->get_z(); + nav_gs_x = ils->get_gs_x(); + nav_gs_y = ils->get_gs_y(); + nav_gs_z = ils->get_gs_z(); if ( globals->get_soundmgr()->exists( nav_fx_name ) ) { globals->get_soundmgr()->remove( nav_fx_name ); @@ -513,7 +513,7 @@ void FGNavCom::search() // << globals->get_time_params()->get_cur_time() << endl; // cout << "Found an ils station in range" << endl; - // cout << " id = " << ils.get_locident() << endl; + // cout << " id = " << ils->get_locident() << endl; } } else if ( (nav = current_navlist->findByFreq(nav_freq, lon, lat, elev)) != NULL ) { nav_id = nav->get_ident(); -- 2.39.5