]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AILocalTraffic.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / ATC / AILocalTraffic.hxx
index 0d97a2e677db69e2f229e9dc6d225f7170855023..a5297e85ea04138e9b83c6d9215a4dc7610cf9e7 100644 (file)
 #include <string>
 SG_USING_STD(string);
 
-typedef enum PatternLeg {
-       TAKEOFF_ROLL,
-       CLIMBOUT,
-       TURN1,
-       CROSSWIND,
-       TURN2,
-       DOWNWIND,
-       TURN3,
-       BASE,
-       TURN4,
-       FINAL,
-       LANDING_ROLL
-};
-
-typedef enum TaxiState {
+enum TaxiState {
        TD_INBOUND,
        TD_OUTBOUND,
-       TD_NONE
+       TD_NONE,
+       TD_LINING_UP
 };
 
-typedef enum OperatingState {
+enum OperatingState {
        IN_PATTERN,
        TAXIING,
        PARKED
 };
 
-// perhaps we could use an FGRunway instead of this
-typedef struct RunwayDetails {
-       Point3D threshold_pos;
-       Point3D end1ortho;      // ortho projection end1 (the threshold ATM)
-       Point3D end2ortho;      // ortho projection end2 (the take off end in the current hardwired scheme)
-       double mag_hdg;
-       double mag_var;
-       double hdg;             // true runway heading
-       double length;  // In *METERS*
-       int ID;         // 1 -> 36
-       string rwyID;
-};
-
-typedef struct StartofDescent {
+struct StartofDescent {
        PatternLeg leg;
        double orthopos_x;
        double orthopos_y;
@@ -96,6 +70,18 @@ public:
        // Go out and practice circuits
        void FlyCircuits(int numCircuits, bool tag);
        
+       // 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.
+       inline void ApproveTaxiRequest() {taxiRequestCleared = true;}
+       
+       inline void DenyTaxiRequest() {taxiRequestCleared = false;}
+       
+       void RegisterTransmission(int code); 
+       
+       // This is a hack and will probably go eventually
+       inline bool AtHoldShort() {return holdingShort;}
+       
 protected:
        
        // Attempt to enter the traffic pattern in a reasonably intelligent manner
@@ -156,7 +142,7 @@ 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
+       //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
 
        // Taxiing details
@@ -164,6 +150,8 @@ private:
        // any permitted parking spot) and that all taxiing out is to runways.
        bool parked;
        bool taxiing;
+       bool taxiRequestPending;
+       bool taxiRequestCleared;
        TaxiState taxiState;
        double desiredTaxiHeading;
        double taxiTurnRadius;
@@ -172,8 +160,18 @@ private:
        ground_network_path_type path;  // a path through the ground network for the plane to taxi
        unsigned int taxiPathPos;       // position of iterator in taxi path when applicable
        node* nextTaxiNode;     // next node in taxi path
+       node* holdShortNode;
        //Runway out_dest; //FIXME - implement this
+       bool holdingShort;
+       bool reportReadyForDeparture;   // set true when ATC has requested that the plane report when ready for departure
+       bool clearedToLineUp;
+       bool clearedToTakeOff;
        bool liningUp;  // Set true when the turn onto the runway heading is commenced when taxiing out
+       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
+       atc_type changeFreqType;        // the service we need to change to
+       double responseCounter;         // timer in seconds to allow response to requests to be a little while after them
 
        void FlyTrafficPattern(double dt);