- SGPropertyNode *lon;
- SGPropertyNode *lat;
- SGPropertyNode *alt;
-
- // automatic outputs
- SGPropertyNode *true_hdg_deg;
-
- SGPropertyNode *wp0_id;
- SGPropertyNode *wp0_dist;
- SGPropertyNode *wp0_eta;
-
- SGPropertyNode *wp1_id;
- SGPropertyNode *wp1_dist;
- SGPropertyNode *wp1_eta;
-
- SGPropertyNode *wpn_id;
- SGPropertyNode *wpn_dist;
- SGPropertyNode *wpn_eta;
-
-
+ SGPropertyNode_ptr lon;
+ SGPropertyNode_ptr lat;
+ SGPropertyNode_ptr alt;
+ SGPropertyNode_ptr magvar;
+
+ // automatic outputs
+ SGPropertyNode_ptr departure; ///< departure airport information
+ SGPropertyNode_ptr destination; ///< destination airport information
+ SGPropertyNode_ptr alternate; ///< alternate airport information
+ SGPropertyNode_ptr cruise; ///< cruise information
+
+ SGPropertyNode_ptr totalDistance;
+ SGPropertyNode_ptr ete;
+ SGPropertyNode_ptr elapsedFlightTime;
+
+ SGPropertyNode_ptr active;
+ SGPropertyNode_ptr airborne;
+
+ SGPropertyNode_ptr wp0;
+ SGPropertyNode_ptr wp1;
+ SGPropertyNode_ptr wpn;
+
+
+ SGPropertyNode_ptr _pathNode;
+ SGPropertyNode_ptr _currentWpt;
+
+
+ /**
+ * Signal property to notify people that the route was edited
+ */
+ SGPropertyNode_ptr _edited;
+
+ /**
+ * Signal property to notify when the last waypoint is reached
+ */
+ SGPropertyNode_ptr _finished;
+
+ void setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDistance);
+
+ class InputListener : public SGPropertyChangeListener {
+ public:
+ InputListener(FGRouteMgr *m) : mgr(m) {}
+ virtual void valueChanged (SGPropertyNode * prop);
+ private:
+ FGRouteMgr *mgr;
+ };
+
+ SGPropertyNode_ptr input;
+ SGPropertyNode_ptr weightOnWheels;
+
+ InputListener *listener;
+ SGPropertyNode_ptr mirror;
+
+ /**
+ * Create a SGWayPoint from a string in the following format:
+ * - simple identifier
+ * - decimal-lon,decimal-lat
+ * - airport-id/runway-id
+ * - navaid/radial-deg/offset-nm
+ */
+ SGWayPoint* make_waypoint(const string& target);
+
+ /**
+ * Helper to keep various pieces of state in sync when the SGRoute is
+ * modified (waypoints added, inserted, removed). Notably, this fires the
+ * 'edited' signal.
+ */
+ void waypointsChanged();
+
+ void update_mirror();
+
+ void currentWaypointChanged();
+
+ /**
+ * Parse a route/wp node (from a saved, property-lsit formatted route)
+ */
+ void parseRouteWaypoint(SGPropertyNode* aWP);
+
+ /**
+ * Check if we've reached the final waypoint.
+ * Returns true if we have.
+ */
+ bool checkFinished();
+
+// tied getters and setters
+ const char* getDepartureICAO() const;
+ const char* getDepartureName() const;
+ void setDepartureICAO(const char* aIdent);
+
+ const char* getDestinationICAO() const;
+ const char* getDestinationName() const;
+ void setDestinationICAO(const char* aIdent);
+