2005-12-29 13:58:21 +00:00
|
|
|
// dynamics.hxx - a class to manage the higher order airport ground activities
|
|
|
|
// Written by Durk Talsma, started December 2004.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-12-29 13:58:21 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _AIRPORT_DYNAMICS_HXX_
|
|
|
|
#define _AIRPORT_DYNAMICS_HXX_
|
|
|
|
|
|
|
|
|
2006-04-17 12:59:35 +00:00
|
|
|
#ifndef __cplusplus
|
2005-12-29 13:58:21 +00:00
|
|
|
# error This library requires C++
|
2006-04-17 12:59:35 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <simgear/xml/easyxml.hxx>
|
|
|
|
|
|
|
|
#include "parking.hxx"
|
|
|
|
#include "groundnetwork.hxx"
|
|
|
|
#include "runwayprefs.hxx"
|
2006-10-06 17:36:31 +00:00
|
|
|
#include "trafficcontrol.hxx"
|
2005-12-29 13:58:21 +00:00
|
|
|
|
2007-07-04 17:39:03 +00:00
|
|
|
class FGAirport;
|
2005-12-29 13:58:21 +00:00
|
|
|
|
2007-07-04 17:39:03 +00:00
|
|
|
class FGAirportDynamics {
|
2006-04-17 12:59:35 +00:00
|
|
|
|
2005-12-29 13:58:21 +00:00
|
|
|
private:
|
2007-07-04 17:39:03 +00:00
|
|
|
FGAirport* _ap;
|
2005-12-29 13:58:21 +00:00
|
|
|
|
2006-10-06 17:36:31 +00:00
|
|
|
FGParkingVec parkings;
|
2005-12-29 13:58:21 +00:00
|
|
|
FGRunwayPreference rwyPrefs;
|
2006-10-06 17:36:31 +00:00
|
|
|
FGGroundNetwork groundNetwork;
|
|
|
|
FGTowerController towerController;
|
2005-12-29 13:58:21 +00:00
|
|
|
|
|
|
|
time_t lastUpdate;
|
|
|
|
string prevTrafficType;
|
|
|
|
stringVec landing;
|
|
|
|
stringVec takeoff;
|
2007-07-21 11:05:20 +00:00
|
|
|
stringVec milActive, comActive, genActive, ulActive;
|
|
|
|
stringVec *currentlyActive;
|
2005-12-29 13:58:21 +00:00
|
|
|
|
|
|
|
// 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
|
2007-07-21 11:05:20 +00:00
|
|
|
//double avWindHeading [10];
|
|
|
|
//double avWindSpeed [10];
|
2005-12-29 13:58:21 +00:00
|
|
|
|
|
|
|
string chooseRunwayFallback();
|
|
|
|
|
|
|
|
public:
|
2007-07-04 17:39:03 +00:00
|
|
|
FGAirportDynamics(FGAirport* ap);
|
2005-12-29 13:58:21 +00:00
|
|
|
FGAirportDynamics(const FGAirportDynamics &other);
|
|
|
|
~FGAirportDynamics();
|
|
|
|
|
|
|
|
|
|
|
|
void init();
|
2007-07-04 17:39:03 +00:00
|
|
|
double getLongitude() const;
|
2005-12-29 13:58:21 +00:00
|
|
|
// Returns degrees
|
2007-07-04 17:39:03 +00:00
|
|
|
double getLatitude() const;
|
2005-12-29 13:58:21 +00:00
|
|
|
// Returns ft
|
2007-07-04 17:39:03 +00:00
|
|
|
double getElevation() const;
|
|
|
|
const string& getId() const;
|
2005-12-29 13:58:21 +00:00
|
|
|
|
|
|
|
void getActiveRunway(const string& trafficType, int action, string& runway);
|
2007-07-04 17:39:03 +00:00
|
|
|
|
|
|
|
void addParking(FGParking& park);
|
2005-12-29 13:58:21 +00:00
|
|
|
bool getAvailableParking(double *lat, double *lon,
|
|
|
|
double *heading, int *gate, double rad, const string& fltype,
|
|
|
|
const string& acType, const string& airline);
|
|
|
|
void getParking (int id, double *lat, double* lon, double *heading);
|
|
|
|
FGParking *getParking(int i);
|
|
|
|
void releaseParking(int id);
|
|
|
|
string getParkingName(int i);
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
int getNrOfParkings() { return parkings.size(); };
|
2005-12-29 13:58:21 +00:00
|
|
|
//FGAirport *getAddress() { return this; };
|
|
|
|
//const string &getName() const { return _name;};
|
|
|
|
// Returns degrees
|
|
|
|
|
2006-10-06 17:36:31 +00:00
|
|
|
FGGroundNetwork *getGroundNetwork() { return &groundNetwork; };
|
|
|
|
FGTowerController *getTowerController() { return &towerController; };
|
2005-12-29 13:58:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
void setRwyUse(const FGRunwayPreference& ref);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|