modified the get tracking code to make it less better. amd more tolerant of lunar speeds, taken from Nasa and other sources (Info from David Richards)
This commit is contained in:
@@ -2783,6 +2783,8 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
[TestCase(DriveRates.driveSidereal, "+60.1")]
|
[TestCase(DriveRates.driveSidereal, "+60.1")]
|
||||||
[TestCase(DriveRates.driveSolar, "+60.0")]
|
[TestCase(DriveRates.driveSolar, "+60.0")]
|
||||||
[TestCase(DriveRates.driveLunar, "+57.9")]
|
[TestCase(DriveRates.driveLunar, "+57.9")]
|
||||||
|
[TestCase(DriveRates.driveLunar, "57.3")]
|
||||||
|
[TestCase(DriveRates.driveLunar, "58.9")]
|
||||||
public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate)
|
public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate)
|
||||||
{
|
{
|
||||||
_siderealTrackingRate = trackingRate;
|
_siderealTrackingRate = trackingRate;
|
||||||
|
|||||||
@@ -128,6 +128,7 @@
|
|||||||
<Compile Include="Clock.cs" />
|
<Compile Include="Clock.cs" />
|
||||||
<Compile Include="ComparisonResult.cs" />
|
<Compile Include="ComparisonResult.cs" />
|
||||||
<Compile Include="DoubleExtensions.cs" />
|
<Compile Include="DoubleExtensions.cs" />
|
||||||
|
<Compile Include="ExtensionMethods\DoubelExtensions.cs" />
|
||||||
<Compile Include="IClock.cs" />
|
<Compile Include="IClock.cs" />
|
||||||
<Compile Include="StringExtensions.cs" />
|
<Compile Include="StringExtensions.cs" />
|
||||||
<Compile Include="Telescope.cs" />
|
<Compile Include="Telescope.cs" />
|
||||||
@@ -187,6 +188,7 @@
|
|||||||
<Name>Meade.net</Name>
|
<Name>Meade.net</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
|
|||||||
@@ -2643,25 +2643,20 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
rate = rate.Replace("+", string.Empty);
|
rate = rate.Replace("+", string.Empty);
|
||||||
|
|
||||||
|
var rateDouble = double.Parse(rate);
|
||||||
|
|
||||||
DriveRates result;
|
DriveRates result;
|
||||||
|
|
||||||
switch (rate)
|
if (rateDouble.Equals(60.1))
|
||||||
{
|
|
||||||
case "60.1":
|
|
||||||
result = DriveRates.driveSidereal;
|
result = DriveRates.driveSidereal;
|
||||||
break;
|
else if (rateDouble.Equals(60.0))
|
||||||
case "60.0":
|
|
||||||
result = DriveRates.driveSolar;
|
result = DriveRates.driveSolar;
|
||||||
break;
|
else if (rateDouble.Between(57.3, 58.9))
|
||||||
case "57.9":
|
|
||||||
result = DriveRates.driveLunar;
|
result = DriveRates.driveLunar;
|
||||||
break;
|
else
|
||||||
default:
|
|
||||||
result = DriveRates.driveKing;
|
|
||||||
//If this is ever returned it is representing a fail condition.
|
//If this is ever returned it is representing a fail condition.
|
||||||
break;
|
//result = DriveRates.driveKing;
|
||||||
}
|
throw new ASCOM.InvalidValueException($"{rate} is not a supported tracking rate for meade mounts");
|
||||||
|
|
||||||
|
|
||||||
LogMessage("TrackingRate Get", $"{rate} {result}");
|
LogMessage("TrackingRate Get", $"{rate} {result}");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user