X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fdynamics.cxx;h=11cb454b97c5f8bdf851e6aa3ac81308d78b78d7;hb=85185b56c5cb3873b7978fb910ab1740f822fd68;hp=f45341e5e8f1fbc1dcb99e9e106f4987f10255e4;hpb=0bce31ae9a80c571b9126427c093b8dc3d3f6820;p=flightgear.git diff --git a/src/Airports/dynamics.cxx b/src/Airports/dynamics.cxx index f45341e5e..11cb454b9 100644 --- a/src/Airports/dynamics.cxx +++ b/src/Airports/dynamics.cxx @@ -26,8 +26,6 @@ #include -#include - #include #include #include @@ -325,17 +323,21 @@ bool FGAirportDynamics::innerGetActiveRunway(const string & trafficType, takeoff.clear(); lastUpdate = dayStart; prevTrafficType = trafficType; - + /* FGEnvironment stationweather = ((FGEnvironmentMgr *) globals->get_subsystem("environment")) ->getEnvironment(getLatitude(), getLongitude(), getElevation()); - - windSpeed = stationweather.get_wind_speed_kt(); - windHeading = stationweather.get_wind_from_heading_deg(); + */ + windSpeed = fgGetInt("/environment/metar/base-wind-speed-kt"); //stationweather.get_wind_speed_kt(); + windHeading = fgGetInt("/environment/metar/base-wind-dir-deg"); + //stationweather.get_wind_from_heading_deg(); string scheduleName; - //cerr << "finding active Runway for" << _ap->getId() << endl; + //cerr << "finding active Runway for : " << _ap->getId() << endl; + //cerr << "Wind Heading : " << windHeading << endl; + //cerr << "Wind Speed : " << windSpeed << endl; + //cerr << "Nr of seconds since day start << " << dayStart << endl; ScheduleTime *currSched; @@ -347,7 +349,7 @@ bool FGAirportDynamics::innerGetActiveRunway(const string & trafficType, scheduleName = currSched->getName(dayStart); maxTail = currSched->getTailWind(); maxCross = currSched->getCrossWind(); - //cerr << "SChedule anme = " << scheduleName << endl; + //cerr << "Current Schedule = : " << scheduleName << endl; if (scheduleName.empty()) return false; //cerr << "C"<< endl; @@ -371,6 +373,13 @@ bool FGAirportDynamics::innerGetActiveRunway(const string & trafficType, currentlyActive = &ulActive; } + //cerr << "Durrently active selection for " << trafficType << ": "; + for (stringVecIterator it = currentlyActive->begin(); + it != currentlyActive->end(); it++) { + //cerr << (*it) << " "; + } + //cerr << endl; + currRunwayGroup->setActive(_ap, windSpeed, windHeading,