X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FAirports%2Fdynamics.hxx;h=d3dbedaa27b50256e600b5215632e7bf0cf1f1a3;hb=2f3faf4b8a00d97aeaf57f46a5ff7193ffb19089;hp=9712c5b8059c8be5262f317d3df1e63e5bb919e4;hpb=f9de92f53db91c45e4bd885ba606749e9597fdbb;p=flightgear.git diff --git a/src/Airports/dynamics.hxx b/src/Airports/dynamics.hxx index 9712c5b80..d3dbedaa2 100644 --- a/src/Airports/dynamics.hxx +++ b/src/Airports/dynamics.hxx @@ -22,37 +22,31 @@ #ifndef _AIRPORT_DYNAMICS_HXX_ #define _AIRPORT_DYNAMICS_HXX_ - -#ifndef __cplusplus -# error This library requires C++ -#endif - -#include - #include #include "parking.hxx" #include "groundnetwork.hxx" #include "runwayprefs.hxx" +#include "sidstar.hxx" -//typedef vector DoubleVec; -//typedef vector::iterator DoubleVecIterator; - +// forward decls class FGAirport; - +class FGEnvironment; class FGAirportDynamics { private: FGAirport* _ap; - FGParkingVec parkings; - FGRunwayPreference rwyPrefs; - FGStartupController startupController; - FGGroundNetwork groundNetwork; - FGTowerController towerController; + FGParkingVec parkings; + FGRunwayPreference rwyPrefs; + FGSidStar SIDs; + FGStartupController startupController; + FGGroundNetwork groundNetwork; + FGTowerController towerController; + FGApproachController approachController; time_t lastUpdate; - string prevTrafficType; + std::string prevTrafficType; stringVec landing; stringVec takeoff; stringVec milActive, comActive, genActive, ulActive; @@ -64,13 +58,17 @@ private: intVec freqTower; // intVec freqApproach; // - string atisInformation; + int atisSequenceIndex; + double atisSequenceTimeStamp; + + std::string chooseRunwayFallback(); + bool innerGetActiveRunway(const std::string &trafficType, int action, std::string &runway, double heading); + std::string chooseRwyByHeading(stringVec rwys, double heading); + + double elevation; - string chooseRunwayFallback(); - bool innerGetActiveRunway(const string &trafficType, int action, string &runway); public: FGAirportDynamics(FGAirport* ap); - FGAirportDynamics(const FGAirportDynamics &other); ~FGAirportDynamics(); void addAwosFreq (int val) { freqAwos.push_back(val); }; @@ -88,7 +86,7 @@ public: double getElevation() const; const string& getId() const; - void getActiveRunway(const string& trafficType, int action, string& runway); + void getActiveRunway(const string& trafficType, int action, string& runway, double heading); void addParking(FGParking& park); bool getAvailableParking(double *lat, double *lon, @@ -103,14 +101,25 @@ public: //const string &getName() const { return _name;}; // Returns degrees + // Departure / Arrival procedures + FGSidStar * getSIDs() { return &SIDs; }; + FGAIFlightPlan * getSID(string activeRunway, double heading); + // ATC related functions. - FGStartupController *getStartupController() { return &startupController; }; - FGGroundNetwork *getGroundNetwork() { return &groundNetwork; }; - FGTowerController *getTowerController() { return &towerController; }; + FGStartupController *getStartupController() { return &startupController; }; + FGGroundNetwork *getGroundNetwork() { return &groundNetwork; }; + FGTowerController *getTowerController() { return &towerController; }; + FGApproachController *getApproachController() { return &approachController; }; + + int getGroundFrequency(unsigned leg); + int getTowerFrequency (unsigned nr); + + /// get current ATIS sequence letter + const std::string getAtisSequence(); - const string& getAtisInformation() { return atisInformation; }; - int getGroundFrequency(int leg); //{ return freqGround.size() ? freqGround[0] : 0; }; + /// get the current ATIS sequence number, updating it if necessary + int updateAtisSequence(int interval, bool forceUpdate); void setRwyUse(const FGRunwayPreference& ref); };