if (timeDiff >= 2000)
leg = 5;
*/
- SG_LOG(SG_AI, SG_INFO, "Route from " << dep->getId() << " to " << arr->getId() << ". Set leg to : " << leg << " " << ac->getTrafficRef()->getCallSign());
+
+ if( sglog().would_log(SG_AI,SG_BULK) ) {
+ SG_LOG(SG_AI, SG_BULK, "Route from " << dep->getId() << " to " << arr->getId() <<
+ ". Set leg to : " << leg << " " << ac->getTrafficRef()->getCallSign());
+ }
+
wpt_iterator = waypoints.begin();
bool dist = 0;
isValid = create(ac, dep, arr, leg, alt, speed, lat, lon,
// If this function is called during initialization,
// make sure we obtain a valid gate ID first
// and place the model at the location of the gate.
- if (firstFlight)
- {
+ if (firstFlight && apt->getDynamics()->hasParkings()) {
gate = apt->getDynamics()->getAvailableParking(radius, fltType,
acType, airline);
if (!gate.isValid()) {
// establish the parking position / gate if required
if (firstFlight) {
+ // if the airprot has no parking positions defined, don't log
+ // the warning below.
+ if (!dep->getDynamics()->hasParkings()) {
+ return false;
+ }
+
gate = dep->getDynamics()->getAvailableParking(radius, fltType,
aircraftType, airline);
if (!gate.isValid()) {
- SG_LOG(SG_AI, SG_WARN, "Warning: Could not find parking for a " <<
+ SG_LOG(SG_AI, SG_WARN, "Could not find parking for a " <<
aircraftType <<
" of flight type " << fltType <<
" of airline " << airline <<
return NULL;
}
+bool FGAirportDynamics::hasParkings() const
+{
+ return !groundNetwork->allParkings().empty();
+}
+
ParkingAssignment FGAirportDynamics::getAvailableParking(double radius, const string & flType,
const string & acType,
const string & airline)
int action,
std::string& runway,
double heading );
-
+
+ bool hasParkings() const;
+
/**
* retrieve an available parking by GateID, or -1 if no suitable
* parking location could be found.