1c8f2e3c5b
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.
139 lines
3.8 KiB
C++
139 lines
3.8 KiB
C++
// parking.hxx - A class to handle airport startup locations in
|
|
// FlightGear. This code is intended to be used by AI code and
|
|
// initial user-startup location selection.
|
|
//
|
|
// Written by Durk Talsma, started December 2004.
|
|
//
|
|
// Copyright (C) 2004 Durk Talsma.
|
|
//
|
|
// 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
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
//
|
|
// $Id$
|
|
|
|
#ifndef _PARKING_HXX_
|
|
#define _PARKING_HXX_
|
|
|
|
#ifndef __cplusplus
|
|
# error This library requires C++
|
|
#endif
|
|
|
|
#include <simgear/compiler.h>
|
|
|
|
#include STL_STRING
|
|
#include <vector>
|
|
|
|
#include "gnnode.hxx"
|
|
|
|
SG_USING_STD(string);
|
|
SG_USING_STD(vector);
|
|
|
|
class FGTaxiRoute;
|
|
|
|
|
|
class FGParking : public FGTaxiNode {
|
|
private:
|
|
double heading;
|
|
double radius;
|
|
string parkingName;
|
|
string type;
|
|
string airlineCodes;
|
|
|
|
bool available;
|
|
int pushBackPoint;
|
|
FGTaxiRoute *pushBackRoute;
|
|
|
|
public:
|
|
FGParking() :
|
|
heading(0),
|
|
radius(0),
|
|
//parkingName(0),
|
|
//type(0),
|
|
//airlineCodes(0),
|
|
available(true),
|
|
pushBackPoint(-1),
|
|
pushBackRoute(0)
|
|
{
|
|
};
|
|
|
|
FGParking(const FGParking &other) :
|
|
FGTaxiNode (other),
|
|
heading (other.heading),
|
|
radius (other.radius),
|
|
parkingName (other.parkingName),
|
|
type (other.type),
|
|
airlineCodes (other.airlineCodes),
|
|
available (other.available),
|
|
pushBackPoint(other.pushBackPoint),
|
|
pushBackRoute(other.pushBackRoute)
|
|
{
|
|
};
|
|
|
|
|
|
FGParking& operator =(const FGParking &other)
|
|
{
|
|
FGTaxiNode::operator=(other);
|
|
heading = other.heading;
|
|
radius = other.radius;
|
|
parkingName = other.parkingName;
|
|
type = other.type;
|
|
airlineCodes = other.airlineCodes;
|
|
available = other.available;
|
|
pushBackPoint= other.pushBackPoint;
|
|
pushBackRoute= other.pushBackRoute;
|
|
return *this;
|
|
};
|
|
~FGParking();
|
|
// FGParking(double lat,
|
|
// double lon,
|
|
// double hdg,
|
|
// double rad,
|
|
// int idx,
|
|
// const string& name,
|
|
// const string& tpe,
|
|
// const string& codes);
|
|
|
|
void setHeading (double hdg) { heading = hdg; };
|
|
void setRadius (double rad) { radius = rad; };
|
|
|
|
void setName (const string& name) { parkingName = name; };
|
|
void setType (const string& tpe) { type = tpe; };
|
|
void setCodes (const string& codes){ airlineCodes= codes;};
|
|
|
|
void setPushBackRoute(FGTaxiRoute *val) { pushBackRoute = val; };
|
|
void setPushBackPoint(int val) { pushBackPoint = val; };
|
|
|
|
bool isAvailable () { return available;};
|
|
void setAvailable(bool val) { available = val; };
|
|
|
|
double getHeading () { return heading; };
|
|
double getRadius () { return radius; };
|
|
|
|
string getType () { return type; };
|
|
string getCodes () { return airlineCodes;};
|
|
string getName () { return parkingName; };
|
|
|
|
FGTaxiRoute * getPushBackRoute () { return pushBackRoute; };
|
|
|
|
int getPushBackPoint () { return pushBackPoint; };
|
|
|
|
bool operator< (const FGParking &other) const {
|
|
return radius < other.radius; };
|
|
};
|
|
|
|
typedef vector<FGParking> FGParkingVec;
|
|
typedef vector<FGParking>::iterator FGParkingVecIterator;
|
|
typedef vector<FGParking>::const_iterator FGParkingVecConstIterator;
|
|
|
|
#endif
|