Skip to content

Commit d3f84dd

Browse files
committed
Added in Netweather.tv page
1 parent 74ab1f5 commit d3f84dd

File tree

3 files changed

+66
-12
lines changed

3 files changed

+66
-12
lines changed

myFlightInfo/CrossWind.cs

+18-12
Original file line numberDiff line numberDiff line change
@@ -218,22 +218,22 @@ private void btn_calc_wind_Click(object sender, EventArgs e)
218218
//Draw the crosswind and headwind arrows
219219
if (StarboardFlag) //starboard side
220220
{
221-
PaintWindComponent_kts(CrosswindMultiplier, 180, 20, 130, 20,
221+
PaintDataOnToRunwayGraphics(CrosswindMultiplier, 180, 20, 130, 20,
222222
RunwayGraphic, Math.Round(crosswind3, 0) + "kts", new Font("Arial", 12),
223223
Color.Yellow, 80, 10);
224224

225-
PaintWindComponent_kts(HeadwindMultiplier, 180, 20, 180, 60,
225+
PaintDataOnToRunwayGraphics(HeadwindMultiplier, 180, 20, 180, 60,
226226
RunwayGraphic, Math.Round(headwind, 0) + "kts", new Font("Arial", 12),
227227
Color.Yellow, 130, 65);
228228

229229
}
230230
else //port side
231231
{
232-
PaintWindComponent_kts(CrosswindMultiplier, 15, 20, 65, 20,
232+
PaintDataOnToRunwayGraphics(CrosswindMultiplier, 15, 20, 65, 20,
233233
RunwayGraphic, Math.Round(crosswind3, 0) + "kts", new Font("Arial", 12),
234234
Color.Yellow, 68, 10);
235235

236-
PaintWindComponent_kts(HeadwindMultiplier, 15, 20, 15, 60,
236+
PaintDataOnToRunwayGraphics(HeadwindMultiplier, 15, 20, 15, 60,
237237
RunwayGraphic, Math.Round(headwind, 0) + "kts", new Font("Arial", 12),
238238
Color.Yellow, 5, 65);
239239
}
@@ -253,13 +253,19 @@ private void btn_calc_wind_Click(object sender, EventArgs e)
253253
RunwayGraphic.DrawString(RunwayToUse, new Font("Arial", 50), new SolidBrush(Color.White), new Point(40, 120));
254254
}
255255

256-
PaintWindComponent_kts(HeadwindMultiplier, 180, 20, 130, 20,
257-
RunwayGraphic, Math.Round(headwind, 0) + "kts", new Font("Arial", 12),
258-
Color.Yellow, 160, 65);
259-
260-
PaintWindComponent_kts(HeadwindMultiplier, 180, 20, 180, 60,
261-
RunwayGraphic, Math.Round(headwind, 0) + "kts", new Font("Arial", 12),
262-
Color.Yellow, 160, 65);
256+
//Draw wind arrows.
257+
if ((!PaintDataOnToRunwayGraphics(HeadwindMultiplier, 180, 20, 130, 20,
258+
RunwayGraphic, Math.Round(headwind, 0) + "kts", new Font("Arial", 12),
259+
Color.Yellow, 160, 65)) ||
260+
(!PaintDataOnToRunwayGraphics(HeadwindMultiplier, 180, 20, 180, 60,
261+
RunwayGraphic, Math.Round(headwind, 0) + "kts", new Font("Arial", 12),
262+
Color.Yellow, 160, 65)))
263+
{
264+
MsgBox.Show("Unable to draw the data, Please check data", "Error", MessageBoxButtons.OK,
265+
MessageBoxIcon.Error);
266+
return;
267+
}
268+
263269
}
264270
else
265271
{
@@ -275,7 +281,7 @@ private void btn_calc_wind_Click(object sender, EventArgs e)
275281
}
276282

277283

278-
private bool PaintWindComponent_kts(double myLineWidthMultiplier, int myCrossWindLineStartX, int myCrossWindLineStartY, int myCrossWindLineEndX, int myCrossWindLineEndY,
284+
private bool PaintDataOnToRunwayGraphics(double myLineWidthMultiplier, int myCrossWindLineStartX, int myCrossWindLineStartY, int myCrossWindLineEndX, int myCrossWindLineEndY,
279285
Graphics myRunwayGraphic, string myRunwayNumber, Font myFont,
280286
Color myColor, int myCrossWindDataStringXCoOrd, int myCrossWindDataStringYCoOrd)
281287
{

myFlightInfo/Form1.Designer.cs

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

myFlightInfo/Form1.cs

+17
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ private async void Form1_Load(object sender, EventArgs e)
115115

116116
await webView_weather_met.EnsureCoreWebView2Async();
117117
await webView_weather_bbc.EnsureCoreWebView2Async();
118+
await webView_weather_netweather.EnsureCoreWebView2Async();
118119
await webView_synoptic.EnsureCoreWebView2Async();
119120
await webView_gransden_lodge_weather.EnsureCoreWebView2Async();
120121
await webView_weather_windy.EnsureCoreWebView2Async();
@@ -466,13 +467,15 @@ private void SetWeatherPages()
466467
"https://www.bbc.co.uk/weather/2653941");
467468
webView_weather_met.CoreWebView2.Navigate(
468469
"https://metoffice.gov.uk/weather/forecast/u1214b469");
470+
webView_weather_netweather.CoreWebView2.Navigate("https://www.netweather.tv/weather-forecasts/uk/7-day/5155~Cambridge");
469471
}
470472
else
471473
{
472474
webView_weather_bbc.CoreWebView2.Navigate(
473475
"https://www.bbc.co.uk/weather/2648095"); //Gamlinggay = 2648899 Gt Gransden = 2648095
474476
webView_weather_met.CoreWebView2.Navigate(
475477
"https://metoffice.gov.uk/weather/forecast/gcrbu1fn7"); //waresley = gcrbu1fn7
478+
webView_weather_netweather.CoreWebView2.Navigate("https://www.netweather.tv/weather-forecasts/uk/7-day/50408~Little%20Gransden");
476479
}
477480

478481
if (tabcnt_weather.SelectedTab == tab_windy) grpbx_towns.Visible = false;
@@ -513,6 +516,20 @@ private void rdobtn_cambridge_CheckedChanged(object sender, EventArgs e)
513516
"https://metoffice.gov.uk/weather/forecast/u1214b469"); //Cambridge
514517
}
515518
}
519+
else if (tabcnt_weather.SelectedTab == tab_netweather)
520+
{
521+
if (rdobtn_Gt_Gransden.Checked)
522+
{
523+
webView_weather_netweather.CoreWebView2.Navigate(
524+
"https://www.netweather.tv/weather-forecasts/uk/7-day/50408~Little%20Gransden");//lt gransden
525+
526+
}
527+
else
528+
{
529+
webView_weather_netweather.CoreWebView2.Navigate(
530+
"https://www.netweather.tv/weather-forecasts/uk/7-day/5155~Cambridge"); //Cambridge
531+
}
532+
}
516533
}
517534

518535
private void btn_gransden_lodge_photo_update_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)