X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fdynamics.hxx;h=1f142eb529bd36e9f0d0477e4ea382ec6d49f9a9;hb=386aefe69358ce41a11c9afeb8f56e26758fe56b;hp=3c787a9345fb186657ed11aab8ec1d5b12e48a8e;hpb=4be621fbe96114a246ed74aefe9b9a98bbf99b44;p=flightgear.git diff --git a/src/Airports/dynamics.hxx b/src/Airports/dynamics.hxx index 3c787a934..1f142eb52 100644 --- a/src/Airports/dynamics.hxx +++ b/src/Airports/dynamics.hxx @@ -14,7 +14,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // $Id$ @@ -23,52 +23,77 @@ #define _AIRPORT_DYNAMICS_HXX_ -#ifndef __cplusplus +#ifndef __cplusplus # error This library requires C++ -#endif +#endif - +#include + +#include +#include "parking.hxx" +#include "groundnetwork.hxx" +#include "runwayprefs.hxx" +#include "sidstar.hxx" + +//typedef vector DoubleVec; +//typedef vector::iterator DoubleVecIterator; + +class FGAirport; + + +class FGAirportDynamics { -class FGAirportDynamics : public XMLVisitor { - private: - double _longitude; // degrees - double _latitude; // degrees - double _elevation; // ft - string _id; + FGAirport* _ap; - FGParkingVec parkings; - FGRunwayPreference rwyPrefs; - FGGroundNetwork groundNetwork; + FGParkingVec parkings; + FGRunwayPreference rwyPrefs; + FGSidStar SIDs; + FGStartupController startupController; + FGGroundNetwork groundNetwork; + FGTowerController towerController; time_t lastUpdate; string prevTrafficType; stringVec landing; stringVec takeoff; + 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(double, double, double, string); + 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 { return _longitude;}; + double getLongitude() const; // Returns degrees - double getLatitude() const { return _latitude; }; + double getLatitude() const; // Returns ft - double getElevation() const { return _elevation;}; + 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, double *heading, int *gate, double rad, const string& fltype, const string& acType, const string& airline); @@ -76,24 +101,25 @@ 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; }; - + // Departure / Arrival procedures + FGSidStar * getSIDs() { return &SIDs; }; + FGAIFlightPlan * getSID(string activeRunway, double heading); - void setRwyUse(const FGRunwayPreference& ref); - // Some overloaded virtual XMLVisitor members - virtual void startXML (); - virtual void endXML (); - virtual void startElement (const char * name, const XMLAttributes &atts); - virtual void endElement (const char * name); - virtual void data (const char * s, int len); - virtual void pi (const char * target, const char * data); - virtual void warning (const char * message, int line, int column); - virtual void error (const char * message, int line, int column); + // ATC related functions. + FGStartupController *getStartupController() { return &startupController; }; + FGGroundNetwork *getGroundNetwork() { return &groundNetwork; }; + FGTowerController *getTowerController() { return &towerController; }; + + const string& getAtisInformation() { return atisInformation; }; + int getGroundFrequency(unsigned leg); //{ return freqGround.size() ? freqGround[0] : 0; }; + + void setRwyUse(const FGRunwayPreference& ref); };