Skip to content

Commit 3b5a59b

Browse files
committed
Corrected a bug in choosing runway in certain conditions.
1 parent abbefe5 commit 3b5a59b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

myFlightInfo/CrossWind.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,15 @@ private void btn_calc_wind_Click(object sender, EventArgs e)
286286
HeadwindMultiplier = 1;
287287
}
288288

289+
if (crossWind1 > crossWind2) crosswind3 = crossWind1;
290+
if (crossWind2 > crossWind1) crosswind3 = crossWind2;
289291

290292
if (crosswind3 > MaxCrossWindAllowed) // crosswind exceeds limits
291293
{
292294
//Write to richtextbox
293295
rchtxtbx_crosswind_output.SelectionColor = Color.Red;
294296
rchtxtbx_crosswind_output.SelectionFont = new Font("Ariel", 12);
295-
rchtxtbx_crosswind_output.AppendText("\rNot safe to take off.\rCrosswind component is above maximum allowed for safe takeoff.");
297+
rchtxtbx_crosswind_output.AppendText("\r\rNot safe to take off.\rCrosswind component is above maximum allowed for safe takeoff.");
296298

297299
RunwayGraphic.DrawString("X", new Font("Arial", 50), new SolidBrush(Color.White), new Point(60, 120));
298300
}
@@ -307,8 +309,8 @@ private void btn_calc_wind_Click(object sender, EventArgs e)
307309

308310
if (crosswind3 == 0 && headwind3 == 0) // no wind use any runway.
309311
{
310-
if (crossWind1 > crossWind2) crosswind3 = crossWind1;
311-
if (crossWind2 > crossWind1) crosswind3 = crossWind2;
312+
//if (crossWind1 > crossWind2) crosswind3 = crossWind1;
313+
//if (crossWind2 > crossWind1) crosswind3 = crossWind2;
312314

313315
// Paint Runway marking
314316
RunwayGraphic.DrawString(RunwayHeading1x + "/" + RunwayHeading2x, new Font("Arial", 50),

0 commit comments

Comments
 (0)