]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/navlist.cxx
Various Irix compiler tweaks.
[flightgear.git] / src / Navaids / navlist.cxx
index 7c3c21d0424ce4a8c09c1702ea7c6a405069d157..0bfd42a69189ccc20646444761844814dfd74b2a 100644 (file)
 // $Id$
 
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgstream.hxx>
+#include <simgear/misc/sgstream.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 
 #include "navlist.hxx"
@@ -42,17 +46,14 @@ FGNavList::~FGNavList( void ) {
 
 
 // load the navaids and build the map
-bool FGNavList::init( FGPath path ) {
+bool FGNavList::init( SGPath path ) {
     FGNav n;
 
-    SGTime time_params;
-    time_params.update( 0.0, 0.0, 0 );
-
     navaids.erase( navaids.begin(), navaids.end() );
 
-    fg_gzifstream in( path.str() );
+    sg_gzifstream in( path.str() );
     if ( !in.is_open() ) {
-        FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
         exit(-1);
     }
 
@@ -132,9 +133,12 @@ bool FGNavList::query( double lon, double lat, double elev, double freq,
        d = aircraft.distance3Dsquared( station );
 
        // cout << "  dist = " << sqrt(d)
-       //      << "  range = " << current->get_range() * NM_TO_METER << endl;
-       if ( d < (current->get_range() * NM_TO_METER 
-                 * current->get_range() * NM_TO_METER * 5.0) ) {
+       //      << "  range = " << current->get_range() * SG_NM_TO_METER << endl;
+
+       // match up to twice the published range so we can model
+       // reduced signal strength
+       if ( d < (2 * current->get_range() * SG_NM_TO_METER 
+                 * 2 * current->get_range() * SG_NM_TO_METER ) ) {
            // cout << "matched = " << current->get_ident() << endl;
            *n = *current;
            return true;