Added more unit tests and refactored AstroMaths to be in a sub folder
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
public class AltitudeData
|
||||
{
|
||||
public DateTime UtcDateTime { get; set; }
|
||||
public double SiteLatitude { get; set; }
|
||||
public double SiteLongitude { get; set; }
|
||||
public EquatorialCoordinates equatorialCoordinates { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,8 @@
|
||||
using System;
|
||||
using ASCOM.Utilities;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
public class EquatorialCoordinates
|
||||
{
|
||||
public double RightAscension { get; set; }
|
||||
public double Declination { get; set; }
|
||||
}
|
||||
|
||||
public class HorizonCoordinates
|
||||
{
|
||||
public double Altitude { get; set; }
|
||||
public double Azimuth { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class AltitudeData
|
||||
{
|
||||
public DateTime UtcDateTime { get; set; }
|
||||
public double SiteLatitude { get; set; }
|
||||
public double SiteLongitude { get; set; }
|
||||
public EquatorialCoordinates equatorialCoordinates { get; set; }
|
||||
}
|
||||
|
||||
public class AstroMaths : IAstroMaths
|
||||
{
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
public class EquatorialCoordinates
|
||||
{
|
||||
public double RightAscension { get; set; }
|
||||
public double Declination { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
public class HorizonCoordinates
|
||||
{
|
||||
public double Altitude { get; set; }
|
||||
public double Azimuth { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
public interface IAstroMaths
|
||||
{
|
||||
@@ -113,8 +113,11 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AstroMaths.cs" />
|
||||
<Compile Include="IAstroMaths.cs" />
|
||||
<Compile Include="AstroMaths\AltitudeData.cs" />
|
||||
<Compile Include="AstroMaths\AstroMaths.cs" />
|
||||
<Compile Include="AstroMaths\EquatorialCoordinates.cs" />
|
||||
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
|
||||
<Compile Include="AstroMaths\IAstroMaths.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="Telescope.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@@ -8,6 +8,7 @@ using ASCOM.DeviceInterface;
|
||||
using System.Globalization;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using ASCOM.Meade.net.AstroMaths;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
@@ -80,7 +81,7 @@ namespace ASCOM.Meade.net
|
||||
_utilitiesExtra = util; //Initialise util object
|
||||
_astroUtilities = new AstroUtils(); // Initialise astro utilities object
|
||||
_sharedResourcesWrapper = new SharedResourcesWrapper();
|
||||
_astroMaths = new AstroMaths();
|
||||
_astroMaths = new AstroMaths.AstroMaths();
|
||||
|
||||
Initialise();
|
||||
}
|
||||
@@ -173,7 +174,7 @@ namespace ASCOM.Meade.net
|
||||
case "mode":
|
||||
_sharedResourcesWrapper.SendBlind(":EK9#");
|
||||
break;
|
||||
case "longMode":
|
||||
case "longmode":
|
||||
_sharedResourcesWrapper.SendBlind(":EK11#");
|
||||
break;
|
||||
case "goto":
|
||||
@@ -228,12 +229,12 @@ namespace ASCOM.Meade.net
|
||||
break;
|
||||
default:
|
||||
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
||||
throw new ASCOM.ActionNotImplementedException($"Action {actionName}({actionParameters}) is not implemented by this driver");
|
||||
throw new ASCOM.ActionNotImplementedException($"{actionName}({actionParameters})");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
||||
throw new ASCOM.ActionNotImplementedException($"Action {actionName} is not implemented by this driver");
|
||||
throw new ASCOM.ActionNotImplementedException($"{actionName}");
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user