]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.hxx
Add a *really* crude model of ITT, Oil Temp, and Oil Pressure. This
[flightgear.git] / src / Airports / simple.hxx
index 881f3b3651633f48a344b7ac858746f2432bf429..d6c84a7b49a1e92368434f75eb31ccb7b63cef57 100644 (file)
@@ -4,7 +4,7 @@
 //
 // Written by Curtis Olson, started April 1998.
 //
-// Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
+// Copyright (C) 1998  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -48,14 +48,13 @@ SG_USING_STD(vector);
 
 
 struct FGAirport {
-
     string id;
     double longitude;
     double latitude;
     double elevation;
     string code;
     string name;
-
+    bool has_metar;
 };
 
 typedef map < string, FGAirport > airport_map;
@@ -69,13 +68,13 @@ class FGAirportList {
 
 private:
 
-    airport_map airports;
-    airport_list airports2;
+    airport_map airports_by_id;
+    airport_list airports_array;
 
 public:
 
     // Constructor
-    FGAirportList( const stringfile );
+    FGAirportList( const string &airport_file, const string &metar_file );
 
     // Destructor
     ~FGAirportList();
@@ -86,16 +85,29 @@ public:
     // "airport" is not changed if "apt" is not found.
     FGAirport search( const string& id );
 
+    // search for the airport closest to the specified position
+    // (currently a linear inefficient search so it's probably not
+    // best to use this at runtime.)  If with_metar is true, then only
+    // return station id's marked as having metar data.
+    FGAirport search( double lon_deg, double lat_deg, bool with_metar );
+
+
     /**
      * Return the number of airports in the list.
      */
-    int size () const;
+    int size() const;
 
 
     /**
      * Return a specific airport, by position.
      */
-    const FGAirport * getAirport (int index) const;
+    const FGAirport *getAirport( int index ) const;
+
+
+    /**
+     * Mark the specified airport record as not having metar
+     */
+    void no_metar( const string &id );
 
 };