]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/tower.hxx
Fix the nmea and garmin output to a) fake a GSA sentence, b) fix a y2k bug
[flightgear.git] / src / ATC / tower.hxx
index 21095126be75747c42bbd21c1059b10945039aa6..f06faeb56455c0eeab74e4844c4ae750bea3647b 100644 (file)
@@ -53,6 +53,16 @@ enum tower_traffic_type {
 
 ostream& operator << (ostream& os, tower_traffic_type ttt);
 
+enum tower_callback_type {
+       USER_REQUEST_VFR_DEPARTURE = 1,
+       USER_REQUEST_VFR_ARRIVAL = 2,
+       USER_REQUEST_VFR_ARRIVAL_FULL_STOP = 3,
+       USER_REQUEST_VFR_ARRIVAL_TOUCH_AND_GO = 4,
+       USER_REPORT_3_MILE_FINAL = 5,
+       USER_REPORT_DOWNWIND = 6,
+       USER_REPORT_RWY_VACATED = 7
+};
+
 // TODO - need some differentiation of IFR and VFR traffic in order to give the former priority.
 
 // Structure for holding details of a plane under tower control.
@@ -82,9 +92,14 @@ public:
        bool longFinalAcknowledged;
        bool finalReported;
        bool finalAcknowledged;
+       bool rwyVacatedReported;
+       bool rwyVacatedAcknowledged;
        bool instructedToGoAround;      // set true if told by tower to go around
        bool onRwy;             // is physically on the runway
        bool nextOnRwy;         // currently projected by tower to be the next on the runway
+       
+       bool vfrArrivalReported;
+       bool vfrArrivalAcknowledged;
 
        // Type of operation the plane is doing
        tower_traffic_type opType;
@@ -113,8 +128,14 @@ public:
        void Init();
        
        void Update(double dt);
+       
+       void ReceiveUserCallback(int code);
 
-       void RequestLandingClearance(string ID);
+       // Contact tower for VFR approach
+       // eg "Cessna Charlie Foxtrot Golf Foxtrot Sierra eight miles South of the airport for full stop with Bravo"
+       // This function probably only called via user interaction - AI planes will have an overloaded function taking a planerec.
+       void VFRArrivalContact(string ID, LandingType opt = AIP_LT_UNKNOWN);
+       
        void RequestDepartureClearance(string ID);      
        void ReportFinal(string ID);
        void ReportLongFinal(string ID);
@@ -137,6 +158,8 @@ public:
        // in the future and consider multi-runway use, airplane weight etc.
        inline string GetActiveRunway() { return activeRwy; }
        inline RunwayDetails GetActiveRunwayDetails() { return rwy; }
+       // Get the pattern direction of the active rwy.
+       inline int GetPatternDirection() { return rwy.patternDirection; }
        
        inline void SetDisplay() { display = true; }
        inline void SetNoDisplay() { display = false; }
@@ -151,6 +174,8 @@ public:
        bool GetCrosswindConstraint(double& cpos);
        bool GetDownwindConstraint(double& dpos);
        bool GetBaseConstraint(double& bpos);
+       
+       string GenText(const string& m, int c);
 
 private:
        FGATCMgr* ATCmgr;       
@@ -302,6 +327,10 @@ private:
        // Currently not sure whether the above should be always +ve or just take the natural orthopos sign (+ve for RH circuit, -ve for LH).
        double base_leg_pos;            // Actual offset distance from the threshold (-ve) that planes are turning to base leg.
        
+       double nominal_crosswind_leg_pos;
+       double nominal_downwind_leg_pos;
+       double nominal_base_leg_pos;
+       
        friend istream& operator>> ( istream&, FGTower& );
 };