#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
#include <Airports/runways.hxx>
-#include <simgear/xml/easyxml.hxx>
#include STL_STRING
#include <vector>
SG_USING_STD(sort);
SG_USING_STD(random_shuffle);
-#include "parking.hxx"
-#include "groundnetwork.hxx"
-#include "runwayprefs.hxx"
#include "dynamics.hxx"
/********** FGAirport Dynamics *********************************************/
// Destructor
FGAirportDynamics::~FGAirportDynamics()
{
-
}
// add the gate positions to the ground network.
groundNetwork.addNodes(&parkings);
groundNetwork.init();
+ groundNetwork .setTowerController(&towerController);
}
bool FGAirportDynamics::getAvailableParking(double *lat, double *lon, double *heading, int *gateId, double rad, const string &flType, const string &acType, const string &airline)
continue;
}
else // Airline code doesn't match
- if (i->getCodes().find(airline, 0) == string::npos)
- {
- available = false;
- continue;
- }
+ {
+ //cerr << "Code = " << airline << ": Codes " << i->getCodes();
+ if (i->getCodes().find(airline, 0) == string::npos)
+ {
+ available = false;
+ //cerr << "Unavailable" << endl;
+ continue;
+ }
+ else
+ {
+ //cerr << "Available" << endl;
+ }
+ }
// Type doesn't match
if (i->getType() != flType)
{
RunwayGroup *currRunwayGroup = 0;
int nrActiveRunways = 0;
time_t dayStart = fgGetLong("/sim/time/utc/day-seconds");
- if (((dayStart - lastUpdate) > 600) || trafficType != prevTrafficType)
+ if ((abs((long)(dayStart - lastUpdate)) > 600) || trafficType != prevTrafficType)
{
landing.clear();
takeoff.clear();
- //lastUpdate = dayStart;
+ lastUpdate = dayStart;
prevTrafficType = trafficType;
FGEnvironment