]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AILocalTraffic.hxx
Fix the nmea and garmin output to a) fake a GSA sentence, b) fix a y2k bug
[flightgear.git] / src / ATC / AILocalTraffic.hxx
index d6be8f4e599b9e29c6311b7ef088cc50bc67015e..d6f21c73592fdd8446b5ec0a4fad9ed7c285645d 100644 (file)
 #include <string>
 SG_USING_STD(string);
 
-enum PatternLeg {
-       TAKEOFF_ROLL,
-       CLIMBOUT,
-       TURN1,
-       CROSSWIND,
-       TURN2,
-       DOWNWIND,
-       TURN3,
-       BASE,
-       TURN4,
-       FINAL,
-       LANDING_ROLL
-};
-
 enum TaxiState {
        TD_INBOUND,
        TD_OUTBOUND,
@@ -62,10 +48,10 @@ enum OperatingState {
        PARKED
 };
 
-struct StartofDescent {
+struct StartOfDescent {
        PatternLeg leg;
-       double orthopos_x;
-       double orthopos_y;
+       double x;       // Runway aligned orthopos
+       double y;       // ditto
 };
 
 class FGAILocalTraffic : public FGAIPlane {
@@ -84,6 +70,9 @@ public:
        // Go out and practice circuits
        void FlyCircuits(int numCircuits, bool tag);
        
+       // Return what type of landing we're doing on this circuit
+       LandingType GetLandingOption();
+       
        // TODO - this will get more complex and moved into the main class
        // body eventually since the position approved to taxi to will have
        // to be passed.
@@ -91,10 +80,14 @@ public:
        
        inline void DenyTaxiRequest() {taxiRequestCleared = false;}
        
-       void RegisterTransmission(int code); 
+       void RegisterTransmission(int code);
+       
+       // Process callbacks sent by base class
+       // (These codes are not related to the codes above)
+       void ProcessCallback(int code);
        
        // This is a hack and will probably go eventually
-       inline bool AtHoldShort() {return(holdingShort);}
+       inline bool AtHoldShort() {return holdingShort;}
        
 protected:
        
@@ -156,8 +149,10 @@ private:
        int numInPattern;               // Number of planes in the pattern (this might get more complicated if high performance GA aircraft fly a higher pattern eventually)
        int numAhead;           // More importantly - how many of them are ahead of us?
        double distToNext;              // And even more importantly, how near are we getting to the one immediately ahead?
-       PatternLeg leg;         // Out current position in the pattern
-       StartofDescent SoD;             // Start of descent calculated wrt wind, pattern size & altitude, glideslope etc
+       //PatternLeg leg;               // Our current position in the pattern - now moved to FGAIPlane
+       StartOfDescent SoD;             // Start of descent calculated wrt wind, pattern size & altitude, glideslope etc
+       bool descending;                // We're in the coming down phase of the pattern
+       double targetDescentRate;       // m/s
 
        // Taxiing details
        // At the moment this assumes that all taxiing in is to gates (a loose term that includes
@@ -181,6 +176,8 @@ private:
        bool clearedToLineUp;
        bool clearedToTakeOff;
        bool liningUp;  // Set true when the turn onto the runway heading is commenced when taxiing out
+       bool goAround;  // Set true if need to go-around
+       bool goAroundCalled;    // Set true during go-around only after we have called our go-around on the radio
        bool contactTower;      // we have been told to contact tower
        bool contactGround;     // we have been told to contact ground
        bool changeFreq;        // true when we need to change frequency
@@ -193,7 +190,7 @@ private:
 
        void TransmitPatternPositionReport();
 
-       void CalculateStartofDescent();
+       void CalculateSoD(double base_leg_pos, double downwind_leg_pos, bool pattern_direction);
 
        void ExitRunway(Point3D orthopos);