]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/dynamics.hxx
initialize release_keys array
[flightgear.git] / src / Airports / dynamics.hxx
index 30b4bf7f9d991eeaddd8bdbffd32e50f1ce15294..0e5d6f4383e79cdf0257efe9a97b791ed6b558b7 100644 (file)
 #define _AIRPORT_DYNAMICS_HXX_
 
 
-#ifndef __cplusplus                                                          
+#ifndef __cplusplus
 # error This library requires C++
-#endif                        
+#endif
 
-  
+#include <simgear/xml/easyxml.hxx>
+
+#include "parking.hxx"
+#include "groundnetwork.hxx"
+#include "runwayprefs.hxx"
+#include "trafficcontrol.hxx"
+
+class FGAirport;
+
+class FGAirportDynamics {
 
-class FGAirportDynamics : public XMLVisitor {
-  
 private:
-  double _longitude;    // degrees
-  double _latitude;     // degrees
-  double _elevation;    // ft
-  string _id;
+  FGAirport* _ap;
 
-  FGParkingVec parkings;
+  FGParkingVec       parkings;
   FGRunwayPreference rwyPrefs;
-  FGGroundNetwork groundNetwork;
+  FGGroundNetwork    groundNetwork;
+  FGTowerController  towerController;
 
   time_t lastUpdate;
   string prevTrafficType;
   stringVec landing;
   stringVec takeoff;
+  stringVec milActive, comActive, genActive, ulActive;
+  stringVec *currentlyActive;
 
   // 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];
+  //double avWindHeading [10];
+  //double avWindSpeed   [10];
 
   string chooseRunwayFallback();
 
 public:
-  FGAirportDynamics(double, double, double, string);
+  FGAirportDynamics(FGAirport* ap);
   FGAirportDynamics(const FGAirportDynamics &other);
   ~FGAirportDynamics();
 
 
   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 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 +86,16 @@ 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; };
+  FGGroundNetwork   *getGroundNetwork()   { return &groundNetwork; };
+  FGTowerController *getTowerController() { return &towerController; };
   
 
   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);
 };