]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/trafficcontrol.hxx
Added some stubs in the flightgear main code to eventually add a full, FGSubsystems...
[flightgear.git] / src / ATC / trafficcontrol.hxx
index 850a0f930c6fa1c81867b69bc6633a4d04c60da4..d069a5b84120af9e5fa2773b4f13383c0b3f7dde 100644 (file)
@@ -45,7 +45,6 @@ typedef vector<int>::iterator intVecIterator;
 
 class FGAIFlightPlan;  // forward reference
 class FGGroundNetwork; // forward reference
-//class FGAISchedule;    // forward reference
 class FGAIAircraft;    // forward reference
 
 /**************************************************************************************
@@ -108,7 +107,9 @@ private:
   int id, waitsForId;
   int currentPos;
   int leg;
+  int frequencyId;
   int state;
+  bool allowTransmission;
   time_t timer;
   intVec intentions;
   FGATCInstruction instruction;
@@ -128,6 +129,7 @@ public:
   void setLeg(int lg) { leg = lg;};
   int getId() { return id;};
   int getState() { return state;};
+  void setState(int s) { state = s;}
   FGATCInstruction getInstruction() { return instruction;};
   bool hasInstruction() { return instruction.hasInstruction(); };
   void setPositionAndHeading(double lat, double lon, double hdg, double spd, double alt);
@@ -165,12 +167,19 @@ public:
   string getRunway() { return runway; };
   //void setCallSign(string clsgn) { callsign = clsgn; };
   void setAircraft(FGAIAircraft *ref) { aircraft = ref;};
-  void updateState() { state++;};
+  void updateState() { state++; allowTransmission=true; };
   //string getCallSign() { return callsign; };
   FGAIAircraft *getAircraft() { return aircraft;};
   int getTime() { return timer; };
   int getLeg() { return leg; };
   void setTime(time_t time) { timer = time; };
+
+  bool pushBackAllowed();
+  bool allowTransmissions() { return allowTransmission; };
+  void suppressRepeatedTransmissions () { allowTransmission=false; };
+  void allowRepeatedTransmissions () { allowTransmission=true; };
+  void nextFrequency() { frequencyId++; };
+  int  getNextFrequency() { return frequencyId; };
 };
 
 typedef vector<FGTrafficRecord> TrafficVector;
@@ -202,23 +211,40 @@ typedef vector<ActiveRunway>::iterator ActiveRunwayVecIterator;
  *************************************************************************************/
 class FGATCController
 {
-private:
+protected:
+  bool available;
+  time_t lastTransmission;
+
   double dt_count;
 
 
   string formatATCFrequency3_2(int );
+  string genTransponderCode(string fltRules);
 
 public:
   typedef enum {
       MSG_ANNOUNCE_ENGINE_START,
-      MSG_REQUEST_ENGINE_START, 
+      MSG_REQUEST_ENGINE_START,
       MSG_PERMIT_ENGINE_START,
       MSG_DENY_ENGINE_START,
-      MSG_ACKNOWLEDGE_ENGINE_START } AtcMsgId;
+      MSG_ACKNOWLEDGE_ENGINE_START,
+      MSG_REQUEST_PUSHBACK_CLEARANCE,
+      MSG_PERMIT_PUSHBACK_CLEARANCE,
+      MSG_HOLD_PUSHBACK_CLEARANCE,
+      MSG_ACKNOWLEDGE_SWITCH_GROUND_FREQUENCY,
+      MSG_INITIATE_CONTACT,
+      MSG_ACKNOWLEDGE_INITIATE_CONTACT,
+      MSG_REQUEST_TAXI_CLEARANCE,
+      MSG_ISSUE_TAXI_CLEARANCE,
+      MSG_ACKNOWLEDGE_TAXI_CLEARANCE,
+      MSG_HOLD_POSITION,
+      MSG_ACKNOWLEDGE_HOLD_POSITION,
+      MSG_RESUME_TAXI,
+      MSG_ACKNOWLEDGE_RESUME_TAXI } AtcMsgId;
   typedef enum {
       ATC_AIR_TO_GROUND,
       ATC_GROUND_TO_AIR } AtcMsgDir;
-  FGATCController() { dt_count = 0;};
+  FGATCController();
   virtual ~FGATCController() {};
   virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
                                double lat, double lon,
@@ -271,8 +297,6 @@ class FGStartupController : public FGATCController
 {
 private:
   TrafficVector activeTraffic;
-  bool available;
-  time_t lastTransmission;
   //ActiveRunwayVec activeRunways;
   
 public: