From c34888d72963cad14cd9b0abbe44425cac58ef5d Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:08:34 -0600 Subject: [PATCH 01/25] Update Readme Change Icon styles. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 08a9c488..8ef76c9f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # NASR2SCT -![GitHub repo size](https://img.shields.io/github/repo-size/Nikolai558/NASR2SCT) -![GitHub contributors](https://img.shields.io/github/contributors/Nikolai558/NASR2SCT) -![GitHub stars](https://img.shields.io/github/stars/Nikolai558/NASR2SCT?style=social) -![GitHub forks](https://img.shields.io/github/forks/Nikolai558/NASR2SCT?style=social) +![GitHub repo size](https://img.shields.io/github/repo-size/Nikolai558/NASR2SCT?style=for-the-badge) +![GitHub contributors](https://img.shields.io/github/contributors/Nikolai558/NASR2SCT?style=for-the-badge) +![GitHub stars](https://img.shields.io/github/stars/Nikolai558/NASR2SCT?style=for-the-badge) +![GitHub forks](https://img.shields.io/github/forks/Nikolai558/NASR2SCT?style=for-the-badge) + ## Authors: - Kyle Sanders - [Github Profile](https://github.com/KSanders7070) From 624b8d5da1d47321f2fcdff8f2a397e06ca2f968 Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Mon, 7 Jun 2021 15:30:33 -0600 Subject: [PATCH 02/25] Update Readme Added minimum OS Requirement. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ef76c9f..c68d9f23 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,6 @@ Converts the FAA National Airspace System Resource (NASR) Data to formats that m https://docs.google.com/presentation/d/e/2PACX-1vR79DqYD9FxQhA-mUK1FQLO4Xx4mg5xO05NOIJMeB4mbIbs3CY5pIOYtrFtqo8BfmlCFaJSFMSxI_ut/embed ### REQUIREMENTS: -- Windows OS +- Windows OS (8.1 or newer) - CUrl (recomended) From 226dfa4db5380500d8897dc04d7c601cc5cab9bb Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Thu, 10 Jun 2021 13:21:20 -0600 Subject: [PATCH 03/25] Fix Formating Fixed the formatting in the Change log MD file. --- ChangeLog.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 81d7d4ac..8db3d5b7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,19 +2,18 @@ ## Pre-V1.0.0 --- - ## Version 0.8.0 -- Fixed Bug #98 META File Causing Crash: - - If Meta File is not available, NASR2SCT will put a WARN-README.txt file in output directory. -- Testing Update Function ( For Release of 1.0.0 ) + - Fixed Bug #98 META File Causing Crash: + - If Meta File is not available, NASR2SCT will put a WARN-README.txt file in output directory. + - Testing Update Function ( For Release of 1.0.0 ) - ## Version 0.7.9: -- 0.7.8 was packaged incorrectly and would not allow fresh install of 0.7.8 + - 0.7.8 was packaged incorrectly and would not allow fresh install of 0.7.8 - ## Version 0.7.8: -(WARNING) - *** FRESH INSTALL OF THIS VERSION DOES NOT WORK -- Fixed Facility Id Drop Down Alignment #92 -- Duplicate Airway Alias Commands are now put in the 'OTHER' section of the Duplicate Alias Commands Text file. #94 and #81 -- Added Dialog message box with more information when a user is updating NASR2SCT #93 + (WARNING) *** FRESH INSTALL OF THIS VERSION DOES NOT WORK + - Fixed Facility Id Drop Down Alignment #92 + - Duplicate Airway Alias Commands are now put in the 'OTHER' section of the Duplicate Alias Commands Text file. #94 and #81 + - Added Dialog message box with more information when a user is updating NASR2SCT #93 - ## Version 0.7.7: - NEW FEATURE, ARTCC Publication Parser. #83 From e8dfbd55300dbc240ab49be541029fc8ab56720b Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 29 Jun 2021 18:12:28 -0600 Subject: [PATCH 04/25] update copyright --- NASR_GUI/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NASR_GUI/Properties/AssemblyInfo.cs b/NASR_GUI/Properties/AssemblyInfo.cs index 6d82141b..cb1b336d 100644 --- a/NASR_GUI/Properties/AssemblyInfo.cs +++ b/NASR_GUI/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NASR2SCT")] -[assembly: AssemblyCopyright("Copyright © 2020 Nikolas Boling, Kyle Sanders")] +[assembly: AssemblyCopyright("Copyright © 2021 Nikolas Boling, Kyle Sanders")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] From 0746ce21c6a8c7a8693e4d0cb17a03e582549ca2 Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 29 Jun 2021 19:48:06 -0600 Subject: [PATCH 05/25] #103 Changed Credit Screen Title --- NASR_GUI/CreditsForm.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NASR_GUI/CreditsForm.Designer.cs b/NASR_GUI/CreditsForm.Designer.cs index aefafdde..1157ea40 100644 --- a/NASR_GUI/CreditsForm.Designer.cs +++ b/NASR_GUI/CreditsForm.Designer.cs @@ -111,7 +111,7 @@ private void InitializeComponent() this.MinimizeBox = false; this.Name = "CreditsForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "CreditsForm"; + this.Text = "Credits"; this.ResumeLayout(false); this.PerformLayout(); From 14ad8e928b4a1050c400b215c68bb2ab0ac68b4a Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 29 Jun 2021 19:48:30 -0600 Subject: [PATCH 06/25] #108 Changed Airac Cycle Phrasing --- NASR_GUI/MainForm.Designer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NASR_GUI/MainForm.Designer.cs b/NASR_GUI/MainForm.Designer.cs index 3beefbd7..ee072141 100644 --- a/NASR_GUI/MainForm.Designer.cs +++ b/NASR_GUI/MainForm.Designer.cs @@ -94,14 +94,14 @@ private void InitializeComponent() // // airacLabel // - this.airacLabel.AutoSize = true; this.airacLabel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.airacLabel.Location = new System.Drawing.Point(67, 29); + this.airacLabel.Location = new System.Drawing.Point(1, 29); this.airacLabel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.airacLabel.Name = "airacLabel"; - this.airacLabel.Size = new System.Drawing.Size(296, 25); + this.airacLabel.Size = new System.Drawing.Size(450, 25); this.airacLabel.TabIndex = 2; - this.airacLabel.Text = "Which AIRAC Cycle do you want? "; + this.airacLabel.Text = "Select an AIRAC Cycle by Effective Date"; + this.airacLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // facilityIDLabel // From 0c2d0e83021c583bd02bab732eeb7758996008c9 Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 29 Jun 2021 20:10:05 -0600 Subject: [PATCH 07/25] #105 If download fails, show msg, close program --- ClassData/GlobalConfig.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ClassData/GlobalConfig.cs b/ClassData/GlobalConfig.cs index a75dc318..4040e8ee 100644 --- a/ClassData/GlobalConfig.cs +++ b/ClassData/GlobalConfig.cs @@ -209,7 +209,15 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo if (!File.Exists($"{tempPath}\\{fileName}")) { - client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); + try + { + client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); + } + catch (Exception) + { + MessageBox.Show($"FAILED DOWNLOADING: \n\n{fileName}\n{allURLs[fileName]}\n\nThis program will exit.\nPlease try again."); + Environment.Exit(-1); + } DownloadedFilePaths.Add($"{tempPath}\\{fileName}"); } } From 94077c0677659c360f20d498cb0ba586d5a54b56 Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 29 Jun 2021 20:21:23 -0600 Subject: [PATCH 08/25] #107 Alert user if no internet at start of program --- NASR_GUI/Program.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/NASR_GUI/Program.cs b/NASR_GUI/Program.cs index caa529b4..0368203a 100644 --- a/NASR_GUI/Program.cs +++ b/NASR_GUI/Program.cs @@ -34,7 +34,15 @@ static void Main() //ParseMeta.QuarterbackFunc(); // API CALL TO GITHUB, WARNING ONLY 60 PER HOUR IS ALLOWED, WILL BREAK IF WE DO MORE! - GlobalConfig.UpdateCheck(); + try + { + GlobalConfig.UpdateCheck(); + } + catch (Exception) + { + MessageBox.Show($"NASR2SCT could not preform update check, please check internet connection.\n\nThis program will exit.\nPlease try again."); + Environment.Exit(-1); + } // Check Current Program Against Github, if different ask user if they want to update. CheckVersion(); From 3e1b4a044819d6121676d9cd217fab4dc9f6b168 Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 29 Jun 2021 21:19:18 -0600 Subject: [PATCH 09/25] started new WX system --- ClassData/DataAccess/GetAptData.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index 08ff50c5..a28ba6ad 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -229,7 +229,9 @@ private void ParseAndWriteWxStation(string effectiveDate) if (id == apt.Id) { final = $"\"{line.Substring(20, 4)} {apt.Name.Replace('"', '-')}\" {GlobalConfig.CorrectLatLon(lat, true, GlobalConfig.Convert)} {GlobalConfig.CorrectLatLon(lon, false, GlobalConfig.Convert)} 11579568"; - + // TODO - WX Checker runs here. + // curl -X GET "https://api.weather.gov/stations/ADS/observations?limit=1" -H "accept: application/geo+json" + // If "Features" is empty, does not exist otherwise add it. sb.AppendLine(final); break; } From 3dee13021092f32bdb5604a5e0f21246a1b94b2e Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Thu, 1 Jul 2021 10:46:31 -0600 Subject: [PATCH 10/25] wx station checker SLOW continued work on WX station checker function. This way is very very slow. need to improve. --- ClassData/DataAccess/GetAptData.cs | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index a28ba6ad..77e346aa 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -6,8 +6,11 @@ using System.IO.Compression; using System.Linq; using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; using System.Text; using System.Text.RegularExpressions; +using System.Threading.Tasks; using System.Xml.Serialization; namespace ClassData.DataAccess @@ -196,13 +199,20 @@ private void GetOffsetRwyText() private void ParseAndWriteWxStation(string effectiveDate) { string filepath = $"{GlobalConfig.outputDirectory}\\VRC\\[LABELS].sct2"; + List codes = new List() { "K", "P" }; + HttpResponseMessage response; StringBuilder sb = new StringBuilder(); sb.AppendLine("[LABELS]"); List countryCodes = new List { "AS", "GU", "MP", "PR", "VI", "US" }; string id; - string final; + string final; + + var client = new HttpClient(); + client.BaseAddress = new Uri("https://api.weather.gov/stations/"); + client.DefaultRequestHeaders.Accept.Clear(); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/geo+json")); foreach (string line in File.ReadAllLines($"{GlobalConfig.tempPath}\\{effectiveDate}_WXSTATIONS.txt")) { @@ -229,10 +239,19 @@ private void ParseAndWriteWxStation(string effectiveDate) if (id == apt.Id) { final = $"\"{line.Substring(20, 4)} {apt.Name.Replace('"', '-')}\" {GlobalConfig.CorrectLatLon(lat, true, GlobalConfig.Convert)} {GlobalConfig.CorrectLatLon(lon, false, GlobalConfig.Convert)} 11579568"; - // TODO - WX Checker runs here. - // curl -X GET "https://api.weather.gov/stations/ADS/observations?limit=1" -H "accept: application/geo+json" - // If "Features" is empty, does not exist otherwise add it. - sb.AppendLine(final); + + // curl -X GET "https://api.weather.gov/stations/{Station_ID}/" -H "accept: application/geo+json" + foreach (string letter in codes) + { + var task = Task.Run(() => client.GetAsync(letter + id + "/")); + task.Wait(); + response = task.Result; + if (response.IsSuccessStatusCode) + { + sb.AppendLine(final); + break; + } + } break; } } From 9f4303af4dd7805ff70f8e4edd8a00df32d209b1 Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Thu, 1 Jul 2021 11:28:35 -0600 Subject: [PATCH 11/25] optional debuging for slow wx checker. --- ClassData/DataAccess/GetAptData.cs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index 77e346aa..39869543 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -199,8 +199,8 @@ private void GetOffsetRwyText() private void ParseAndWriteWxStation(string effectiveDate) { string filepath = $"{GlobalConfig.outputDirectory}\\VRC\\[LABELS].sct2"; - List codes = new List() { "K", "P" }; HttpResponseMessage response; + bool useSlowWay = false; StringBuilder sb = new StringBuilder(); sb.AppendLine("[LABELS]"); @@ -240,19 +240,27 @@ private void ParseAndWriteWxStation(string effectiveDate) { final = $"\"{line.Substring(20, 4)} {apt.Name.Replace('"', '-')}\" {GlobalConfig.CorrectLatLon(lat, true, GlobalConfig.Convert)} {GlobalConfig.CorrectLatLon(lon, false, GlobalConfig.Convert)} 11579568"; - // curl -X GET "https://api.weather.gov/stations/{Station_ID}/" -H "accept: application/geo+json" - foreach (string letter in codes) + if (useSlowWay) { - var task = Task.Run(() => client.GetAsync(letter + id + "/")); - task.Wait(); - response = task.Result; - if (response.IsSuccessStatusCode) + // TODO - Get rid of this.. We do not want to do this method. + // curl -X GET "https://api.weather.gov/stations/{Station_ID}/" -H "accept: application/geo+json" + foreach (string letter in new List() { "P", "K", "L", "T"}) { - sb.AppendLine(final); - break; + var task = Task.Run(() => client.GetAsync(letter + id + "/")); + task.Wait(); + response = task.Result; + if (response.IsSuccessStatusCode) + { + sb.AppendLine(final); + break; + } } } - break; + else + { + sb.AppendLine(final); + break; + } } } } From 6e0447de0026433af6d1c3ffd53dcad07caf15ed Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Thu, 1 Jul 2021 16:31:01 -0600 Subject: [PATCH 12/25] Complete WX Cross check Need to verify the stations that won't be added to LABELS do not have METAR data. Also need to remove debuging code. --- ClassData/DataAccess/GetAptData.cs | 44 ++++++++++++++---------------- ClassData/GlobalConfig.cs | 30 +++++++++++++------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index 39869543..f1970e6f 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -11,6 +11,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Xml.Linq; using System.Xml.Serialization; namespace ClassData.DataAccess @@ -198,21 +199,26 @@ private void GetOffsetRwyText() private void ParseAndWriteWxStation(string effectiveDate) { + string wxCrossCheckFilePathIn = $"{GlobalConfig.tempPath}\\{effectiveDate}_WX-CROSSCHECK.xml"; string filepath = $"{GlobalConfig.outputDirectory}\\VRC\\[LABELS].sct2"; - HttpResponseMessage response; - bool useSlowWay = false; - + StringBuilder sb = new StringBuilder(); sb.AppendLine("[LABELS]"); + // TODO - DEBUGING ONLY! + string debugfilepath = $"{GlobalConfig.outputDirectory}\\debug.txt"; + StringBuilder debugSB = new StringBuilder(); + debugSB.AppendLine("DEBUGING ONLY! The following weather stations would have been added the old way. But now they will not be in [LABELS].\n\n"); + List countryCodes = new List { "AS", "GU", "MP", "PR", "VI", "US" }; string id; string final; - var client = new HttpClient(); - client.BaseAddress = new Uri("https://api.weather.gov/stations/"); - client.DefaultRequestHeaders.Accept.Clear(); - client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/geo+json")); + // string xml = new WebClient().DownloadString("https://w1.weather.gov/xml/current_obs/index.xml"); + XDocument xDocSload = XDocument.Load(wxCrossCheckFilePathIn); + var sList = xDocSload.Root.Elements("station").Elements("station_id").Select(element => element.Value.Substring(1,3)).ToList(); + List seriesList = sList; + foreach (string line in File.ReadAllLines($"{GlobalConfig.tempPath}\\{effectiveDate}_WXSTATIONS.txt")) { @@ -240,33 +246,25 @@ private void ParseAndWriteWxStation(string effectiveDate) { final = $"\"{line.Substring(20, 4)} {apt.Name.Replace('"', '-')}\" {GlobalConfig.CorrectLatLon(lat, true, GlobalConfig.Convert)} {GlobalConfig.CorrectLatLon(lon, false, GlobalConfig.Convert)} 11579568"; - if (useSlowWay) + bool contains = seriesList.Contains(id, StringComparer.OrdinalIgnoreCase); + if (contains) { - // TODO - Get rid of this.. We do not want to do this method. - // curl -X GET "https://api.weather.gov/stations/{Station_ID}/" -H "accept: application/geo+json" - foreach (string letter in new List() { "P", "K", "L", "T"}) - { - var task = Task.Run(() => client.GetAsync(letter + id + "/")); - task.Wait(); - response = task.Result; - if (response.IsSuccessStatusCode) - { - sb.AppendLine(final); - break; - } - } + sb.AppendLine(final); } else { - sb.AppendLine(final); - break; + // TODO - Do nothing here. This is Debuging only. + debugSB.AppendLine(final); } + + break; } } } } } } + File.WriteAllText(debugfilepath, debugSB.ToString()); File.WriteAllText(filepath, sb.ToString()); File.AppendAllText(filepath, $"\n\n\n\n\n\n"); diff --git a/ClassData/GlobalConfig.cs b/ClassData/GlobalConfig.cs index 4040e8ee..5dfbd90e 100644 --- a/ClassData/GlobalConfig.cs +++ b/ClassData/GlobalConfig.cs @@ -156,7 +156,8 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo { $"{airacCycle}_FAA_Meta.xml", $"https://aeronav.faa.gov/d-tpp/{airacCycle}/xml_data/d-tpp_Metafile.xml"}, { $"{effectiveDate}_FIX.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/FIX.zip" }, { $"{effectiveDate}_NAV.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/NAV.zip"}, - { $"{airacCycle}_TELEPHONY.html", $"https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/chap3_section_2.html" } + { $"{airacCycle}_TELEPHONY.html", $"https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/chap3_section_2.html" }, + { $"{effectiveDate}_WX-CROSSCHECK.xml", $"https://w1.weather.gov/xml/current_obs/index.xml" } }; } else @@ -192,7 +193,8 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo { $"{effectiveDate}_AWY.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/AWY.zip"}, { $"{effectiveDate}_FIX.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/FIX.zip" }, { $"{effectiveDate}_NAV.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/NAV.zip"}, - { $"{airacCycle}_TELEPHONY.html", $"https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/chap3_section_2.html" } + { $"{airacCycle}_TELEPHONY.html", $"https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/chap3_section_2.html" }, + { $"{effectiveDate}_WX-CROSSCHECK.xml", $"https://w1.weather.gov/xml/current_obs/index.xml" } }; } @@ -211,7 +213,15 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo { try { - client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); + if (fileName == $"{effectiveDate}_WX-CROSSCHECK.xml") + { + CreateCurlBatchFile("WXCROSSCHECK.bat", "https://w1.weather.gov/xml/current_obs/index.xml", fileName); + ExecuteCurlBatchFile("WXCROSSCHECK.bat"); + } + else + { + client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); + } } catch (Exception) { @@ -569,20 +579,20 @@ public static string CreateDecFormat(string value, bool roundSixPlaces) return decFormat; } - private static void CreateCurlBatchFile() + private static void CreateCurlBatchFile(string name, string url, string outputFileName) { - string filePath = $"{tempPath}\\getAiraccEff.bat"; + string filePath = $"{tempPath}\\{name}"; string writeMe = $"cd \"{tempPath}\"\n" + - $"curl \"https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/NASR_Subscription/\">{FaaHtmlFileVariable}_FAA_NASR.HTML"; + $"curl \"{url}\">{outputFileName}"; File.WriteAllText(filePath, writeMe); } - private static void ExecuteCurlBatchFile() + private static void ExecuteCurlBatchFile(string batchFileName) { ProcessStartInfo ProcessInfo; Process Process; - ProcessInfo = new ProcessStartInfo("cmd.exe", "/c " + $"\"{tempPath}\\getAiraccEff.bat\""); + ProcessInfo = new ProcessStartInfo("cmd.exe", "/c " + $"\"{tempPath}\\{batchFileName}\""); ProcessInfo.CreateNoWindow = true; ProcessInfo.UseShellExecute = false; @@ -602,9 +612,9 @@ public static void GetAiracDateFromFAA() string response; - CreateCurlBatchFile(); + CreateCurlBatchFile("getAiraccEff.bat", "https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/NASR_Subscription/", $"{FaaHtmlFileVariable}_FAA_NASR.HTML"); - ExecuteCurlBatchFile(); + ExecuteCurlBatchFile("getAiraccEff.bat"); if (File.Exists($"{tempPath}\\{FaaHtmlFileVariable}_FAA_NASR.HTML") && File.ReadAllText($"{tempPath}\\{FaaHtmlFileVariable}_FAA_NASR.HTML").Length > 10) { From 545b188b436953824e49a08454dd40927ddb1588 Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Thu, 1 Jul 2021 17:06:30 -0600 Subject: [PATCH 13/25] Attempt to fix WX station Checker. --- ClassData/DataAccess/GetAptData.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index f1970e6f..c501fe25 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -217,7 +217,7 @@ private void ParseAndWriteWxStation(string effectiveDate) // string xml = new WebClient().DownloadString("https://w1.weather.gov/xml/current_obs/index.xml"); XDocument xDocSload = XDocument.Load(wxCrossCheckFilePathIn); var sList = xDocSload.Root.Elements("station").Elements("station_id").Select(element => element.Value.Substring(1,3)).ToList(); - List seriesList = sList; + var lList = xDocSload.Root.Elements("station").Elements("station_id").Select(element => element.Value).ToList(); foreach (string line in File.ReadAllLines($"{GlobalConfig.tempPath}\\{effectiveDate}_WXSTATIONS.txt")) @@ -246,8 +246,7 @@ private void ParseAndWriteWxStation(string effectiveDate) { final = $"\"{line.Substring(20, 4)} {apt.Name.Replace('"', '-')}\" {GlobalConfig.CorrectLatLon(lat, true, GlobalConfig.Convert)} {GlobalConfig.CorrectLatLon(lon, false, GlobalConfig.Convert)} 11579568"; - bool contains = seriesList.Contains(id, StringComparer.OrdinalIgnoreCase); - if (contains) + if (sList.Contains(id, StringComparer.OrdinalIgnoreCase) || lList.Contains(id, StringComparer.OrdinalIgnoreCase)) { sb.AppendLine(final); } From 8d6e5a9e809d43fee3b1c54be3ec5c8d51c0546b Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Sun, 25 Jul 2021 15:57:04 -0600 Subject: [PATCH 14/25] #111 FAQ Button Added Added and reorginized Menu options. --- NASR_GUI/MainForm.Designer.cs | 12 ++++++++++++ NASR_GUI/MainForm.cs | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/NASR_GUI/MainForm.Designer.cs b/NASR_GUI/MainForm.Designer.cs index ee072141..fca9ddb4 100644 --- a/NASR_GUI/MainForm.Designer.cs +++ b/NASR_GUI/MainForm.Designer.cs @@ -54,6 +54,7 @@ private void InitializeComponent() this.creditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.changeLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.uninstallToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fAQToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.airacCycleGroupBox.SuspendLayout(); this.convertGroupBox.SuspendLayout(); this.startGroupBox.SuspendLayout(); @@ -316,6 +317,7 @@ private void InitializeComponent() this.menuStrip1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.instructionsToolStripMenuItem, + this.fAQToolStripMenuItem, this.creditsToolStripMenuItem, this.changeLogToolStripMenuItem, this.uninstallToolStripMenuItem}); @@ -362,6 +364,15 @@ private void InitializeComponent() this.uninstallToolStripMenuItem.Text = "Uninstall"; this.uninstallToolStripMenuItem.Click += new System.EventHandler(this.uninstallToolStripMenuItem_Click); // + // fAQToolStripMenuItem + // + this.fAQToolStripMenuItem.Font = new System.Drawing.Font("Romantic", 11.25F); + this.fAQToolStripMenuItem.ForeColor = System.Drawing.SystemColors.Control; + this.fAQToolStripMenuItem.Name = "fAQToolStripMenuItem"; + this.fAQToolStripMenuItem.Size = new System.Drawing.Size(50, 20); + this.fAQToolStripMenuItem.Text = "FAQ"; + this.fAQToolStripMenuItem.Click += new System.EventHandler(this.fAQToolStripMenuItem_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 25F); @@ -428,6 +439,7 @@ private void InitializeComponent() private System.Windows.Forms.Label outputLocationLabel; private System.Windows.Forms.ToolStripMenuItem uninstallToolStripMenuItem; private System.Windows.Forms.ComboBox facilityIdCombobox; + private System.Windows.Forms.ToolStripMenuItem fAQToolStripMenuItem; } } diff --git a/NASR_GUI/MainForm.cs b/NASR_GUI/MainForm.cs index 2e227999..e2bef813 100644 --- a/NASR_GUI/MainForm.cs +++ b/NASR_GUI/MainForm.cs @@ -682,5 +682,10 @@ private void facilityIdCombobox_SelectedIndexChanged(object sender, EventArgs e) { GlobalConfig.facilityID = facilityIdCombobox.SelectedItem.ToString(); } + + private void fAQToolStripMenuItem_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("https://docs.google.com/presentation/d/e/2PACX-1vSlhz1DhDwZ-43BY4Q2vg-ff0QBGssxpmv4-nhZlz9LpGJvWjqLsHVaQwwsV1AGMWFFF_x_j_b3wTBO/embed"); + } } } From 6ec26a5919de557e07b028ae659a80a731c8b011 Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Sun, 25 Jul 2021 15:59:24 -0600 Subject: [PATCH 15/25] Added FAQ to correct Font Corrected FAQ Menu button Font --- NASR_GUI/MainForm.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NASR_GUI/MainForm.cs b/NASR_GUI/MainForm.cs index e2bef813..3132af01 100644 --- a/NASR_GUI/MainForm.cs +++ b/NASR_GUI/MainForm.cs @@ -505,6 +505,7 @@ private void MainForm_Load(object sender, EventArgs e) creditsToolStripMenuItem.Font = new Font(pfc.Families[0], 12, FontStyle.Regular); changeLogToolStripMenuItem.Font = new Font(pfc.Families[0], 12, FontStyle.Regular); uninstallToolStripMenuItem.Font = new Font(pfc.Families[0], 12, FontStyle.Regular); + fAQToolStripMenuItem.Font = new Font(pfc.Families[0], 12, FontStyle.Regular); From efb2db7951415eec5a2f9e59f18668a499c10deb Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Sun, 25 Jul 2021 16:26:14 -0600 Subject: [PATCH 16/25] Update screen views GH Changelog.md #112 When there is an update, the screen will show all changes between current user version and the github version latest release. --- ClassData/GlobalConfig.cs | 2 +- NASR_GUI/Processing.cs | 40 ++++++++++++++++++++++++++--- NASR_GUI/Properties/AssemblyInfo.cs | 4 +-- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/ClassData/GlobalConfig.cs b/ClassData/GlobalConfig.cs index 5dfbd90e..9185a7e5 100644 --- a/ClassData/GlobalConfig.cs +++ b/ClassData/GlobalConfig.cs @@ -24,7 +24,7 @@ namespace NASARData /// public class GlobalConfig { - public static readonly string ProgramVersion = "0.8.0"; + public static readonly string ProgramVersion = "0.8.1"; public static string GithubVersion = ""; diff --git a/NASR_GUI/Processing.cs b/NASR_GUI/Processing.cs index 38ccfaf7..d37e0710 100644 --- a/NASR_GUI/Processing.cs +++ b/NASR_GUI/Processing.cs @@ -4,7 +4,10 @@ using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Linq; +using System.Net; +using System.Security.Policy; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -77,13 +80,42 @@ public void DisplayMessages(bool visible) } } + private string ReadChangeLog() + { + string output = ""; + string content = ""; + + string url = "https://raw.githubusercontent.com/Nikolai558/NASR2SCT/development/ChangeLog.md"; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var reader = new StreamReader(response.GetResponseStream())) + { + content = reader.ReadToEnd(); + } + + foreach (string line in content.Split('\n')) + { + if (line.Contains("## Version ")) + { + string version = line.Substring(13, 5); + + if (GlobalConfig.ProgramVersion == version) + { + break; + } + } + output += line + '\n'; + } + + return output; + } + private void InputVariables() { - List msg = GlobalConfig.ReleaseBody.Split(new string[] { "##" }, StringSplitOptions.None).ToList(); - msg = msg.GetRange(2, msg.Count - 2); - msg[0] = msg[0].Substring(1, msg[0].Length - 1); + string msg = ReadChangeLog(); - githubMessagelabel.Text = string.Join(" ", msg); + githubMessagelabel.Text = msg; programVersionLabel.Text = $"Your program version: {GlobalConfig.ProgramVersion}"; githubVersionLabel.Text = $"Latest release version: {GlobalConfig.GithubVersion}"; } diff --git a/NASR_GUI/Properties/AssemblyInfo.cs b/NASR_GUI/Properties/AssemblyInfo.cs index cb1b336d..ef5e02de 100644 --- a/NASR_GUI/Properties/AssemblyInfo.cs +++ b/NASR_GUI/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.0")] -[assembly: AssemblyFileVersion("0.8.0")] +[assembly: AssemblyVersion("0.8.1")] +[assembly: AssemblyFileVersion("0.8.1")] From 17cea54bb636cc4d19b9e229a0de6018c9fb5fcf Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Sun, 25 Jul 2021 16:36:44 -0600 Subject: [PATCH 17/25] #109 Went through TODO comments Went through all of the TODO comments. --- ClassData/DataAccess/GetAptData.cs | 12 +++---- ClassData/DataAccess/PublicationParser.cs | 1 - ClassData/GlobalConfig.cs | 31 +++++++--------- ClassData/Models/AliasCheck.cs | 2 -- .../Models/MetaFileModels/MetaRecordModel.cs | 4 +-- NASR_GUI/MainForm.cs | 36 ------------------- 6 files changed, 20 insertions(+), 66 deletions(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index c501fe25..59331b2a 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -205,10 +205,10 @@ private void ParseAndWriteWxStation(string effectiveDate) StringBuilder sb = new StringBuilder(); sb.AppendLine("[LABELS]"); - // TODO - DEBUGING ONLY! - string debugfilepath = $"{GlobalConfig.outputDirectory}\\debug.txt"; - StringBuilder debugSB = new StringBuilder(); - debugSB.AppendLine("DEBUGING ONLY! The following weather stations would have been added the old way. But now they will not be in [LABELS].\n\n"); + // DEBUGING ONLY! WX STATION + // string debugfilepath = $"{GlobalConfig.outputDirectory}\\debug.txt"; + // StringBuilder debugSB = new StringBuilder(); + // debugSB.AppendLine("DEBUGING ONLY! The following weather stations would have been added the old way. But now they will not be in [LABELS].\n\n"); List countryCodes = new List { "AS", "GU", "MP", "PR", "VI", "US" }; string id; @@ -252,8 +252,8 @@ private void ParseAndWriteWxStation(string effectiveDate) } else { - // TODO - Do nothing here. This is Debuging only. - debugSB.AppendLine(final); + // Do nothing here. This is Debuging only. WX STATION + // debugSB.AppendLine(final); } break; diff --git a/ClassData/DataAccess/PublicationParser.cs b/ClassData/DataAccess/PublicationParser.cs index b069a73a..8a408fb8 100644 --- a/ClassData/DataAccess/PublicationParser.cs +++ b/ClassData/DataAccess/PublicationParser.cs @@ -12,7 +12,6 @@ namespace ClassData.DataAccess { public class PublicationParser { - // TODO - Populate this list from somewhere from some how. public static List allArtcc = GlobalConfig.allArtcc; private string outputDirectory = GlobalConfig.outputDirectory + "PUBLICATIONS"; diff --git a/ClassData/GlobalConfig.cs b/ClassData/GlobalConfig.cs index 9185a7e5..528c71dd 100644 --- a/ClassData/GlobalConfig.cs +++ b/ClassData/GlobalConfig.cs @@ -205,31 +205,24 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo { foreach (string fileName in allURLs.Keys) { - // TODO - We may not want to keep the data. Might want to remove this and just download it anyways. - // This Data will ALWAYS get removed when user clicks "START" - // This is pointless but I will keep in for debuging purposes. - - if (!File.Exists($"{tempPath}\\{fileName}")) + try { - try + if (fileName == $"{effectiveDate}_WX-CROSSCHECK.xml") { - if (fileName == $"{effectiveDate}_WX-CROSSCHECK.xml") - { - CreateCurlBatchFile("WXCROSSCHECK.bat", "https://w1.weather.gov/xml/current_obs/index.xml", fileName); - ExecuteCurlBatchFile("WXCROSSCHECK.bat"); - } - else - { - client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); - } + CreateCurlBatchFile("WXCROSSCHECK.bat", "https://w1.weather.gov/xml/current_obs/index.xml", fileName); + ExecuteCurlBatchFile("WXCROSSCHECK.bat"); } - catch (Exception) + else { - MessageBox.Show($"FAILED DOWNLOADING: \n\n{fileName}\n{allURLs[fileName]}\n\nThis program will exit.\nPlease try again."); - Environment.Exit(-1); + client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); } - DownloadedFilePaths.Add($"{tempPath}\\{fileName}"); } + catch (Exception) + { + MessageBox.Show($"FAILED DOWNLOADING: \n\n{fileName}\n{allURLs[fileName]}\n\nThis program will exit.\nPlease try again."); + Environment.Exit(-1); + } + DownloadedFilePaths.Add($"{tempPath}\\{fileName}"); } } } diff --git a/ClassData/Models/AliasCheck.cs b/ClassData/Models/AliasCheck.cs index 00533859..fef2117f 100644 --- a/ClassData/Models/AliasCheck.cs +++ b/ClassData/Models/AliasCheck.cs @@ -74,8 +74,6 @@ public void CheckForDuplicates(string CompleteAliasFilePath) private void WriteDupFile(List DuplicateCommandsList, List AirportModels) { - // TODO - Make more efficient - string outFilePath = $"{GlobalConfig.outputDirectory}\\ALIAS\\DUPLICATE_COMMANDS.txt"; string currentAirportIatta = ""; string aptIatta; diff --git a/ClassData/Models/MetaFileModels/MetaRecordModel.cs b/ClassData/Models/MetaFileModels/MetaRecordModel.cs index f6eb2939..1e981a18 100644 --- a/ClassData/Models/MetaFileModels/MetaRecordModel.cs +++ b/ClassData/Models/MetaFileModels/MetaRecordModel.cs @@ -154,8 +154,8 @@ public void CreateAliasComand(string AptIata) tempRecordList[missingIndex].AliasCommand = tempRecordList[missingIndex].AliasCommand.Insert(2, tempVariant); } - // TODO - Might want to remove this - File.AppendAllText($"{NASARData.GlobalConfig.tempPath}\\MisMatchingVariants.txt", $"APT IATA: {AptIata} - {tempRecordList[missingIndex].FAAChartName}\n"); + // Might want to remove this - This is to see MisMatchingVaarents inside the Temp File. + // File.AppendAllText($"{NASARData.GlobalConfig.tempPath}\\MisMatchingVariants.txt", $"APT IATA: {AptIata} - {tempRecordList[missingIndex].FAAChartName}\n"); } } diff --git a/NASR_GUI/MainForm.cs b/NASR_GUI/MainForm.cs index 3132af01..28ce2b43 100644 --- a/NASR_GUI/MainForm.cs +++ b/NASR_GUI/MainForm.cs @@ -284,8 +284,6 @@ private void Worker_StartParsingDoWork(object sender, DoWorkEventArgs e) //facilityIdCombobox.Invoke(new MethodInvoker(delegate { facilityID = facilityIdCombobox.SelectedItem.ToString(); })); //facilityID = facilityIdCombobox.SelectedItem.ToString(); - // TODO - This is messy and needs to be cleaned up. - if (nextAiracSelection.Checked == true && nextAiracAvailable == false) { // DialogResult dialogResult = MessageBox.Show("Next Airacc not available, No Code to handle this yet.", "ERROR: NO Facility ID", MessageBoxButtons.OK); @@ -641,40 +639,6 @@ private void uninstallToolStripMenuItem_Click(object sender, EventArgs e) Process.Close(); - - // TODO - COME BACK TO THIS - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //List directories = new List() { $"{GlobalConfig.tempPath}", ""}; - - - //foreach (string path in directories) - //{ - - // if (Directory.Exists(path)) - // { - // // This variable holds all information for the temp path ie. Directories and files. - // DirectoryInfo di = new DirectoryInfo(path); - - // // Loop through the Files in our TempPath - // foreach (FileInfo file in di.EnumerateFiles()) - // { - // // Delete each file it finds inside of this directory. IE Temp Path - // file.Delete(); - // } - - // // Loop through the Directories in our TempPath - // foreach (DirectoryInfo dir in di.EnumerateDirectories()) - // { - // // Delete the folder it finds. - // dir.Delete(true); - // } - // } - //} - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - //File.Delete($"{Path.GetTempPath()}UNINSTALL_NASR2SCT.bat"); - Environment.Exit(1); } } From 20fec9e701786c6973c6c1abe7f54ee3f4975bca Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Sun, 25 Jul 2021 16:44:32 -0600 Subject: [PATCH 18/25] Removed Debug Code Removed a line of leftover debug code. --- ClassData/DataAccess/GetAptData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index 59331b2a..e0a19005 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -263,7 +263,7 @@ private void ParseAndWriteWxStation(string effectiveDate) } } } - File.WriteAllText(debugfilepath, debugSB.ToString()); + // File.WriteAllText(debugfilepath, debugSB.ToString()); File.WriteAllText(filepath, sb.ToString()); File.AppendAllText(filepath, $"\n\n\n\n\n\n"); From 4f623b41bad8d260ccbd8fb08519826de0c1d64d Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Wed, 28 Jul 2021 09:23:31 -0600 Subject: [PATCH 19/25] Updated ReleaseTemplate Added the current changes to the Release Template so it is ready for copy and paste when we release. --- ReleaseTemplate.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ReleaseTemplate.txt b/ReleaseTemplate.txt index 017360d6..07739b35 100644 --- a/ReleaseTemplate.txt +++ b/ReleaseTemplate.txt @@ -9,4 +9,9 @@ Release Candidate V-0.8.0 4. Run the Setup.exe ## Change log: -- \ No newline at end of file +- Change log on Update question will display all changes from user version and up to the latest release. +- FAQ button added. This will take you to a Facts And Questions google slide. +- Choosing AIRAC cycle phrase/question changed. +- Fixed bug where program crashes if the user is not connected to the internet. +- Fixed bug where program states it's complete when it really is not. This happened when a file download failed. +- Fixed Credit screen title. From 26620744e9657f2bea920544092fbb21fdbf8d68 Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Wed, 28 Jul 2021 12:36:04 -0600 Subject: [PATCH 20/25] Debug Code for #113 Added some temp debug code to investigate #113 --- ClassData/DataAccess/GetStarDpData.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ClassData/DataAccess/GetStarDpData.cs b/ClassData/DataAccess/GetStarDpData.cs index 84a64ac6..9b8a3dbf 100644 --- a/ClassData/DataAccess/GetStarDpData.cs +++ b/ClassData/DataAccess/GetStarDpData.cs @@ -42,6 +42,7 @@ private void ParseStarDp(string effectiveDate) SeqNumber = line.Substring(1, 4).Trim(), PointCode = line.Substring(10, 2).Trim(), PointId = line.Substring(30, 6).Trim(), + // TODO - NOT Assigned Computer Code - Need to handle this? ComputerCode = line.Substring(38, 13).Trim(), Lat_N_S = line.Substring(13, 1).Trim(), Lat_Deg = "0" + line.Substring(14, 2).Trim(), @@ -174,7 +175,9 @@ private void WriteAlias() if (procedures[procSeqNumber][0].ComputerCode.IndexOf("NOT ASSIGNED") != -1) { - // Um this might skip procedures...... Might have an issue here? We will see. + // TODO - I think this is where the non generated computer codes are being skipped. + // DEBUG - Remove this Console.writeline. + Console.WriteLine(procedures[procSeqNumber][0].PointId + " - Seq: " + procedures[procSeqNumber][0].SeqNumber); continue; } else if (procedures[procSeqNumber][0].Type == "S") From 8a6e6f71f102dde46ea228144afefe9c31f5a8c0 Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Wed, 28 Jul 2021 15:55:05 -0600 Subject: [PATCH 21/25] Attempting another solution #113 This code generates duplicate Alias Commands. ALOT --- ClassData/DataAccess/GetFaaMetaFileData.cs | 18 +++++++++++++----- ClassData/DataAccess/GetStarDpData.cs | 9 ++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ClassData/DataAccess/GetFaaMetaFileData.cs b/ClassData/DataAccess/GetFaaMetaFileData.cs index 31d15e4e..af568eec 100644 --- a/ClassData/DataAccess/GetFaaMetaFileData.cs +++ b/ClassData/DataAccess/GetFaaMetaFileData.cs @@ -67,12 +67,20 @@ private void ParseMetaFile() AmdtNum = recordData.Element("amdtnum").Value, AmdtDate = recordData.Element("amdtdate").Value }; - // - If something breaks totally move those back here. - //if ($"; {apt.AirportName}-{record.FAAChartName}" == "; OCEANA NAS/ APOLLO SOUCEK FIELD-RNAV (GPS) RWY 32L/R") - //{ - // string STOPME = ""; - //} + // TODO - Check for Empty FAANFD18 Number + if (string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "STAR") + { + // DEBUG + record.Faanfd18 = apt.AptIdent + "." + apt.AptIdent + "?"; + } + + // TODO - Check for Empty FAANFD18 Number + if (string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "DP") + { + // DEBUG + record.Faanfd18 = apt.AptIdent + "?." + apt.AptIdent; + } if ( record.ChartName.IndexOf("CONVERGING") == -1 && diff --git a/ClassData/DataAccess/GetStarDpData.cs b/ClassData/DataAccess/GetStarDpData.cs index 9b8a3dbf..20a9368e 100644 --- a/ClassData/DataAccess/GetStarDpData.cs +++ b/ClassData/DataAccess/GetStarDpData.cs @@ -177,16 +177,21 @@ private void WriteAlias() { // TODO - I think this is where the non generated computer codes are being skipped. // DEBUG - Remove this Console.writeline. - Console.WriteLine(procedures[procSeqNumber][0].PointId + " - Seq: " + procedures[procSeqNumber][0].SeqNumber); + // Console.WriteLine(procedures[procSeqNumber][0].PointId + " - Seq: " + procedures[procSeqNumber][0].SeqNumber); + // Console.WriteLine("C: " + procedures[procSeqNumber][0].PointId); + //currentComputerCode = procedures[procSeqNumber][0].PointId; + //procedures[procSeqNumber][0].PointCode = "AA"; continue; } else if (procedures[procSeqNumber][0].Type == "S") { currentComputerCode = procedures[procSeqNumber][0].ComputerCode.Split('.')[1].Substring(0, procedures[procSeqNumber][0].ComputerCode.Split('.')[1].Length - 1); + //Console.WriteLine("S: " + currentComputerCode); } else if (procedures[procSeqNumber][0].Type == "D") { currentComputerCode = procedures[procSeqNumber][0].ComputerCode.Split('.')[0].Substring(0, procedures[procSeqNumber][0].ComputerCode.Split('.')[0].Length - 1); + //Console.WriteLine("D: " + currentComputerCode); } else { @@ -293,6 +298,8 @@ private void WriteAlias() else if (indvData.PointCode == "NA") { // Do nothing here but not Continue??? + // TODO - What do we do here? + // DEBUG } else { From 210f83e1bc7649838c9fe00c11739731d0642663 Mon Sep 17 00:00:00 2001 From: Nikolas <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 3 Aug 2021 16:41:33 -0600 Subject: [PATCH 22/25] Working Solution for #113 This code creates commands for charts even when there is no FAA Computer Code. There are minimal duplicate commands created due to this. Format for these procedures are first 5 characters not including any spaces. Example: TNX - DP - TUMBE ONE would be .TMXTUMBEC Example: GTB - DP - WATERTOWN TWO would be .GTBWATERC Example: TTD - DP - BLUE LAKE THREE would be .TDDBLUELC --- ClassData/DataAccess/GetFaaMetaFileData.cs | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/ClassData/DataAccess/GetFaaMetaFileData.cs b/ClassData/DataAccess/GetFaaMetaFileData.cs index af568eec..da2fe03a 100644 --- a/ClassData/DataAccess/GetFaaMetaFileData.cs +++ b/ClassData/DataAccess/GetFaaMetaFileData.cs @@ -68,18 +68,33 @@ private void ParseMetaFile() AmdtDate = recordData.Element("amdtdate").Value }; - // TODO - Check for Empty FAANFD18 Number - if (string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "STAR") + if ((string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "DP") || (string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "STAR")) { - // DEBUG - record.Faanfd18 = apt.AptIdent + "." + apt.AptIdent + "?"; - } + string newFaanfd18 = ""; - // TODO - Check for Empty FAANFD18 Number - if (string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "DP") - { - // DEBUG - record.Faanfd18 = apt.AptIdent + "?." + apt.AptIdent; + if (record.ChartName.Trim().Replace(" ", string.Empty).Length <= 5) + { + // This apears to be redundant check. As chart name Trimed and No spaces will always be greater than 5 Chars. + newFaanfd18 = record.ChartName.Trim().Replace(" ", string.Empty); + } + else + { + newFaanfd18 = record.ChartName.Trim().Replace(" ", string.Empty).Substring(0, 5); + } + + newFaanfd18 += "?"; + + if (record.ChartCode == "DP") + { + record.Faanfd18 = newFaanfd18 + "." + apt.AptIdent; + } + else + { + record.Faanfd18 = apt.AptIdent + "." + newFaanfd18; + } + + // TODO - DEBUG + Console.WriteLine(apt.AptIdent + " - " + record.ChartCode + " - " + record.ChartSeq + " - " + record.ChartName); } if ( From 74e8cc202aae941221308966e622dc33ac3afe1f Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 3 Aug 2021 17:53:38 -0600 Subject: [PATCH 23/25] Get Vatsim Wx Stations This may lead to WX stations not being included if the WX Stations are not on the Vatism Metar website. We might have to go back to the original way of doing things. #104 --- ClassData/DataAccess/GetAptData.cs | 10 +++++++++- ClassData/GlobalConfig.cs | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index e0a19005..762a48c9 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -248,7 +248,15 @@ private void ParseAndWriteWxStation(string effectiveDate) if (sList.Contains(id, StringComparer.OrdinalIgnoreCase) || lList.Contains(id, StringComparer.OrdinalIgnoreCase)) { - sb.AppendLine(final); + foreach (string vatsimWXLine in File.ReadLines($"{GlobalConfig.tempPath}\\{effectiveDate}_WX-VATSIM.txt")) + { + if (vatsimWXLine.Substring(0, 5).Trim() == apt.Icao) + { + sb.AppendLine(final); + Console.WriteLine($"Added weather station for {id}"); + break; + } + } } else { diff --git a/ClassData/GlobalConfig.cs b/ClassData/GlobalConfig.cs index 528c71dd..4ab5b021 100644 --- a/ClassData/GlobalConfig.cs +++ b/ClassData/GlobalConfig.cs @@ -157,7 +157,8 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo { $"{effectiveDate}_FIX.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/FIX.zip" }, { $"{effectiveDate}_NAV.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/NAV.zip"}, { $"{airacCycle}_TELEPHONY.html", $"https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/chap3_section_2.html" }, - { $"{effectiveDate}_WX-CROSSCHECK.xml", $"https://w1.weather.gov/xml/current_obs/index.xml" } + { $"{effectiveDate}_WX-CROSSCHECK.xml", $"https://w1.weather.gov/xml/current_obs/index.xml" }, + { $"{effectiveDate}_WX-VATSIM.txt", $"http://metar.vatsim.net/metar.php?id=all" } }; } else @@ -194,7 +195,8 @@ public static void DownloadAllFiles(string effectiveDate, string airacCycle, boo { $"{effectiveDate}_FIX.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/FIX.zip" }, { $"{effectiveDate}_NAV.zip", $"https://nfdc.faa.gov/webContent/28DaySub/{effectiveDate}/NAV.zip"}, { $"{airacCycle}_TELEPHONY.html", $"https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/chap3_section_2.html" }, - { $"{effectiveDate}_WX-CROSSCHECK.xml", $"https://w1.weather.gov/xml/current_obs/index.xml" } + { $"{effectiveDate}_WX-CROSSCHECK.xml", $"https://w1.weather.gov/xml/current_obs/index.xml" }, + { $"{effectiveDate}_WX-VATSIM.txt", $"http://metar.vatsim.net/metar.php?id=all" } }; } From 303fb93ebe204b85e82ad8c2a9747b2132b5efbb Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 3 Aug 2021 18:03:36 -0600 Subject: [PATCH 24/25] Ready for release 0.8.1 --- ChangeLog.md | 12 ++++++++++++ ClassData/DataAccess/GetAptData.cs | 2 +- ClassData/DataAccess/GetFaaMetaFileData.cs | 4 +--- ClassData/DataAccess/GetStarDpData.cs | 9 --------- ReleaseTemplate.txt | 10 +++++++--- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8db3d5b7..65726c3e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,18 @@ ## Pre-V1.0.0 --- +- ## Version 0.8.1 + - Change log on Update question will display all changes from user version and up to the latest release. + - FAQ button added. This will take you to a Facts And Questions google slide. + - Choosing AIRAC cycle phrase/question changed. + - Fixed bug where program crashes if the user is not connected to the internet. + - Fixed bug where program states it's complete when it really is not. This happened when a file download failed. + - Fixed Credit screen title. + - New Functionality to FAA Chart Recal Commands + - Charts without computer codes will be generated with the first 5 characters (not including spaces) of the chart name. + - Gather WX Station data from Vatsim + - This may cause issues, if so please report in issues section on github. + - ## Version 0.8.0 - Fixed Bug #98 META File Causing Crash: - If Meta File is not available, NASR2SCT will put a WARN-README.txt file in output directory. diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index 762a48c9..bb9ad9b2 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -253,7 +253,7 @@ private void ParseAndWriteWxStation(string effectiveDate) if (vatsimWXLine.Substring(0, 5).Trim() == apt.Icao) { sb.AppendLine(final); - Console.WriteLine($"Added weather station for {id}"); + //Console.WriteLine($"Added weather station for {id}"); break; } } diff --git a/ClassData/DataAccess/GetFaaMetaFileData.cs b/ClassData/DataAccess/GetFaaMetaFileData.cs index da2fe03a..22b2f83f 100644 --- a/ClassData/DataAccess/GetFaaMetaFileData.cs +++ b/ClassData/DataAccess/GetFaaMetaFileData.cs @@ -92,9 +92,7 @@ private void ParseMetaFile() { record.Faanfd18 = apt.AptIdent + "." + newFaanfd18; } - - // TODO - DEBUG - Console.WriteLine(apt.AptIdent + " - " + record.ChartCode + " - " + record.ChartSeq + " - " + record.ChartName); + //Console.WriteLine(apt.AptIdent + " - " + record.ChartCode + " - " + record.ChartSeq + " - " + record.ChartName); } if ( diff --git a/ClassData/DataAccess/GetStarDpData.cs b/ClassData/DataAccess/GetStarDpData.cs index 20a9368e..d89257a5 100644 --- a/ClassData/DataAccess/GetStarDpData.cs +++ b/ClassData/DataAccess/GetStarDpData.cs @@ -42,7 +42,6 @@ private void ParseStarDp(string effectiveDate) SeqNumber = line.Substring(1, 4).Trim(), PointCode = line.Substring(10, 2).Trim(), PointId = line.Substring(30, 6).Trim(), - // TODO - NOT Assigned Computer Code - Need to handle this? ComputerCode = line.Substring(38, 13).Trim(), Lat_N_S = line.Substring(13, 1).Trim(), Lat_Deg = "0" + line.Substring(14, 2).Trim(), @@ -175,12 +174,6 @@ private void WriteAlias() if (procedures[procSeqNumber][0].ComputerCode.IndexOf("NOT ASSIGNED") != -1) { - // TODO - I think this is where the non generated computer codes are being skipped. - // DEBUG - Remove this Console.writeline. - // Console.WriteLine(procedures[procSeqNumber][0].PointId + " - Seq: " + procedures[procSeqNumber][0].SeqNumber); - // Console.WriteLine("C: " + procedures[procSeqNumber][0].PointId); - //currentComputerCode = procedures[procSeqNumber][0].PointId; - //procedures[procSeqNumber][0].PointCode = "AA"; continue; } else if (procedures[procSeqNumber][0].Type == "S") @@ -298,8 +291,6 @@ private void WriteAlias() else if (indvData.PointCode == "NA") { // Do nothing here but not Continue??? - // TODO - What do we do here? - // DEBUG } else { diff --git a/ReleaseTemplate.txt b/ReleaseTemplate.txt index 07739b35..06a81f07 100644 --- a/ReleaseTemplate.txt +++ b/ReleaseTemplate.txt @@ -1,9 +1,9 @@ -0.8.0 +0.8.1 -Release Candidate V-0.8.0 +Release Candidate V-0.8.1 ## Instructions to install: -1. Download the zip file named "NASR2SCT-0.7.9.zip" +1. Download the zip file named "NASR2SCT-0.8.1.zip" 2. Unzip the file 3. Keep all files inside it together. 4. Run the Setup.exe @@ -15,3 +15,7 @@ Release Candidate V-0.8.0 - Fixed bug where program crashes if the user is not connected to the internet. - Fixed bug where program states it's complete when it really is not. This happened when a file download failed. - Fixed Credit screen title. +- New Functionality to FAA Chart Recal Commands + - Charts without computer codes will be generated with the first 5 characters (not including spaces) of the chart name. +- Gather WX Station data from Vatsim + - This may cause issues, if so please report in issues section on github. From cf06e835cdb6f60f5392be12f8d73859ab711a6d Mon Sep 17 00:00:00 2001 From: Nikolia558 <38259407+Nikolai558@users.noreply.github.com> Date: Tue, 3 Aug 2021 18:13:35 -0600 Subject: [PATCH 25/25] Ready for Release --- .../squirrel.windows.2.0.1/tools/Squirrel-Releasify.log | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/squirrel.windows.2.0.1/tools/Squirrel-Releasify.log b/packages/squirrel.windows.2.0.1/tools/Squirrel-Releasify.log index 6205f6fc..6f6b2946 100644 --- a/packages/squirrel.windows.2.0.1/tools/Squirrel-Releasify.log +++ b/packages/squirrel.windows.2.0.1/tools/Squirrel-Releasify.log @@ -7,3 +7,12 @@ [03/06/21 10:48:37] info: ReleasePackage: No release notes found in C:\Users\Pocono Coast West\AppData\Local\SquirrelTemp\tempc\NASR2SCT.nuspec [03/06/21 10:48:38] info: Program: Building embedded zip file for Setup.exe [03/06/21 10:48:42] info: Program: Finished Squirrel Updater +[03/08/21 18:11:03] info: Program: Starting Squirrel Updater: --releasify NASR2SCT.0.8.1.nupkg +[03/08/21 18:11:03] info: Program: Bootstrapper EXE found at:C:\Repos\NASR2SCT\packages\squirrel.windows.2.0.1\tools\Setup.exe +[03/08/21 18:11:03] info: Program: Creating release package: C:\Repos\NASR2SCT\Releases\NASR2SCT.0.8.1.nupkg +[03/08/21 18:11:04] info: ReleasePackage: Creating release package: C:\Repos\NASR2SCT\Releases\NASR2SCT.0.8.1.nupkg => C:\Repos\NASR2SCT\Releases\NASR2SCT-0.8.1-full.nupkg +[03/08/21 18:11:04] info: ReleasePackage: Extracting dependent packages: [] +[03/08/21 18:11:04] info: ReleasePackage: Removing unnecessary data +[03/08/21 18:11:04] info: ReleasePackage: No release notes found in C:\Users\nikol\AppData\Local\SquirrelTemp\tempa\NASR2SCT.nuspec +[03/08/21 18:11:06] info: Program: Building embedded zip file for Setup.exe +[03/08/21 18:11:11] info: Program: Finished Squirrel Updater