]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/navdb.cxx
MapWidget: make use of the new POI system and display cities on the map.
[flightgear.git] / src / Navaids / navdb.cxx
index 5c592c1c4bbed9b6f7c178e22ef080f5f9c7e8c1..9cc1654a974259e52e4c88d0b70cd73afd7303ff 100644 (file)
@@ -40,7 +40,7 @@
 #include "navlist.hxx"
 #include <Main/globals.hxx>
 #include <Navaids/markerbeacon.hxx>
-#include <Airports/simple.hxx>
+#include <Airports/airport.hxx>
 #include <Airports/runways.hxx>
 #include <Airports/xmlloader.hxx>
 #include <Main/fg_props.hxx>
@@ -97,7 +97,7 @@ void alignLocaliserWithRunway(FGRunway* rwy, const string& ident, SGGeod& pos, d
     pos = SGGeod::fromGeodFt(newPos, pos.getElevationFt());
     heading = rwy->headingDeg();
   } else {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "localizer:" << ident << ", aligning with runway "
+    SG_LOG(SG_NAVAID, SG_DEBUG, "localizer:" << ident << ", aligning with runway "
            << rwy->ident() << " exceeded heading threshold");
   }
 }
@@ -107,7 +107,7 @@ static double defaultNavRange(const string& ident, FGPositioned::Type type)
   // Ranges are included with the latest data format, no need to
   // assign our own defaults, unless the range is not set for some
   // reason.
-  SG_LOG(SG_GENERAL, SG_DEBUG, "navaid " << ident << " has no range set, using defaults");
+  SG_LOG(SG_NAVAID, SG_DEBUG, "navaid " << ident << " has no range set, using defaults");
   switch (type) {
     case FGPositioned::NDB:
     case FGPositioned::VOR:
@@ -164,7 +164,7 @@ static PositionedID readNavFromStream(std::istream& aStream,
       assert(runway);
       pos.setElevationFt(runway->geod().getElevationFt());
     }
-    
+
     return cache->insertNavaid(type, string(), name, pos, 0, 0, 0,
                                arp.first, arp.second);
   }
@@ -183,10 +183,14 @@ static PositionedID readNavFromStream(std::istream& aStream,
     if (arp.second) {
       runway = static_cast<FGRunway*>(cache->loadById(arp.second));
       assert(runway);
+#if 0
+      // code is disabled since it's causing some problems, see
+      // http://code.google.com/p/flightgear-bugs/issues/detail?id=926
       if (elev_ft < 0.01) {
         // snap to runway elevation
         pos.setElevationFt(runway->geod().getElevationFt());
       }
+#endif
     } // of found runway in the DB
   } // of type is runway-related
   
@@ -216,7 +220,7 @@ bool navDBInit(const SGPath& path)
 {
     sg_gzifstream in( path.str() );
     if ( !in.is_open() ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
       return false;
     }
   
@@ -238,11 +242,11 @@ bool navDBInit(const SGPath& path)
   
 bool loadCarrierNav(const SGPath& path)
 {    
-    SG_LOG( SG_GENERAL, SG_INFO, "opening file: " << path.str() );    
+    SG_LOG( SG_NAVAID, SG_INFO, "opening file: " << path.str() );    
     sg_gzifstream incarrier( path.str() );
     
     if ( !incarrier.is_open() ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
       return false;
     }
     
@@ -256,11 +260,11 @@ bool loadCarrierNav(const SGPath& path)
   
 bool loadTacan(const SGPath& path, FGTACANList *channellist)
 {
-    SG_LOG( SG_GENERAL, SG_INFO, "opening file: " << path.str() );
+    SG_LOG( SG_NAVAID, SG_INFO, "opening file: " << path.str() );
     sg_gzifstream inchannel( path.str() );
     
     if ( !inchannel.is_open() ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
       return false;
     }