Skip to content

Commit

Permalink
Forked MetarParserCore that fixes some parsing issues for when dewpoi…
Browse files Browse the repository at this point in the history
…nt is missing from tempeature in METAR.

Added README
  • Loading branch information
macsux committed Feb 23, 2023
1 parent ec50999 commit f1a7ad8
Show file tree
Hide file tree
Showing 58 changed files with 3,463 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gateway/Gateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="IdentityServer4" Version="4.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.2" />
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="2.2.0" />
<PackageReference Include="Yarp.ReverseProxy" Version="1.0.0" />
<PackageReference Include="Yarp.ReverseProxy" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 20 additions & 0 deletions MetarParserCore/Common/ParseRegex.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace MetarParserCore.Common
{
/// <summary>
/// Class of regex patterns for tokens parsing
/// </summary>
public class ParseRegex
{
#region Prevailing visibility

public static string VisibilityWholeNumber => @"^[1-2]{1}$";

public static string StatuteMilesVisibility => @"^M?(\d{1}\/\d{1,2}|\d{1,2})SM$";

public static string MetersVisibility => @"^\d{4}(N|S)?(E|W)?$";

public static string MetersVisibilityContainsDirections = @"^\d{4}(N|S|E|W){1,2}$";

#endregion
}
}
21 changes: 21 additions & 0 deletions MetarParserCore/Enums/AltimeterUnitType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// Altimeter types
/// </summary>
public enum AltimeterUnitType
{
/// <summary>
/// Not specified
/// </summary>
None = 0,

[Description("Q")]
Hectopascal = 1,

[Description("A")]
InchesOfMercury = 2
}
}
69 changes: 69 additions & 0 deletions MetarParserCore/Enums/CloudType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// Enum of cloud types
/// </summary>
public enum CloudType
{
/// <summary>
/// Not specified
/// </summary>
None = 0,

/// <summary>
/// Sky clear - No cloud present
/// </summary>
[Description("SKC")]
SkyClear = 1,

/// <summary>
/// Few - 1-2 oktas
/// </summary>
[Description("FEW")]
Few = 2,

/// <summary>
/// Scattered - 3-4 oktas
/// </summary>
[Description("SCT")]
Scattered = 3,

/// <summary>
/// Broken - 5-7 oktas
/// </summary>
[Description("BKN")]
Broken = 4,

/// <summary>
/// Overcast - 8 oktas
/// </summary>
[Description("OVC")]
Overcast = 5,

/// <summary>
/// Vertical visibility - indefinite ceiling
/// </summary>
[Description("VV")]
VerticalVisibility = 6,

/// <summary>
/// Clear below 10,000 ft as interpreted by an autostation
/// </summary>
[Description("CLR")]
Clear = 7,

/// <summary>
/// No significant clouds - clouds present at and above 5,000 ft
/// </summary>
[Description("NSC")]
NoSignificantClouds = 8,

/// <summary>
/// No cloud detected
/// </summary>
[Description("NCD")]
NoCloudDetected = 9
}
}
21 changes: 21 additions & 0 deletions MetarParserCore/Enums/ConvectiveCloudType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// Convective cloud types
/// </summary>
public enum ConvectiveCloudType
{
/// <summary>
/// Not specified
/// </summary>
None = 0,

[Description("CB")]
Cumulonimbus = 1,

[Description("TCU")]
ToweringCumulus = 2,
}
}
25 changes: 25 additions & 0 deletions MetarParserCore/Enums/MeasurableBound.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// Enum of marks indicating that a value is outside the bounds of measurement
/// </summary>
public enum MeasurableBound
{
[Description("None")]
None = 0,

/// <summary>
/// Preceding the lowest measurable value
/// </summary>
[Description("M")]
Lower = 1,

/// <summary>
/// Preceding the highest measurable value
/// </summary>
[Description("P")]
Higher = 2
}
}
19 changes: 19 additions & 0 deletions MetarParserCore/Enums/MetarModifier.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// Types of METAR data
/// </summary>
public enum MetarModifier
{
[Description("None")]
None = 0,

[Description("AUTO")]
Auto = 1,

[Description("COR")]
Cor = 2
}
}
51 changes: 51 additions & 0 deletions MetarParserCore/Enums/MilitaryColorCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// Military color codes
/// </summary>
public enum MilitaryColorCode
{
/// <summary>
/// Unknown code
/// </summary>
Unknown = 0,

/// <summary>
/// Visibility is greater 5 mi, ceiling is greater 2500 ft
/// </summary>
[Description("BLU")]
Blue = 1,

/// <summary>
/// Visibility 3 3/8 - 5 mi, ceiling 1500 - 2500 ft
/// </summary>
[Description("WHT")]
White = 2,

/// <summary>
/// Visibility 2 1/4 - 3 - 1/8, ceiling > 700 - 1500 ft
/// </summary>
[Description("GRN")]
Green = 3,

/// <summary>
/// Visibility 1 1/8 - 2 - 1/4, ceiling > 300 - 700 ft
/// </summary>
[Description("YLO")]
Yellow = 4,

/// <summary>
/// Visibility 1/2 - 1 1/8 mi, ceiling 200 - 300 ft
/// </summary>
[Description("AMB")]
Amber = 5,

/// <summary>
/// Visibility less 1/2 mi, ceiling less 200 ft
/// </summary>
[Description("RED")]
Red = 6
}
}
46 changes: 46 additions & 0 deletions MetarParserCore/Enums/Month.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
public enum Month
{
[Description("None")]
None = 0,

[Description("January")]
January = 1,

[Description("February")]
February = 2,

[Description("March")]
March = 3,

[Description("April")]
April = 4,

[Description("May")]
May = 5,

[Description("June")]
June = 6,

[Description("July")]
July = 7,

[Description("August")]
August = 8,

[Description("September")]
September = 9,

[Description("October")]
October = 10,

[Description("November")]
November = 11,

[Description("December")]
December = 12
}
}
33 changes: 33 additions & 0 deletions MetarParserCore/Enums/MotneExtentOfContamination.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace MetarParserCore.Enums
{
/// <summary>
/// Extent of contamination types
/// </summary>
public enum MotneExtentOfContamination
{
/// <summary>
/// Not reported, marked as "/"
/// </summary>
NotReported = 0,

/// <summary>
/// 10% or less of runway covered
/// </summary>
Less10 = 1,

/// <summary>
/// 11% to 25% of runway covered
/// </summary>
From11To25 = 2,

/// <summary>
/// 26% to 50% of runway covered
/// </summary>
From26To50 = 5,

/// <summary>
/// 51% to 100% of runway covered
/// </summary>
From51To100 = 9
}
}
33 changes: 33 additions & 0 deletions MetarParserCore/Enums/MotneSpecials.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.ComponentModel;

namespace MetarParserCore.Enums
{
/// <summary>
/// MOTNE special signs
/// </summary>
public enum MotneSpecials
{
/// <summary>
/// Special sign not specified
/// </summary>
Default = 0,

/// <summary>
/// Contamination has disappeared or runway has been cleared
/// </summary>
[Description("CLRD")]
Cleared = 1,

/// <summary>
/// Runway closed
/// </summary>
[Description("CLSD")]
Closed = 2,

/// <summary>
/// Closed due to snow
/// </summary>
[Description("SNOCLO")]
ClosedToSnow = 3
}
}
33 changes: 33 additions & 0 deletions MetarParserCore/Enums/MotneTypeOfDeposit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace MetarParserCore.Enums
{
/// <summary>
/// Type of deposit
/// </summary>
public enum MotneTypeOfDeposit
{
ClearAndDry = 0,

Damp = 1,

Wet = 2,

Rime = 3,

DrySnow = 4,

WetSnow = 5,

Slush = 6,

Ice = 7,

RolledSnow = 8,

FrozenRuts = 9,

/// <summary>
/// Marked as "/"
/// </summary>
NotReported = 10
}
}
Loading

0 comments on commit f1a7ad8

Please sign in to comment.