X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATC%2Ftrafficcontrol.hxx;h=7e83a72b476097808a23c9745046a93eab2d1a64;hb=08ff6e2e2ef9debdcfd958b9c98457fda4c80388;hp=d069a5b84120af9e5fa2773b4f13383c0b3f7dde;hpb=ca9078f2bc268ae9f51c95177a65e582fafe2264;p=flightgear.git diff --git a/src/ATC/trafficcontrol.hxx b/src/ATC/trafficcontrol.hxx index d069a5b84..7e83a72b4 100644 --- a/src/ATC/trafficcontrol.hxx +++ b/src/ATC/trafficcontrol.hxx @@ -28,6 +28,8 @@ #include +// There is probably a better include than sg_geodesy to get the SG_NM_TO_METER... +#include #include @@ -185,6 +187,9 @@ public: typedef vector TrafficVector; typedef vector::iterator TrafficVectorIterator; +typedef vector TimeVector; +typedef vector::iterator TimeVectorIterator; + /*********************************************************************** * Active runway, a utility class to keep track of which aircraft has @@ -195,11 +200,18 @@ class ActiveRunway private: string rwy; int currentlyCleared; + double distanceToFinal; + TimeVector estimatedArrivalTimes; public: - ActiveRunway(string r, int cc) { rwy = r; currentlyCleared = cc; }; + ActiveRunway(string r, int cc) { rwy = r; currentlyCleared = cc; distanceToFinal = 6.0 * SG_NM_TO_METER; }; string getRunwayName() { return rwy; }; int getCleared () { return currentlyCleared; }; + double getApproachDistance() { return distanceToFinal; }; + //time_t getEstApproachTime() { return estimatedArrival; }; + + //void setEstApproachTime(time_t time) { estimatedArrival = time; }; + time_t requestTimeSlot(time_t eta); }; typedef vector ActiveRunwayVec; @@ -207,7 +219,7 @@ typedef vector::iterator ActiveRunwayVecIterator; /** * class FGATCController - * NOTE: this class serves as an abstraction layer for all sorts of ATC controller. + * NOTE: this class serves as an abstraction layer for all sorts of ATC controllers. *************************************************************************************/ class FGATCController { @@ -317,4 +329,33 @@ public: }; +/****************************************************************************** + * class FGTowerControl + *****************************************************************************/ +class FGApproachController : public FGATCController +{ +private: + TrafficVector activeTraffic; + ActiveRunwayVec activeRunways; + +public: + FGApproachController(); + virtual ~FGApproachController() {}; + virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute, + double lat, double lon, + double hdg, double spd, double alt, double radius, int leg, + FGAIAircraft *aircraft); + virtual void signOff(int id); + virtual void update(int id, double lat, double lon, + double heading, double speed, double alt, double dt); + virtual bool hasInstruction(int id); + virtual FGATCInstruction getInstruction(int id); + + ActiveRunway* getRunway(string name); + + bool hasActiveTraffic() { return activeTraffic.size() != 0; }; + TrafficVector &getActiveTraffic() { return activeTraffic; }; +}; + + #endif // _TRAFFIC_CONTROL_HXX