]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/runways.cxx
NewAtis: handle varying winds
[flightgear.git] / src / Airports / runways.cxx
index 84205a27620a9de91f27cf0e6c69170aa31d6bc7..9f2291f7ba90f31f10f31da246a4a978975572d4 100644 (file)
@@ -96,15 +96,17 @@ string FGRunway::reverseIdent(const string& aRunwayIdent)
   return buf;
 }
 
-double FGRunway::score(double aLengthWt, double aWidthWt, double aSurfaceWt) const
+double FGRunway::score(double aLengthWt, double aWidthWt, double aSurfaceWt, double aIlsWt) const
 {
   int surface = 1;
   if (_surface_code == 12 || _surface_code == 5) // dry lakebed & gravel
     surface = 2;
   else if (_surface_code == 1 || _surface_code == 2) // asphalt & concrete
     surface = 3;
+
+  int ils = (_ils != 0);
     
-  return _length * aLengthWt + _width * aWidthWt + surface * aSurfaceWt + 1e-20;
+  return _length * aLengthWt + _width * aWidthWt + surface * aSurfaceWt + ils * aIlsWt + 1e-20;
 }
 
 SGGeod FGRunway::begin() const
@@ -204,6 +206,16 @@ FGRunway::getApproaches(flightgear::ProcedureType type) const
   return result;
 }
 
+void FGRunway::updateThreshold(const SGGeod& newThreshold, double newHeading,
+                     double newDisplacedThreshold,
+                     double newStopway)
+{
+    modifyPosition(newThreshold);
+    _heading = newHeading;
+    _stopway = newStopway;
+    _displ_thresh = newDisplacedThreshold;
+}
+
 FGHelipad::FGHelipad(PositionedID aGuid,
                         PositionedID aAirport, const string& aIdent,
                         const SGGeod& aGeod,