]> git.mxchange.org Git - flightgear.git/commitdiff
Quiet down Traffic error logging.
authorJames Turner <zakalawe@mac.com>
Sat, 19 Dec 2015 05:59:28 +0000 (21:59 -0800)
committerJames Turner <zakalawe@mac.com>
Sat, 19 Dec 2015 05:59:28 +0000 (21:59 -0800)
src/AIModel/AIFlightPlan.cxx
src/AIModel/AIFlightPlanCreate.cxx
src/AIModel/AIFlightPlanCreatePushBack.cxx
src/Airports/dynamics.cxx
src/Airports/dynamics.hxx

index b295310c6cdcefe91beb83298c373edb8b22bbb9..dbfd06ee9d6eb4318806914afc0c560888e6807d 100644 (file)
@@ -210,7 +210,12 @@ void FGAIFlightPlan::createWaypoints(FGAIAircraft *ac,
    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,
index 59d4422601fe900a7b4a2c12b9f131097d942762..ae369d57b5c8fe73ae8384c706a9f945b5bf1f7d 100644 (file)
@@ -219,8 +219,7 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
     // 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()) {
index 923596d04c6c73bab1e632d849e891b35db1ce3b..9e11a724d1af9d1db17b6d4da8a24f36ed3f8346 100644 (file)
@@ -66,10 +66,16 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
   
   // 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 <<
index fae2add25c63734d2089921d669006b78a0a2d00..c90d91c351ef4c2d1a10a0ceb835b4061a7a577a 100644 (file)
@@ -208,6 +208,11 @@ FGParking* FGAirportDynamics::innerGetAvailableParking(double radius, const stri
     return NULL;
 }
 
+bool FGAirportDynamics::hasParkings() const
+{
+    return !groundNetwork->allParkings().empty();
+}
+
 ParkingAssignment FGAirportDynamics::getAvailableParking(double radius, const string & flType,
                                             const string & acType,
                                             const string & airline)
index cef41fa48434bb89a7e87dd3880faf5e0964a886..4c7fbd6251d2c0928ff0e3878e496a1893d1f94b 100644 (file)
@@ -133,7 +133,9 @@ public:
                           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.