#include <vector>
#include <map>
-#include <Cockpit/panel.hxx>
-
#include <Navaids/navrecord.hxx>
#include <Navaids/navlist.hxx>
#include <Navaids/fixlist.hxx>
virtual void LooseFocus();
// Allows pages that display info for a given ID to have it set/get if they implement these functions.
- virtual void SetId(string s);
- virtual string GetId();
+ virtual void SetId(const string& s);
+ virtual const string& GetId()=0;
inline int GetSubPage() { return(_subPage); }
inline int GetNSubPages() { return(_nSubPages); }
- inline string GetName() { return(_name); }
+ inline const string& GetName() { return(_name); }
protected:
DCLGPS* _parent;
typedef gps_page_list_type::iterator gps_page_list_itr;
// TODO - merge generic GPS functions instead and split out KLN specific stuff.
-class DCLGPS : public SGSubsystem, public FGPanelInstrument {
+class DCLGPS : public SGSubsystem {
friend class GPSPage;
// Returns -1 if no active waypoint.
int GetActiveWaypointIndex();
// Ditto for an arbitrary waypoint id
- int GetWaypointIndex(string id);
+ int GetWaypointIndex(const string& id);
// Returns meters
inline float GetDistToActiveWaypoint() { return _dist2Act; }
// returns -1 if groundspeed is less than 30kts.
// If the waypoint is an unreached part of the active flight plan the time will be via each leg.
// otherwise it will be a direct-to time.
- double GetTimeToWaypoint(string id);
+ double GetTimeToWaypoint(const string& id);
// Return true if waypoint alerting is occuring
inline bool GetWaypointAlert() const { return(_waypointAlert); }
inline bool GetToFlag() const { return(_headingBugTo); }
// Initiate Direct To operation to the supplied ID.
- void DtoInitiate(string id);
+ void DtoInitiate(const string& id);
// Cancel Direct To operation
void DtoCancel();
gps_waypoint_map _waypoints;
private:
// Worker function for the below.
- const GPSWaypoint* ActualFindFirstById(string id, bool exact = false);
+ 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(string id, bool &multi, bool exact = false);
- FGNavRecord* FindFirstVorById(string id, bool &multi, bool exact = false);
- FGNavRecord* FindFirstNDBById(string id, bool &multi, bool exact = false);
- const FGAirport* FindFirstAptById(string id, bool &multi, bool exact = false);
- const FGFix* FindFirstIntById(string id, bool &multi, bool exact = false);
+ const GPSWaypoint* FindFirstById(const string& id, bool &multi, bool exact = false);
+ 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);
+ const FGFix* FindFirstIntById(const string& id, bool &multi, bool exact = false);
// Find the closest VOR to a position in RADIANS.
FGNavRecord* FindClosestVor(double lat_rad, double lon_rad);