]> git.mxchange.org Git - flightgear.git/blob - src/Airports/dynamics.hxx
Change tower location to an SGGeod. Include taxiways too.
[flightgear.git] / src / Airports / dynamics.hxx
1 // dynamics.hxx - a class to manage the higher order airport ground activities
2 // Written by Durk Talsma, started December 2004.
3 //
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 //
19 // $Id$
20
21
22 #ifndef _AIRPORT_DYNAMICS_HXX_
23 #define _AIRPORT_DYNAMICS_HXX_
24
25
26 #ifndef __cplusplus
27 # error This library requires C++
28 #endif
29
30 #include <simgear/xml/easyxml.hxx>
31
32 #include "parking.hxx"
33 #include "groundnetwork.hxx"
34 #include "runwayprefs.hxx"
35 #include "trafficcontrol.hxx"
36
37 class FGAirport;
38
39 class FGAirportDynamics {
40
41 private:
42   FGAirport* _ap;
43
44   FGParkingVec       parkings;
45   FGRunwayPreference rwyPrefs;
46   FGGroundNetwork    groundNetwork;
47   FGTowerController  towerController;
48
49   time_t lastUpdate;
50   string prevTrafficType;
51   stringVec landing;
52   stringVec takeoff;
53   stringVec milActive, comActive, genActive, ulActive;
54   stringVec *currentlyActive;
55
56   // Experimental keep a running average of wind dir and speed to prevent
57   // Erratic runway changes. 
58   // Note: I should add these to the copy constructor and assigment operator to be
59   // constistent
60   //double avWindHeading [10];
61   //double avWindSpeed   [10];
62
63   string chooseRunwayFallback();
64
65 public:
66   FGAirportDynamics(FGAirport* ap);
67   FGAirportDynamics(const FGAirportDynamics &other);
68   ~FGAirportDynamics();
69
70
71   void init();
72   double getLongitude() const; 
73   // Returns degrees
74   double getLatitude()  const; 
75   // Returns ft
76   double getElevation() const; 
77   const string& getId() const; 
78   
79   void getActiveRunway(const string& trafficType, int action, string& runway);
80
81   void addParking(FGParking& park);
82   bool getAvailableParking(double *lat, double *lon, 
83                            double *heading, int *gate, double rad, const string& fltype, 
84                            const string& acType, const string& airline);
85   void getParking         (int id, double *lat, double* lon, double *heading);
86   FGParking *getParking(int i);
87   void releaseParking(int id);
88   string getParkingName(int i); 
89   int getNrOfParkings() { return parkings.size(); };
90   //FGAirport *getAddress() { return this; };
91   //const string &getName() const { return _name;};
92   // Returns degrees
93
94   FGGroundNetwork   *getGroundNetwork()   { return &groundNetwork; };
95   FGTowerController *getTowerController() { return &towerController; };
96   
97
98   void setRwyUse(const FGRunwayPreference& ref);
99 };
100
101
102
103 #endif