]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/testgps.cxx
Merge branch 'maint'
[flightgear.git] / src / Instrumentation / testgps.cxx
index 23e491b179248731e4a304c91a4a9438fcff2f69..cc73bded0efbb8468fee3a78dff97603eb7e76c3 100644 (file)
@@ -72,6 +72,21 @@ int main(int argc, char* argv[])
   
   SG_LOG(SG_GENERAL, SG_ALERT, "hello world!");
   
+  const FGAirport* egph = fgFindAirportID("EGPH");
+  SG_LOG(SG_GENERAL, SG_ALERT, "egph: cart location:" << egph->cart());
+  
+  FGAirport::AirportFilter af;
+  FGPositioned::List l = FGPositioned::findClosestN(egph->geod(), 20, 2000.0, &af);
+  for (unsigned int i=0; i<l.size(); ++i) {
+    SG_LOG(SG_GENERAL, SG_ALERT, "\t" << l[i]->ident() << "/" << l[i]->name());
+  }
+  
+  //l = FGPositioned::findWithinRange(egph->geod(), 500.0, &af);
+  //for (unsigned int i=0; i<l.size(); ++i) {
+  //  SG_LOG(SG_GENERAL, SG_ALERT, "\t" << l[i]->ident() << "/" << l[i]->name());
+  //}
+  
+
   FGRouteMgr* rm = new FGRouteMgr;
   globals->add_subsystem( "route-manager", rm );
   
@@ -84,7 +99,7 @@ int main(int argc, char* argv[])
   GPS* gps = new GPS(nd);
   globals->add_subsystem("gps", gps);
   
-  const FGAirport* egph = fgFindAirportID("EGPH");
+  
   testSetPosition(egph->geod());
   
   // startup the route manager
@@ -102,7 +117,7 @@ int main(int argc, char* argv[])
   gps->update(0.05);
   gps->update(0.05);
   
-  scratch->setStringValue("ident", "TL");
+  scratch->setStringValue("query", "TL");
   scratch->setStringValue("type", "Vor");
   scratch->setBoolValue("exact", false);
   nd->setStringValue("command", "search");
@@ -118,7 +133,7 @@ int main(int argc, char* argv[])
   nd->setDoubleValue("config/min-runway-length-ft", 5000.0);
   scratch->setBoolValue("exact", false);
   scratch->setBoolValue("order-by-distance", false);
-  scratch->setStringValue("ident", "KS");
+  scratch->setStringValue("query", "KS");
   scratch->setStringValue("type", "apt");
   
   nd->setStringValue("command", "search");
@@ -134,7 +149,7 @@ int main(int argc, char* argv[])
   scratch->setBoolValue("exact", true);
   scratch->setBoolValue("order-by-distance", true);
   scratch->setStringValue("type", "vor");
-  scratch->setStringValue("ident", "DCS");
+  scratch->setStringValue("query", "DCS");
   
   nd->setStringValue("command", "search");
   printScratch(scratch);
@@ -145,7 +160,7 @@ int main(int argc, char* argv[])
 // search on totally missing
   scratch->setBoolValue("exact", true);
   scratch->setBoolValue("order-by-distance", true);
-  scratch->setStringValue("ident", "FOFOFOFOF");
+  scratch->setStringValue("query", "FOFOFOFOF");
   nd->setStringValue("command", "search");
   printScratch(scratch);
   
@@ -168,7 +183,7 @@ int main(int argc, char* argv[])
     << " " << wp1->getDoubleValue("latitude-deg"));
 
 // OBS mode
-  scratch->setStringValue("ident", "UW");
+  scratch->setStringValue("query", "UW");
   scratch->setBoolValue("order-by-distance", true);
   nd->setStringValue("command", "search");
   printScratch(scratch);