X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fdclgps.hxx;h=435f7899a25e51f53e5ca4ed2a229a8eee3bcfac;hb=c6045147544badd6daefdcab9d4de1ed6936533b;hp=c05bf75ff672955527d03dd8bce95b2afe7beecd;hpb=a243a24393cd4f9ab1033e9afe4bc2e49af85c28;p=flightgear.git diff --git a/src/Instrumentation/dclgps.hxx b/src/Instrumentation/dclgps.hxx index c05bf75ff..435f7899a 100644 --- a/src/Instrumentation/dclgps.hxx +++ b/src/Instrumentation/dclgps.hxx @@ -32,13 +32,16 @@ #include #include -#include -#include -#include -#include #include +#include -using namespace std; +class SGTime; +class FGPositioned; + +// XXX fix me +class FGNavRecord; +class FGAirport; +class FGFix; enum GPSDistanceUnits { GPS_DIST_UNITS_NM = 0, @@ -89,6 +92,11 @@ ostream& operator << (ostream& os, GPSAppWpType type); struct GPSWaypoint { GPSWaypoint(); + + GPSWaypoint(const std::string& aIdent, float lat, float lon, GPSWpType aType); + + static GPSWaypoint* createFromPositioned(const FGPositioned* aFix); + ~GPSWaypoint(); string GetAprId(); // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc) string id; @@ -405,14 +413,13 @@ protected: // // Data and lookup functions - // All waypoints mapped by id. - gps_waypoint_map _waypoints; -private: - // Worker function for the below. - const GPSWaypoint* ActualFindFirstById(const string& id, bool exact = false); + + protected: // Find first of any type of waypoint by id. (TODO - Possibly we should return multiple waypoints here). - const GPSWaypoint* FindFirstById(const string& id, bool &multi, bool exact = false); + GPSWaypoint* FindFirstById(const string& id) const; + GPSWaypoint* FindFirstByExactId(const string& id) const; + FGNavRecord* FindFirstVorById(const string& id, bool &multi, bool exact = false); FGNavRecord* FindFirstNDBById(const string& id, bool &multi, bool exact = false); const FGAirport* FindFirstAptById(const string& id, bool &multi, bool exact = false); @@ -420,6 +427,9 @@ protected: // Find the closest VOR to a position in RADIANS. FGNavRecord* FindClosestVor(double lat_rad, double lon_rad); + // helper to implement the above FindFirstXXX methods + FGPositioned* FindTypedFirstById(const std::string& id, FGPositioned::Type ty, bool &multi, bool exact); + // Position, orientation and velocity. // These should be read from FG's built-in GPS logic if possible. // Use the property node pointers below to do this.