From ca372c14eaf0bd7c1f38e8b26d705338a1617738 Mon Sep 17 00:00:00 2001 From: ziz wiz Date: Wed, 18 Sep 2024 09:02:00 +0100 Subject: [PATCH] Added in Nasa Satellite image to allow one to check the incoming weather. --- .gitignore | 1 + myFlightInfo/Form1.Designer.cs | 128 +++++++++++++++---------- myFlightInfo/Form1.cs | 5 +- myFlightInfo/TabChanges.cs | 7 ++ myFlightInfo/utils/HelpfulFunctions.cs | 10 ++ 5 files changed, 102 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index c955844..eeec1de 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /myFlightInfo/obj /myFlightInfo/bin /docs +/weather_images diff --git a/myFlightInfo/Form1.Designer.cs b/myFlightInfo/Form1.Designer.cs index 75c29a6..b530827 100644 --- a/myFlightInfo/Form1.Designer.cs +++ b/myFlightInfo/Form1.Designer.cs @@ -77,6 +77,8 @@ private void InitializeComponent() this.webView_synoptic = new Microsoft.Web.WebView2.WinForms.WebView2(); this.tab_gransden_lodge = new System.Windows.Forms.TabPage(); this.webView_gransden_lodge_weather = new Microsoft.Web.WebView2.WinForms.WebView2(); + this.tab_nasa_satellite = new System.Windows.Forms.TabPage(); + this.webView_nasa_satellite = new Microsoft.Web.WebView2.WinForms.WebView2(); this.tab_metar = new System.Windows.Forms.TabPage(); this.tabCnt_airfields = new System.Windows.Forms.TabControl(); this.tab_lt_gransden = new System.Windows.Forms.TabPage(); @@ -221,6 +223,10 @@ private void InitializeComponent() this.panel170 = new System.Windows.Forms.Panel(); this.panel171 = new System.Windows.Forms.Panel(); this.btn_calc_speed_time_fuel = new System.Windows.Forms.Button(); + this.panel172 = new System.Windows.Forms.Panel(); + this.chkbx_speed_return = new System.Windows.Forms.CheckBox(); + this.panel173 = new System.Windows.Forms.Panel(); + this.label73 = new System.Windows.Forms.Label(); this.panel166 = new System.Windows.Forms.Panel(); this.label65 = new System.Windows.Forms.Label(); this.panel167 = new System.Windows.Forms.Panel(); @@ -444,10 +450,6 @@ private void InitializeComponent() this.panel87 = new System.Windows.Forms.Panel(); this.panel88 = new System.Windows.Forms.Panel(); this.panel89 = new System.Windows.Forms.Panel(); - this.chkbx_speed_return = new System.Windows.Forms.CheckBox(); - this.panel172 = new System.Windows.Forms.Panel(); - this.panel173 = new System.Windows.Forms.Panel(); - this.label73 = new System.Windows.Forms.Label(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel7.SuspendLayout(); this.panel31.SuspendLayout(); @@ -481,6 +483,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.webView_synoptic)).BeginInit(); this.tab_gransden_lodge.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.webView_gransden_lodge_weather)).BeginInit(); + this.tab_nasa_satellite.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.webView_nasa_satellite)).BeginInit(); this.tab_metar.SuspendLayout(); this.tabCnt_airfields.SuspendLayout(); this.tab_lt_gransden.SuspendLayout(); @@ -572,6 +576,8 @@ private void InitializeComponent() this.panel168.SuspendLayout(); this.tableLayoutPanel25.SuspendLayout(); this.panel171.SuspendLayout(); + this.panel172.SuspendLayout(); + this.panel173.SuspendLayout(); this.panel166.SuspendLayout(); this.panel167.SuspendLayout(); this.tab_weight_balance.SuspendLayout(); @@ -680,8 +686,6 @@ private void InitializeComponent() this.tableLayoutPanel16.SuspendLayout(); this.panel85.SuspendLayout(); this.panel86.SuspendLayout(); - this.panel172.SuspendLayout(); - this.panel173.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -822,7 +826,7 @@ private void InitializeComponent() // cmbobx_airport_info // this.cmbobx_airport_info.FormattingEnabled = true; - this.cmbobx_airport_info.Location = new System.Drawing.Point(6, 32); + this.cmbobx_airport_info.Location = new System.Drawing.Point(6, 34); this.cmbobx_airport_info.Name = "cmbobx_airport_info"; this.cmbobx_airport_info.Size = new System.Drawing.Size(318, 28); this.cmbobx_airport_info.Sorted = true; @@ -1089,6 +1093,7 @@ private void InitializeComponent() this.tabcnt_weather.Controls.Add(this.tab_windy); this.tabcnt_weather.Controls.Add(this.tab_synoptic); this.tabcnt_weather.Controls.Add(this.tab_gransden_lodge); + this.tabcnt_weather.Controls.Add(this.tab_nasa_satellite); this.tabcnt_weather.Dock = System.Windows.Forms.DockStyle.Fill; this.tabcnt_weather.Location = new System.Drawing.Point(0, 0); this.tabcnt_weather.Multiline = true; @@ -1232,6 +1237,29 @@ private void InitializeComponent() this.webView_gransden_lodge_weather.TabIndex = 2; this.webView_gransden_lodge_weather.ZoomFactor = 1D; // + // tab_nasa_satellite + // + this.tab_nasa_satellite.Controls.Add(this.webView_nasa_satellite); + this.tab_nasa_satellite.Location = new System.Drawing.Point(28, 4); + this.tab_nasa_satellite.Name = "tab_nasa_satellite"; + this.tab_nasa_satellite.Padding = new System.Windows.Forms.Padding(3); + this.tab_nasa_satellite.Size = new System.Drawing.Size(1391, 692); + this.tab_nasa_satellite.TabIndex = 6; + this.tab_nasa_satellite.Text = "Nasa Satellite"; + this.tab_nasa_satellite.UseVisualStyleBackColor = true; + // + // webView_nasa_satellite + // + this.webView_nasa_satellite.AllowExternalDrop = true; + this.webView_nasa_satellite.CreationProperties = null; + this.webView_nasa_satellite.DefaultBackgroundColor = System.Drawing.Color.White; + this.webView_nasa_satellite.Dock = System.Windows.Forms.DockStyle.Fill; + this.webView_nasa_satellite.Location = new System.Drawing.Point(3, 3); + this.webView_nasa_satellite.Name = "webView_nasa_satellite"; + this.webView_nasa_satellite.Size = new System.Drawing.Size(1385, 686); + this.webView_nasa_satellite.TabIndex = 2; + this.webView_nasa_satellite.ZoomFactor = 1D; + // // tab_metar // this.tab_metar.Controls.Add(this.tabCnt_airfields); @@ -2886,6 +2914,43 @@ private void InitializeComponent() this.btn_calc_speed_time_fuel.UseVisualStyleBackColor = true; this.btn_calc_speed_time_fuel.Click += new System.EventHandler(this.btn_calc_speed_time_fuel_Click); // + // panel172 + // + this.panel172.Controls.Add(this.chkbx_speed_return); + this.panel172.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel172.Location = new System.Drawing.Point(248, 483); + this.panel172.Name = "panel172"; + this.panel172.Size = new System.Drawing.Size(122, 34); + this.panel172.TabIndex = 17; + // + // chkbx_speed_return + // + this.chkbx_speed_return.AutoSize = true; + this.chkbx_speed_return.Location = new System.Drawing.Point(50, 7); + this.chkbx_speed_return.Name = "chkbx_speed_return"; + this.chkbx_speed_return.Size = new System.Drawing.Size(22, 21); + this.chkbx_speed_return.TabIndex = 0; + this.chkbx_speed_return.UseVisualStyleBackColor = true; + // + // panel173 + // + this.panel173.Controls.Add(this.label73); + this.panel173.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel173.Location = new System.Drawing.Point(3, 483); + this.panel173.Name = "panel173"; + this.panel173.Size = new System.Drawing.Size(239, 34); + this.panel173.TabIndex = 18; + // + // label73 + // + this.label73.AutoSize = true; + this.label73.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label73.Location = new System.Drawing.Point(3, 5); + this.label73.Name = "label73"; + this.label73.Size = new System.Drawing.Size(191, 25); + this.label73.TabIndex = 19; + this.label73.Text = "Include a Return Leg"; + // // panel166 // this.panel166.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); @@ -5203,43 +5268,6 @@ private void InitializeComponent() this.panel89.Size = new System.Drawing.Size(315, 43); this.panel89.TabIndex = 60; // - // chkbx_speed_return - // - this.chkbx_speed_return.AutoSize = true; - this.chkbx_speed_return.Location = new System.Drawing.Point(50, 7); - this.chkbx_speed_return.Name = "chkbx_speed_return"; - this.chkbx_speed_return.Size = new System.Drawing.Size(22, 21); - this.chkbx_speed_return.TabIndex = 0; - this.chkbx_speed_return.UseVisualStyleBackColor = true; - // - // panel172 - // - this.panel172.Controls.Add(this.chkbx_speed_return); - this.panel172.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel172.Location = new System.Drawing.Point(248, 483); - this.panel172.Name = "panel172"; - this.panel172.Size = new System.Drawing.Size(122, 34); - this.panel172.TabIndex = 17; - // - // panel173 - // - this.panel173.Controls.Add(this.label73); - this.panel173.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel173.Location = new System.Drawing.Point(3, 483); - this.panel173.Name = "panel173"; - this.panel173.Size = new System.Drawing.Size(239, 34); - this.panel173.TabIndex = 18; - // - // label73 - // - this.label73.AutoSize = true; - this.label73.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label73.Location = new System.Drawing.Point(3, 5); - this.label73.Name = "label73"; - this.label73.Size = new System.Drawing.Size(191, 25); - this.label73.TabIndex = 19; - this.label73.Text = "Include a Return Leg"; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); @@ -5291,6 +5319,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.webView_synoptic)).EndInit(); this.tab_gransden_lodge.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.webView_gransden_lodge_weather)).EndInit(); + this.tab_nasa_satellite.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.webView_nasa_satellite)).EndInit(); this.tab_metar.ResumeLayout(false); this.tabCnt_airfields.ResumeLayout(false); this.tab_lt_gransden.ResumeLayout(false); @@ -5413,6 +5443,10 @@ private void InitializeComponent() this.panel168.ResumeLayout(false); this.tableLayoutPanel25.ResumeLayout(false); this.panel171.ResumeLayout(false); + this.panel172.ResumeLayout(false); + this.panel172.PerformLayout(); + this.panel173.ResumeLayout(false); + this.panel173.PerformLayout(); this.panel166.ResumeLayout(false); this.panel166.PerformLayout(); this.panel167.ResumeLayout(false); @@ -5608,10 +5642,6 @@ private void InitializeComponent() this.panel85.PerformLayout(); this.panel86.ResumeLayout(false); this.panel86.PerformLayout(); - this.panel172.ResumeLayout(false); - this.panel172.PerformLayout(); - this.panel173.ResumeLayout(false); - this.panel173.PerformLayout(); this.ResumeLayout(false); } @@ -6036,6 +6066,8 @@ private void InitializeComponent() private System.Windows.Forms.Panel panel172; private System.Windows.Forms.Panel panel173; private System.Windows.Forms.Label label73; + private System.Windows.Forms.TabPage tab_nasa_satellite; + private Microsoft.Web.WebView2.WinForms.WebView2 webView_nasa_satellite; } } diff --git a/myFlightInfo/Form1.cs b/myFlightInfo/Form1.cs index 6d72299..27d2d20 100644 --- a/myFlightInfo/Form1.cs +++ b/myFlightInfo/Form1.cs @@ -110,12 +110,13 @@ private async void Form1_Load(object sender, EventArgs e) await webView_synoptic.EnsureCoreWebView2Async(); await webView_gransden_lodge_weather.EnsureCoreWebView2Async(); await webView_weather_windy.EnsureCoreWebView2Async(); + await webView_nasa_satellite.EnsureCoreWebView2Async(); await webView_navFromChart.EnsureCoreWebView2Async(); await webView_navToChart.EnsureCoreWebView2Async(); webView_notams.CoreWebView2.Navigate("https://www.notaminfo.com/ukmap?destination=node%2F39"); - + SetMetarPages(); SetWeatherPages(); @@ -457,6 +458,7 @@ private void SetWeatherPages() "https://metoffice.gov.uk/weather/maps-and-charts/surface-pressure"); webView_weather_windy.CoreWebView2.Navigate( "https://www.windy.com/51.352/0.505/airgram?iconD2,temp,51.344,0.508,13"); + webView_nasa_satellite.CoreWebView2.Navigate("https://worldview.earthdata.nasa.gov/?v=-102.69792073327362,-6.560486491860303,31.10441711257043,74.21716114996451&t=" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + "-T00%3A35%3A36Z"); } else { @@ -492,6 +494,7 @@ private void SetWeatherPages() "https://members.camgliding.uk/members/GRLweather.aspx"); webView_weather_windy.CoreWebView2.Navigate( "https://www.windy.com/52.166/-0.154/airgram?iconD2,temp,52.164,-0.156,15"); + webView_nasa_satellite.CoreWebView2.Navigate("https://worldview.earthdata.nasa.gov/?v=-102.69792073327362,-6.560486491860303,31.10441711257043,74.21716114996451&t=" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + "-T00%3A35%3A36Z"); } } diff --git a/myFlightInfo/TabChanges.cs b/myFlightInfo/TabChanges.cs index 4f5d5ea..18d1339 100644 --- a/myFlightInfo/TabChanges.cs +++ b/myFlightInfo/TabChanges.cs @@ -172,6 +172,13 @@ private void tabcnt_weather_SelectedIndexChanged(object sender, EventArgs e) { cmbobx_gransden_lodge.Visible = false; + grpbx_towns.Visible = false; + btn_school.Visible = false; + } + else if (tabcnt_weather.SelectedTab == tab_nasa_satellite) + { + cmbobx_gransden_lodge.Visible = false; + grpbx_towns.Visible = false; btn_school.Visible = false; } diff --git a/myFlightInfo/utils/HelpfulFunctions.cs b/myFlightInfo/utils/HelpfulFunctions.cs index 97eb03d..50083ac 100644 --- a/myFlightInfo/utils/HelpfulFunctions.cs +++ b/myFlightInfo/utils/HelpfulFunctions.cs @@ -57,5 +57,15 @@ public static string getCardinalPointsFromDecimalDegrees(double bearing) return cardinal; } + + /// + /// Gets yesterdays date. + /// + /// + /// Yesetrdays date as yyyy-mm-dd + public static string getYesterday() + { + return DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); + } } }