Skip to content

Commit

Permalink
Merge pull request #25 from Nikolai558/development
Browse files Browse the repository at this point in the history
Ready for Release 1.0.2
  • Loading branch information
Nikolai558 authored Dec 21, 2021
2 parents 296d13d + eeb433f commit b8b04f6
Show file tree
Hide file tree
Showing 11 changed files with 291 additions and 141 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
- ## Version 1.0.2
- In the Publications Output, if a procedure is Added (A) or Deleted (D), the link is NOT generated and instead will display a quick explanation. #20
- Restructured Menu Buttons
- New Menu button for "Reporting Issues" #23
- Fixed Bug #22 - Menu Fonts Changing Randomly
- Fixed Bug #19 - Clearing the FAC ID field
- Fixed Bug #21 - Browser not opening on Menu Button click

- ## Version 1.0.1
- The Main Window has a background image instead of a solid color.
- Changed the Update view background colors to match new main window colors.
Expand Down
8 changes: 7 additions & 1 deletion FeBuddyLibrary/DataAccess/GetFaaMetaFileData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FeBuddyLibrary.Models.MetaFileModels;
using FeBuddyLibrary.Helpers;
using FeBuddyLibrary.Models.MetaFileModels;
using System.Collections.Generic;
using System.IO;
using System.Text;
Expand All @@ -12,7 +13,12 @@ public class GetFaaMetaFileData

public void QuarterbackFunc()
{
Logger.LogMessage("DEBUG", $"STARTING META FILE PARSING");

ParseMetaFile();

Logger.LogMessage("DEBUG", $"COMPLETED META FILE PARSING");

}

private void ParseMetaFile()
Expand Down
68 changes: 65 additions & 3 deletions FeBuddyLibrary/DataAccess/PublicationParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FeBuddyLibrary.Models;
using FeBuddyLibrary.Helpers;
using FeBuddyLibrary.Models;
using FeBuddyLibrary.Models.MetaFileModels;
using System;
using System.Collections.Generic;
Expand All @@ -15,12 +16,16 @@ public class PublicationParser

public void WriteAirportInfoTxt(string responsibleArtcc)
{
Logger.LogMessage("INFO", "STARTING PUBLICATION PARSER");

StringBuilder airportInArtccInfo = new StringBuilder();
StringBuilder airportProcedureChanges = new StringBuilder();
StringBuilder airportProcedures = new StringBuilder();

if (responsibleArtcc == "FAA")
{
Logger.LogMessage("DEBUG", "RESPONSIBLE ARTCC IS FAA");

foreach (string artcc in allArtcc)
{
if (artcc == "FAA")
Expand Down Expand Up @@ -74,7 +79,20 @@ public void WriteAirportInfoTxt(string responsibleArtcc)
{
if (recordModel1.UserAction != "" && recordModel1.UserAction != " ")
{
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | https://aeronav.faa.gov/d-tpp/{AiracDateCycleModel.AllCycleDates[GlobalConfig.airacEffectiveDate]}/compare_pdf/{recordModel1.PdfName.Substring(0, recordModel1.PdfName.Length - 4)}_cmp.pdf");
if (recordModel1.UserAction == "A")
{
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | This procedure is new and has no previous version to compare.");
}
else if (recordModel1.UserAction == "D")
{
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | This procedure has been deleted this AIRAC.");
}
else
{
string link = $"https://aeronav.faa.gov/d-tpp/{AiracDateCycleModel.AllCycleDates[GlobalConfig.airacEffectiveDate]}/compare_pdf/{recordModel1.PdfName.Substring(0, recordModel1.PdfName.Length - 4)}_cmp.pdf";
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | {link}");

}
}
}
}
Expand All @@ -87,11 +105,23 @@ public void WriteAirportInfoTxt(string responsibleArtcc)

string ProcedureChangefilePath = $"{outputDirectory}\\{artcc}_{AiracDateCycleModel.AllCycleDates[GlobalConfig.airacEffectiveDate]}\\Procedure_Changes.txt";
CreateDirAndFile(ProcedureChangefilePath);

if (airportProcedureChanges.Length > 1)
{
airportProcedureChanges.Insert(0, "\n\n\nIn some cases, the link will return a 404 Error. This is because the FAA does not have a comparative document. This is common with DOD facilities.\n\n\n");
}
else
{
airportProcedureChanges.AppendLine("\n\n\nNo Changes this AIRAC\n\n\n");
}

File.WriteAllText(ProcedureChangefilePath, airportProcedureChanges.ToString());
}
}
else if (allArtcc.Contains(responsibleArtcc))
{
Logger.LogMessage("DEBUG", $"RESPONSIBLE ARTCC IS {responsibleArtcc}");

foreach (AptModel airport in GlobalConfig.allAptModelsForCheck)
{
if (airport.ResArtcc == responsibleArtcc)
Expand Down Expand Up @@ -134,7 +164,20 @@ public void WriteAirportInfoTxt(string responsibleArtcc)
{
if (recordModel1.UserAction != "" && recordModel1.UserAction != " ")
{
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | https://aeronav.faa.gov/d-tpp/{AiracDateCycleModel.AllCycleDates[GlobalConfig.airacEffectiveDate]}/compare_pdf/{recordModel1.PdfName.Substring(0, recordModel1.PdfName.Length - 4)}_cmp.pdf");
if (recordModel1.UserAction == "A")
{
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | This procedure is new and has no previous version to compare.");
}
else if (recordModel1.UserAction == "D")
{
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | This procedure has been deleted this AIRAC.");
}
else
{
string link = $"https://aeronav.faa.gov/d-tpp/{AiracDateCycleModel.AllCycleDates[GlobalConfig.airacEffectiveDate]}/compare_pdf/{recordModel1.PdfName.Substring(0, recordModel1.PdfName.Length - 4)}_cmp.pdf";
airportProcedureChanges.AppendLine($"\t({recordModel1.UserAction}) {recordModel1.ChartName} | {link}");

}
}
}
}
Expand All @@ -148,12 +191,25 @@ public void WriteAirportInfoTxt(string responsibleArtcc)

string ProcedureChangefilePath = $"{outputDirectory}\\{responsibleArtcc}_{AiracDateCycleModel.AllCycleDates[GlobalConfig.airacEffectiveDate]}\\Procedure_Changes.txt";
CreateDirAndFile(ProcedureChangefilePath);

if (airportProcedureChanges.Length > 1)
{
airportProcedureChanges.Insert(0, "\n\n\nIn some cases, the link will return a 404 Error. This is because the FAA does not have a comparative document. This is common with DOD facilities.\n\n\n");
}
else
{
airportProcedureChanges.AppendLine("\n\n\nNo Changes this AIRAC\n\n\n");
}
File.WriteAllText(ProcedureChangefilePath, airportProcedureChanges.ToString());
}
else
{
Logger.LogMessage("ERROR", $"RESPONSIBLE ARTCC IS NOT VALID! NEW EXCEPTION THROWN, THIS CAUSED CRASH.");

throw new NotImplementedException();
}
Logger.LogMessage("INFO", "COMPLETED PUBLICATION PARSER");

}

/// <summary>
Expand All @@ -162,13 +218,19 @@ public void WriteAirportInfoTxt(string responsibleArtcc)
/// <param name="fullFilePath">Full File Path</param>
private void CreateDirAndFile(string fullFilePath)
{
Logger.LogMessage("DEBUG", $"TRYING TO CREATE {fullFilePath}");

if (!Directory.Exists(fullFilePath.Substring(0, fullFilePath.LastIndexOf('\\'))))
{
Logger.LogMessage("DEBUG", $"DIRECTORY DOES NOT EXIST, CREATING DIRECTORY FOR {fullFilePath}");

Directory.CreateDirectory(fullFilePath.Substring(0, fullFilePath.LastIndexOf('\\')));
}

if (!File.Exists(fullFilePath))
{
Logger.LogMessage("WARNING", $"FILE ALREADY EXITS FOR {fullFilePath}");

//File.Create(fullFilePath);
}
}
Expand Down
2 changes: 1 addition & 1 deletion FeBuddyLibrary/GlobalConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace FeBuddyLibrary
{
public class GlobalConfig
{
public static readonly string ProgramVersion = "1.0.1";
public static readonly string ProgramVersion = "1.0.2";

public static string GithubVersion = "";

Expand Down
3 changes: 2 additions & 1 deletion FeBuddyLibrary/Helpers/BatchFileHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ public static void ExecuteCurlBatchFile(string batchFileName)
CreateNoWindow = true,
UseShellExecute = false
};

Process = Process.Start(ProcessInfo);
Process.WaitForExit();
_ = Process.ExitCode;

Process.Close();
}
Expand Down
2 changes: 1 addition & 1 deletion FeBuddyLibrary/Helpers/WebHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static bool GetMetaUrlResponse()
}
}

public static void UpdateCheck()
public static void UpdateCheck()
{
Logger.LogMessage("DEBUG", "PREFORMING UPDATE CHECK");

Expand Down
4 changes: 2 additions & 2 deletions FeBuddyWinFormUI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,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("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyFileVersion("1.0.2")]
Loading

0 comments on commit b8b04f6

Please sign in to comment.