Skip to content

Commit

Permalink
Merge pull request #17 from Nikolai558/development
Browse files Browse the repository at this point in the history
Releasing 1.0.1
  • Loading branch information
Nikolai558 authored Nov 28, 2021
2 parents 5144c61 + 56137b3 commit 296d13d
Show file tree
Hide file tree
Showing 45 changed files with 1,493 additions and 1,269 deletions.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: TODO
about: Create a "TODO" item to remind the team of tasks that need to be completed.
title: "[TODO] -"
labels: TODO
assignees: Nikolai558

---

**Describe the "TODO"**


**Screenshots**
If applicable, add screenshots to help explain the "TODO".
62 changes: 62 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
workflow_dispatch:
push:
branches: [ development, releases ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ development ]
schedule:
- cron: '0 8 * * 1'

jobs:
analyze:
name: Analyze
runs-on: windows-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
---
- ## 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.
- "Start" and "Exit" Buttons display a different color when clicking them.
- The color of the Hover state of all buttons has changed.
- Implemented a simple Logger.
- This log file will be included in the output folder.
- Misc. code clean-up and function design changes.

- ## Version 1.0.0
- New Github Repository
- Name changed from "NASR2SCT" to "FE-BUDDY".
Expand Down
95 changes: 75 additions & 20 deletions FeBuddyLibrary/DataAccess/GetAptData.cs

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions FeBuddyLibrary/DataAccess/GetArbData.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 System;
using System.Collections.Generic;
using System.IO;
Expand All @@ -18,8 +19,12 @@ public class GetArbData
/// <param name="effectiveDate">Airacc Effective Date (e.x. "2021-10-07")</param>
public void ArbMain(string effectiveDate)
{
Logger.LogMessage("INFO", "STARTED ARB");

ParseArb(effectiveDate);
WriteArbSct();
Logger.LogMessage("INFO", "COMPLETED ARB");

}

/// <summary>
Expand All @@ -28,15 +33,17 @@ public void ArbMain(string effectiveDate)
/// <param name="effectiveDate">Airacc Effective Date (e.x. "2021-10-07")</param>
private void ParseArb(string effectiveDate)
{
Logger.LogMessage("INFO", "STARTED ARB PARSING");

foreach (string line in File.ReadAllLines($"{GlobalConfig.tempPath}\\{effectiveDate}_ARB\\ARB.txt"))
{
ArbModel arb = new ArbModel
{
Identifier = line.Substring(0, 4).Trim(),
CenterName = line.Substring(12, 40).Trim(),
DecodeName = line.Substring(52, 10).Trim(),
Lat = GlobalConfig.CorrectLatLon(line.Substring(62, 14).Trim(), true, GlobalConfig.Convert),
Lon = GlobalConfig.CorrectLatLon(line.Substring(76, 14).Trim(), false, GlobalConfig.Convert),
Lat = LatLonHelpers.CorrectLatLon(line.Substring(62, 14).Trim(), true, GlobalConfig.Convert),
Lon = LatLonHelpers.CorrectLatLon(line.Substring(76, 14).Trim(), false, GlobalConfig.Convert),
Description = line.Substring(90, 300).Trim(),
Sequence = line.Substring(390, 6).Trim(),
Legal = line.Substring(396, 1).Trim()
Expand Down Expand Up @@ -88,13 +95,17 @@ private void ParseArb(string effectiveDate)
allBoundaries.Add(Boundary);
}
}
Logger.LogMessage("INFO", "COMPLETED ARB PARSING");

}

/// <summary>
/// Write our ARB Sector Files for VRC. Will create both HIGH and LOW .sct2 Files.
/// </summary>
private void WriteArbSct()
{
Logger.LogMessage("INFO", "STARTED ARB SAVING SCT DATA");

// HIGH ARTCC = HIGH, FIR_ONLY, UTA
// LOW ARTCC = LOW, CTA, BDRY

Expand Down Expand Up @@ -142,8 +153,15 @@ private void WriteArbSct()

File.WriteAllText(highFilePath, highArb.ToString());
File.WriteAllText(lowFilePath, lowArb.ToString());
Logger.LogMessage("DEBUG", "SAVED HIGH AND LOW ARB SCT FILES");

File.AppendAllText($"{GlobalConfig.outputDirectory}\\{GlobalConfig.testSectorFileName}", File.ReadAllText(highFilePath));
File.AppendAllText($"{GlobalConfig.outputDirectory}\\{GlobalConfig.testSectorFileName}", File.ReadAllText(lowFilePath));
Logger.LogMessage("DEBUG", "ADDING TO TEST SCT FILE");


Logger.LogMessage("INFO", "COMPLETED ARB SAVING SCT DATA");

}
}
}
29 changes: 24 additions & 5 deletions FeBuddyLibrary/DataAccess/GetAtsAwyData.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 System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -21,16 +22,22 @@ public class GetAtsAwyData
/// <param name="effectiveDate">Format: YYYY-MM-DD</param>
public void AWYQuarterbackFunc(string effectiveDate)
{
Logger.LogMessage("INFO", "STARTED AWY");

ParseAtsData(effectiveDate);
WriteAwySctData();
WriteAwyAlias();
Logger.LogMessage("INFO", "COMPLETED AWY");

}

/// <summary>
/// Parse the ATS Data from the FAA
/// </summary>
private void ParseAtsData(string effectiveDate)
{
Logger.LogMessage("INFO", "STARTED AWY PARSING");

atsAwyPointModel atsPoint = new atsAwyPointModel();

foreach (string line in File.ReadAllLines($"{GlobalConfig.tempPath}\\{effectiveDate}_ATS\\ATS.txt"))
Expand Down Expand Up @@ -70,10 +77,10 @@ private void ParseAtsData(string effectiveDate)


atsPoint.Name = line.Substring(25, 40).Trim();
atsPoint.Lat = GlobalConfig.CorrectLatLon(line.Substring(109, 14).Trim(), true, GlobalConfig.Convert);
atsPoint.Lon = GlobalConfig.CorrectLatLon(line.Substring(123, 14).Trim(), false, GlobalConfig.Convert);
atsPoint.Dec_Lat = GlobalConfig.CreateDecFormat(atsPoint.Lat, true);
atsPoint.Dec_Lon = GlobalConfig.CreateDecFormat(atsPoint.Lon, true);
atsPoint.Lat = LatLonHelpers.CorrectLatLon(line.Substring(109, 14).Trim(), true, GlobalConfig.Convert);
atsPoint.Lon = LatLonHelpers.CorrectLatLon(line.Substring(123, 14).Trim(), false, GlobalConfig.Convert);
atsPoint.Dec_Lat = LatLonHelpers.CreateDecFormat(atsPoint.Lat, true);
atsPoint.Dec_Lon = LatLonHelpers.CreateDecFormat(atsPoint.Lon, true);

if (line.Substring(65, 25).Trim() == "NDB")
{
Expand Down Expand Up @@ -131,10 +138,14 @@ private void ParseAtsData(string effectiveDate)
allAtsAwy.Add(atsAwy);
}
}
Logger.LogMessage("INFO", "COMPLETED AWY PARSING");

}

private void WriteAwyAlias()
{
Logger.LogMessage("INFO", "STARTED AWY ALIAS");

foreach (atsAwyPointModel pointModel in allAtsAwyPoints)
{

Expand All @@ -159,6 +170,7 @@ private void WriteAwyAlias()

File.AppendAllText(awyAliasFilePath, sb.ToString());
File.AppendAllText($"{GlobalConfig.outputDirectory}\\ALIAS\\AliasTestFile.txt", sb.ToString());
Logger.LogMessage("INFO", "COMPLTED AWY ALIAS");

}

Expand All @@ -167,6 +179,8 @@ private void WriteAwyAlias()
/// </summary>
private void WriteAwySctData()
{
Logger.LogMessage("INFO", "STARTED AWY SCT WRITER");

// Set our File Path
string filePath = $"{GlobalConfig.outputDirectory}\\VRC\\[LOW AIRWAY].sct2";

Expand Down Expand Up @@ -206,7 +220,12 @@ private void WriteAwySctData()
}
File.WriteAllText(filePath, sb.ToString());
File.AppendAllText(filePath, $"\n\n\n\n\n\n");
Logger.LogMessage("DEBUG", "SAVED AWY SCT FILE");

File.AppendAllText($"{GlobalConfig.outputDirectory}\\{GlobalConfig.testSectorFileName}", File.ReadAllText(filePath));
Logger.LogMessage("DEBUG", "ADDED AWY TO TEST SCT FILE");
Logger.LogMessage("INFO", "COMPLETED AWY SCT WRITER");

}
}
}
29 changes: 24 additions & 5 deletions FeBuddyLibrary/DataAccess/GetAwyData.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 System.Collections.Generic;
using System.IO;
using System.Text;
Expand All @@ -20,6 +21,8 @@ public class GetAwyData
/// <param name="effectiveDate">Format: YYYY-MM-DD</param>
public void AWYQuarterbackFunc(string effectiveDate)
{
Logger.LogMessage("INFO", "STARTED AWY");

ParseAwyData(effectiveDate);
WriteAwySctData();
WriteAwyAlias();
Expand All @@ -30,6 +33,8 @@ public void AWYQuarterbackFunc(string effectiveDate)
/// </summary>
private void ParseAwyData(string effectiveDate)
{
Logger.LogMessage("INFO", "STARTED AWY PARSING");

// Create our AWY point Model
AwyPointModel awyPoint = new AwyPointModel();

Expand Down Expand Up @@ -90,12 +95,12 @@ private void ParseAwyData(string effectiveDate)
if (awyPoint.Name.IndexOf("BORDER", 0, awyPoint.Name.Length) == -1)
{
// Set the Lat Lon
awyPoint.Lat = GlobalConfig.CorrectLatLon(line.Substring(83, 14).Trim(), true, GlobalConfig.Convert);
awyPoint.Lon = GlobalConfig.CorrectLatLon(line.Substring(97, 14).Trim(), false, GlobalConfig.Convert);
awyPoint.Lat = LatLonHelpers.CorrectLatLon(line.Substring(83, 14).Trim(), true, GlobalConfig.Convert);
awyPoint.Lon = LatLonHelpers.CorrectLatLon(line.Substring(97, 14).Trim(), false, GlobalConfig.Convert);

// Set the Decimal Version of Lat and Lon
awyPoint.Dec_Lat = GlobalConfig.CreateDecFormat(awyPoint.Lat, true);
awyPoint.Dec_Lon = GlobalConfig.CreateDecFormat(awyPoint.Lon, true);
awyPoint.Dec_Lat = LatLonHelpers.CreateDecFormat(awyPoint.Lat, true);
awyPoint.Dec_Lon = LatLonHelpers.CreateDecFormat(awyPoint.Lon, true);

// Add this point to our List
allAWYPoints.Add(awyPoint);
Expand Down Expand Up @@ -145,10 +150,14 @@ private void ParseAwyData(string effectiveDate)
allAwy.Add(awy);
}
}
Logger.LogMessage("INFO", "COMPLETED AWY PARSING");

}

private void WriteAwyAlias()
{
Logger.LogMessage("INFO", "STARTED AWY ALIAS");

foreach (AwyPointModel pointModel in allAWYPoints)
{

Expand All @@ -174,6 +183,7 @@ private void WriteAwyAlias()
File.WriteAllText(awyAliasFilePath, sb.ToString());
File.AppendAllText($"{GlobalConfig.outputDirectory}\\ALIAS\\AliasTestFile.txt", sb.ToString());

Logger.LogMessage("INFO", "COMPLETED AWY ALIAS");
}


Expand All @@ -182,6 +192,8 @@ private void WriteAwyAlias()
/// </summary>
private void WriteAwySctData()
{
Logger.LogMessage("INFO", "STARTED AWY SCT FILE WRITER");

// Set our File Path
string filePath = $"{GlobalConfig.outputDirectory}\\VRC\\[HIGH AIRWAY].sct2";

Expand Down Expand Up @@ -241,9 +253,16 @@ private void WriteAwySctData()

// Add some blank lines at the end of the file.
File.AppendAllText(filePath, $"\n\n\n\n\n\n");
Logger.LogMessage("DEBUG", "SAVED AWY SCT FILE");


// Add the file to our Test Sector File.
File.AppendAllText($"{GlobalConfig.outputDirectory}\\{GlobalConfig.testSectorFileName}", File.ReadAllText(filePath));
Logger.LogMessage("DEBUG", "ADDED AWY TO TEST SCT FILE");


Logger.LogMessage("INFO", "COMPLETED AWY SCT FILE WRITER");

}
}
}
Loading

0 comments on commit 296d13d

Please sign in to comment.