Skip to content

Commit

Permalink
Merge pull request #212 from Tronald/develop
Browse files Browse the repository at this point in the history
2.16.1.1
  • Loading branch information
Tronald authored Feb 26, 2023
2 parents bc55851 + 1ffb4c0 commit 2c66850
Show file tree
Hide file tree
Showing 21 changed files with 603 additions and 257 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ bld/
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# ReSharper solution cache
_ReSharper.Caches/
7 changes: 3 additions & 4 deletions Benchmarks .NET Framework/Benchmarks .NET Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CoordinateSharp.Magnetic\CoordinateSharp.Magnetic.csproj">
Expand All @@ -58,5 +54,8 @@
<Name>CoordinateSharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
8 changes: 4 additions & 4 deletions CoordinateSharp.Magnetic/CoordinateSharp.Magnetic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ For more information, please contact Signature Group, LLC at this address: sales
<TargetFrameworks>net40; netstandard1.3; netstandard1.4; netstandard2.0; netstandard2.1; net50; net60; net70</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.1.5.0</Version>
<Version>1.1.6.0</Version>
<Authors>Signature Group, LLC</Authors>
<Company />
<PackageProjectUrl>https://github.com/Tronald/CoordinateSharp</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<Copyright>Copyright 2022</Copyright>
<Copyright>Copyright 2023</Copyright>
<Description>CoordinateSharp magnetic data extensions.</Description>
<PackageReleaseNotes>Adds .NET 7.0 targets</PackageReleaseNotes>
<PackageReleaseNotes>Maps to latest CoordinateSharp version</PackageReleaseNotes>
<PackageTags>CoordinateSharp Latitude Longitude Coordinates Geography Magnetic Declination</PackageTags>
<!-- <PackageLicenseExpression>AGPL-3.0-or-later</PackageLicenseExpression>-->
<PackageLicenseFile>License.txt</PackageLicenseFile>
<PackageIconUrl></PackageIconUrl>
<PackageId>CoordinateSharp.Magnetic</PackageId>
<Title>CoordinateSharp.Magnetic</Title>
<AssemblyVersion>1.1.5.0</AssemblyVersion>
<AssemblyVersion>1.1.6.0</AssemblyVersion>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<SignAssembly>true</SignAssembly>
<PackageIcon>CoordinateSharpPNG.png</PackageIcon>
Expand Down
22 changes: 17 additions & 5 deletions CoordinateSharp.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoordinateSharp", "CoordinateSharp\CoordinateSharp.csproj", "{82B32704-3306-49FD-A7FA-DB48B67B7B64}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoordinateSharp_Playground", "CoordinateSharp_Playground\CoordinateSharp_Playground.csproj", "{F81EBED4-1B80-4987-A499-F669F345E7BB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoordinateSharp.Playground", "CoordinateSharp_Playground\CoordinateSharp.Playground.csproj", "{F81EBED4-1B80-4987-A499-F669F345E7BB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoordinateSharp_UnitTests", "CoordinateSharp_UnitTests\CoordinateSharp.UnitTests.csproj", "{081621EE-78D3-4F86-8669-A42081B87A60}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoordinateSharp.UnitTests", "CoordinateSharp_UnitTests\CoordinateSharp.UnitTests.csproj", "{081621EE-78D3-4F86-8669-A42081B87A60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{848975D1-C7FA-4860-BF1B-60501630279F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks .NET CORE", "Benchmarks .NET CORE\Benchmarks .NET CORE.csproj", "{848975D1-C7FA-4860-BF1B-60501630279F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks .NET Framework", "Benchmarks .NET Framework\Benchmarks .NET Framework.csproj", "{984AD04B-D8A8-427D-9BA9-6CD74A9DE148}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoordinateSharp.Magnetic", "CoordinateSharp.Magnetic\CoordinateSharp.Magnetic.csproj", "{91F911B5-9438-4651-8A26-4B8A5496A4B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -33,6 +37,14 @@ Global
{848975D1-C7FA-4860-BF1B-60501630279F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{848975D1-C7FA-4860-BF1B-60501630279F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{848975D1-C7FA-4860-BF1B-60501630279F}.Release|Any CPU.Build.0 = Release|Any CPU
{984AD04B-D8A8-427D-9BA9-6CD74A9DE148}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{984AD04B-D8A8-427D-9BA9-6CD74A9DE148}.Debug|Any CPU.Build.0 = Debug|Any CPU
{984AD04B-D8A8-427D-9BA9-6CD74A9DE148}.Release|Any CPU.ActiveCfg = Release|Any CPU
{984AD04B-D8A8-427D-9BA9-6CD74A9DE148}.Release|Any CPU.Build.0 = Release|Any CPU
{91F911B5-9438-4651-8A26-4B8A5496A4B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91F911B5-9438-4651-8A26-4B8A5496A4B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91F911B5-9438-4651-8A26-4B8A5496A4B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91F911B5-9438-4651-8A26-4B8A5496A4B1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
16 changes: 8 additions & 8 deletions CoordinateSharp/Cartesians/ECEF.Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public partial class ECEF
/// </example>
public ECEF(Coordinate coordinate)
{
equatorial_radius = DataValues.DefaultSemiMajorAxis;
inverse_flattening = DataValues.DefaultInverseFlattening;
equatorial_radius = GlobalSettings.Default_EquatorialRadius;
inverse_flattening = GlobalSettings.Default_InverseFlattening;
Ellipsoid();
geodetic_height = new Distance(0);
double[] ecef = LatLong_To_ECEF(coordinate.Latitude.DecimalDegree, coordinate.Longitude.DecimalDegree, geodetic_height.Kilometers);
Expand Down Expand Up @@ -106,8 +106,8 @@ public ECEF(Coordinate coordinate)
/// </example>
public ECEF(Coordinate coordinate, Distance height)
{
equatorial_radius = DataValues.DefaultSemiMajorAxis;
inverse_flattening = DataValues.DefaultInverseFlattening;
equatorial_radius = GlobalSettings.Default_EquatorialRadius;
inverse_flattening = GlobalSettings.Default_InverseFlattening;
Ellipsoid();
geodetic_height = height;
double[] ecef = LatLong_To_ECEF(coordinate.Latitude.DecimalDegree, coordinate.Longitude.DecimalDegree, geodetic_height.Kilometers);
Expand Down Expand Up @@ -135,8 +135,8 @@ public ECEF(Coordinate coordinate, Distance height)
/// </example>
public ECEF(double xc, double yc, double zc)
{
equatorial_radius = DataValues.DefaultSemiMajorAxis;
inverse_flattening = DataValues.DefaultInverseFlattening;
equatorial_radius = GlobalSettings.Default_EquatorialRadius;
inverse_flattening = GlobalSettings.Default_InverseFlattening;
Ellipsoid();
geodetic_height = new Distance(0);
x = xc;
Expand All @@ -150,8 +150,8 @@ public ECEF(double xc, double yc, double zc)
/// <param name="coordinate">Geodetic coordinate</param>
internal void ToECEF(Coordinate coordinate)
{
equatorial_radius = DataValues.DefaultSemiMajorAxis;
inverse_flattening = DataValues.DefaultInverseFlattening;
equatorial_radius = GlobalSettings.Default_EquatorialRadius;
inverse_flattening = GlobalSettings.Default_InverseFlattening;
Ellipsoid();
double[] ecef = LatLong_To_ECEF(coordinate.Latitude.DecimalDegree, coordinate.Longitude.DecimalDegree, geodetic_height.Kilometers);
x = ecef[0];
Expand Down
97 changes: 89 additions & 8 deletions CoordinateSharp/Celestial/Lunar/Lunar.HelperClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,104 @@ internal void ConvertTo_LocalTime(double offset)
/// </summary>
[Serializable]
public class AstrologicalSigns
{
internal string moonName;
internal string moonSign;
internal string zodiacSign;
{
internal MoonName emoonName = CoordinateSharp.MoonName.None;
internal AstrologicalSignType emoonSign = CoordinateSharp.AstrologicalSignType.None;
internal AstrologicalSignType ezodiacSign = CoordinateSharp.AstrologicalSignType.None;

/// <summary>
/// Astrological Zodiac Sign.
/// Astrological Moon Name String.
/// </summary>
public string MoonName { get { return moonName; } }
public string MoonName
{
get
{
switch(emoonName)
{
case CoordinateSharp.MoonName.Wolf: return "Wolf Moon";
case CoordinateSharp.MoonName.Snow: return "Snow Moon";
case CoordinateSharp.MoonName.Worm: return "Worm Moon";
case CoordinateSharp.MoonName.Pink: return "Pink Moon";
case CoordinateSharp.MoonName.Flower: return "Flower Moon";
case CoordinateSharp.MoonName.Strawberry: return "Strawberry Moon";
case CoordinateSharp.MoonName.Buck: return "Buck Moon";
case CoordinateSharp.MoonName.Sturgeon: return "Sturgeon Moon";
case CoordinateSharp.MoonName.Corn: return "Corn Moon";
case CoordinateSharp.MoonName.Hunters: return "Hunters Moon";
case CoordinateSharp.MoonName.Beaver: return "Beaver Moon";
case CoordinateSharp.MoonName.Blue: return "Blue Moon";
case CoordinateSharp.MoonName.Cold: return "Cold Moon";
default: return null;
}
}
}
/// <summary>
/// Astrological Moon Sign String.
/// </summary>
public string MoonSign
{
get
{
switch (emoonSign)
{
case CoordinateSharp.AstrologicalSignType.Aries: return "Aries";
case CoordinateSharp.AstrologicalSignType.Taurus: return "Taurus";
case CoordinateSharp.AstrologicalSignType.Gemini: return "Gemini";
case CoordinateSharp.AstrologicalSignType.Cancer: return "Cancer";
case CoordinateSharp.AstrologicalSignType.Leo: return "Leo";
case CoordinateSharp.AstrologicalSignType.Virgo: return "Virgo";
case CoordinateSharp.AstrologicalSignType.Libra: return "Libra";
case CoordinateSharp.AstrologicalSignType.Scorpio: return "Scorpio";
case CoordinateSharp.AstrologicalSignType.Sagittarius: return "Sagittarius";
case CoordinateSharp.AstrologicalSignType.Capricorn: return "Capricorn";
case CoordinateSharp.AstrologicalSignType.Aquarius: return "Aquarius";
case CoordinateSharp.AstrologicalSignType.Pisces: return "Pisces";

default: return null;
}
}
}

/// <summary>
/// Astrological Zodiac Sign String.
/// </summary>
public string ZodiacSign
{
get
{
switch (ezodiacSign)
{
case CoordinateSharp.AstrologicalSignType.Aries: return "Aries";
case CoordinateSharp.AstrologicalSignType.Taurus: return "Taurus";
case CoordinateSharp.AstrologicalSignType.Gemini: return "Gemini";
case CoordinateSharp.AstrologicalSignType.Cancer: return "Cancer";
case CoordinateSharp.AstrologicalSignType.Leo: return "Leo";
case CoordinateSharp.AstrologicalSignType.Virgo: return "Virgo";
case CoordinateSharp.AstrologicalSignType.Libra: return "Libra";
case CoordinateSharp.AstrologicalSignType.Scorpio: return "Scorpio";
case CoordinateSharp.AstrologicalSignType.Sagittarius: return "Sagittarius";
case CoordinateSharp.AstrologicalSignType.Capricorn: return "Capricorn";
case CoordinateSharp.AstrologicalSignType.Aquarius: return "Aquarius";
case CoordinateSharp.AstrologicalSignType.Pisces: return "Pisces";

default: return null;
}
}
}

/// <summary>
/// Astrological Moon Name.
/// </summary>
public MoonName EMoonName { get { return emoonName; } }
/// <summary>
/// Astrological Moon Sign.
/// </summary>
public string MoonSign { get { return moonSign; } }
public AstrologicalSignType EMoonSign { get { return emoonSign; } }

/// <summary>
/// Astrological Zodiac Sign.
/// </summary>
public string ZodiacSign { get { return zodiacSign; } }
public AstrologicalSignType EZodiacSign { get { return ezodiacSign; } }
}
/// <summary>
/// Class containing detailed lunar eclipse information.
Expand Down
72 changes: 36 additions & 36 deletions CoordinateSharp/Celestial/Lunar/MoonCalculations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public static void GetMoonIllumination(DateTime date, Celestial c, double lat, d

c.moonIllum = mi;

string moonName = "";
MoonName moonName = MoonName.None;
int moonDate = 0;
//GET PHASE NAME

Expand Down Expand Up @@ -424,10 +424,10 @@ public static void GetMoonIllumination(DateTime date, Celestial c, double lat, d
{
if (el.Extensions.Zodiac)
{
c.AstrologicalSigns.moonName = moonName;
c.AstrologicalSigns.emoonName = moonName;
}
}
else { if (el.Extensions.Zodiac) { c.AstrologicalSigns.moonName = ""; } }
else { if (el.Extensions.Zodiac) { c.AstrologicalSigns.emoonName = MoonName.None; } }
}
if (el.Extensions.Lunar_Eclipse) { CalculateLunarEclipse(date, lat, lng, c); }

Expand Down Expand Up @@ -466,37 +466,37 @@ public static void CalculateLunarEclipse(DateTime date, double lat, double longi
}
}

private static string GetMoonName(int month, string name)
private static MoonName GetMoonName(int month, MoonName name)
{
if (name != "") { return "Blue Moon"; }
if (name != MoonName.None) { return MoonName.Blue; }
switch (month)
{
{
case 1:
return "Wolf Moon";
return MoonName.Wolf;
case 2:
return "Snow Moon";
return MoonName.Snow;
case 3:
return "Worm Moon";
return MoonName.Worm;
case 4:
return "Pink Moon";
case 5:
return "Flower Moon";
case 6:
return "Strawberry Moon";
case 7:
return "Buck Moon";
return MoonName.Pink;
case 5:
return MoonName.Flower;
case 6:
return MoonName.Strawberry;
case 7:
return MoonName.Buck;
case 8:
return "Sturgeon Moon";
return MoonName.Sturgeon;
case 9:
return "Corn Moon";
return MoonName.Corn;
case 10:
return "Hunters Moon";
return MoonName.Hunters;
case 11:
return "Beaver Moon";
return MoonName.Beaver;
case 12:
return "Cold Moon";
return MoonName.Cold;
default:
return "";
return MoonName.None;
}
}

Expand Down Expand Up @@ -543,21 +543,21 @@ public static void GetMoonSign(DateTime date, Celestial c)

sign += 1;

switch (sign.ToString())
switch (sign)
{
case "1": c.AstrologicalSigns.moonSign = "Aries"; break;
case "2": c.AstrologicalSigns.moonSign = "Taurus"; break;
case "3": c.AstrologicalSigns.moonSign = "Gemini"; break;
case "4": c.AstrologicalSigns.moonSign = "Cancer"; break;
case "5": c.AstrologicalSigns.moonSign = "Leo"; break;
case "6": c.AstrologicalSigns.moonSign = "Virgo"; break;
case "7": c.AstrologicalSigns.moonSign = "Libra"; break;
case "8": c.AstrologicalSigns.moonSign = "Scorpio"; break;
case "9": c.AstrologicalSigns.moonSign = "Sagitarius"; break;
case "10": c.AstrologicalSigns.moonSign = "Capricorn"; break;
case "11": c.AstrologicalSigns.moonSign = "Aquarius"; break;
case "12": c.AstrologicalSigns.moonSign = "Pisces"; break;
default: c.AstrologicalSigns.moonSign = "Pisces"; break;
case 1: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Aries; break;
case 2: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Taurus; break;
case 3: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Gemini; break;
case 4: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Cancer; break;
case 5: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Leo; break;
case 6: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Virgo; break;
case 7: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Libra; break;
case 8: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Scorpio; break;
case 9: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Sagittarius; break;
case 10: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Capricorn; break;
case 11: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Aquarius; break;
case 12: c.AstrologicalSigns.emoonSign = AstrologicalSignType.Pisces; break;
default: c.AstrologicalSigns.emoonSign = AstrologicalSignType.None; break;
}

}
Expand Down
Loading

0 comments on commit 2c66850

Please sign in to comment.