diff --git a/ChangeLog.md b/ChangeLog.md index 81d7d4ac..65726c3e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,20 +1,31 @@ ## 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. -- 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 diff --git a/ClassData/DataAccess/GetAptData.cs b/ClassData/DataAccess/GetAptData.cs index 08ff50c5..bb9ad9b2 100644 --- a/ClassData/DataAccess/GetAptData.cs +++ b/ClassData/DataAccess/GetAptData.cs @@ -6,8 +6,12 @@ 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.Linq; using System.Xml.Serialization; namespace ClassData.DataAccess @@ -195,14 +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"; - + StringBuilder sb = new StringBuilder(); sb.AppendLine("[LABELS]"); + // 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; - string final; + string final; + + // 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(); + 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")) { @@ -230,7 +246,24 @@ 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"; - sb.AppendLine(final); + if (sList.Contains(id, StringComparer.OrdinalIgnoreCase) || lList.Contains(id, StringComparer.OrdinalIgnoreCase)) + { + 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 + { + // Do nothing here. This is Debuging only. WX STATION + // debugSB.AppendLine(final); + } + break; } } @@ -238,6 +271,7 @@ private void ParseAndWriteWxStation(string effectiveDate) } } } + // File.WriteAllText(debugfilepath, debugSB.ToString()); File.WriteAllText(filepath, sb.ToString()); File.AppendAllText(filepath, $"\n\n\n\n\n\n"); diff --git a/ClassData/DataAccess/GetFaaMetaFileData.cs b/ClassData/DataAccess/GetFaaMetaFileData.cs index 31d15e4e..22b2f83f 100644 --- a/ClassData/DataAccess/GetFaaMetaFileData.cs +++ b/ClassData/DataAccess/GetFaaMetaFileData.cs @@ -67,12 +67,33 @@ 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 = ""; - //} + if ((string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "DP") || (string.IsNullOrEmpty(record.Faanfd18) && record.ChartCode == "STAR")) + { + string newFaanfd18 = ""; + + 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; + } + //Console.WriteLine(apt.AptIdent + " - " + record.ChartCode + " - " + record.ChartSeq + " - " + record.ChartName); + } if ( record.ChartName.IndexOf("CONVERGING") == -1 && diff --git a/ClassData/DataAccess/GetStarDpData.cs b/ClassData/DataAccess/GetStarDpData.cs index 84a64ac6..d89257a5 100644 --- a/ClassData/DataAccess/GetStarDpData.cs +++ b/ClassData/DataAccess/GetStarDpData.cs @@ -174,16 +174,17 @@ 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. 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 { 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 a75dc318..4ab5b021 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 = ""; @@ -156,7 +156,9 @@ 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" }, + { $"{effectiveDate}_WX-VATSIM.txt", $"http://metar.vatsim.net/metar.php?id=all" } }; } else @@ -192,7 +194,9 @@ 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" }, + { $"{effectiveDate}_WX-VATSIM.txt", $"http://metar.vatsim.net/metar.php?id=all" } }; } @@ -203,15 +207,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 + { + 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) { - client.DownloadFile(allURLs[fileName], $"{tempPath}\\{fileName}"); - DownloadedFilePaths.Add($"{tempPath}\\{fileName}"); + 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}"); } } } @@ -561,20 +574,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; @@ -594,9 +607,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) { 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/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(); diff --git a/NASR_GUI/MainForm.Designer.cs b/NASR_GUI/MainForm.Designer.cs index 3beefbd7..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(); @@ -94,14 +95,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 // @@ -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..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); @@ -505,6 +503,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); @@ -640,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); } } @@ -682,5 +647,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"); + } } } 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/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(); diff --git a/NASR_GUI/Properties/AssemblyInfo.cs b/NASR_GUI/Properties/AssemblyInfo.cs index 6d82141b..ef5e02de 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("")] @@ -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")] diff --git a/README.md b/README.md index 08a9c488..c68d9f23 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) @@ -20,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) diff --git a/ReleaseTemplate.txt b/ReleaseTemplate.txt index 017360d6..06a81f07 100644 --- a/ReleaseTemplate.txt +++ b/ReleaseTemplate.txt @@ -1,12 +1,21 @@ -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 ## 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. +- 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. 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