X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fdynamics.hxx;h=60921821863438f422f2ad51e4c32d441d9dede3;hb=16ba5f713b54ce27a3837a96f8816b9730970c44;hp=6e9ae1ab45aa9d031883d4a862288fd3aa2a52ed;hpb=7dfae1562bdb68d0c67e728f3f922c6373b83c9c;p=flightgear.git diff --git a/src/Airports/dynamics.hxx b/src/Airports/dynamics.hxx index 6e9ae1ab4..609218218 100644 --- a/src/Airports/dynamics.hxx +++ b/src/Airports/dynamics.hxx @@ -29,43 +29,60 @@ #include +#include #include "parking.hxx" #include "groundnetwork.hxx" #include "runwayprefs.hxx" -#include "trafficcontrol.hxx" +#include "sidstar.hxx" + +//typedef vector DoubleVec; +//typedef vector::iterator DoubleVecIterator; class FGAirport; + class FGAirportDynamics { private: FGAirport* _ap; - FGParkingVec parkings; - FGRunwayPreference rwyPrefs; - FGGroundNetwork groundNetwork; - FGTowerController towerController; + FGParkingVec parkings; + FGRunwayPreference rwyPrefs; + FGSidStar SIDs; + FGStartupController startupController; + FGGroundNetwork groundNetwork; + FGTowerController towerController; + FGApproachController approachController; time_t lastUpdate; string prevTrafficType; stringVec landing; stringVec takeoff; - stringVec currentlyActive; + stringVec milActive, comActive, genActive, ulActive; + stringVec *currentlyActive; + intVec freqAwos; // + intVec freqUnicom; // + intVec freqClearance;// + intVec freqGround; // + intVec freqTower; // + intVec freqApproach; // - // Experimental keep a running average of wind dir and speed to prevent - // Erratic runway changes. - // Note: I should add these to the copy constructor and assigment operator to be - // constistent - double avWindHeading [10]; - double avWindSpeed [10]; + string atisInformation; string chooseRunwayFallback(); - + bool innerGetActiveRunway(const string &trafficType, int action, string &runway, double heading); + string chooseRwyByHeading(stringVec rwys, double heading); public: FGAirportDynamics(FGAirport* ap); FGAirportDynamics(const FGAirportDynamics &other); ~FGAirportDynamics(); + void addAwosFreq (int val) { freqAwos.push_back(val); }; + void addUnicomFreq (int val) { freqUnicom.push_back(val); }; + void addClearanceFreq(int val) { freqClearance.push_back(val); }; + void addGroundFreq (int val) { freqGround.push_back(val); }; + void addTowerFreq (int val) { freqTower.push_back(val); }; + void addApproachFreq (int val) { freqApproach.push_back(val); }; void init(); double getLongitude() const; @@ -75,7 +92,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, @@ -85,13 +102,24 @@ public: FGParking *getParking(int i); void releaseParking(int id); string getParkingName(int i); + int getNrOfParkings() { return parkings.size(); }; //FGAirport *getAddress() { return this; }; //const string &getName() const { return _name;}; // Returns degrees - FGGroundNetwork *getGroundNetwork() { return &groundNetwork; }; - FGTowerController *getTowerController() { return &towerController; }; - + // 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; }; + FGApproachController *getApproachController() { return &approachController; }; + + const string& getAtisInformation() { return atisInformation; }; + int getGroundFrequency(unsigned leg); //{ return freqGround.size() ? freqGround[0] : 0; }; void setRwyUse(const FGRunwayPreference& ref); };