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:
@@ -128,6 +128,7 @@
|
||||
<Compile Include="Clock.cs" />
|
||||
<Compile Include="ComparisonResult.cs" />
|
||||
<Compile Include="DoubleExtensions.cs" />
|
||||
<Compile Include="ExtensionMethods\DoubelExtensions.cs" />
|
||||
<Compile Include="IClock.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="Telescope.cs" />
|
||||
@@ -187,6 +188,7 @@
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
|
||||
@@ -2643,25 +2643,20 @@ namespace ASCOM.Meade.net
|
||||
|
||||
rate = rate.Replace("+", string.Empty);
|
||||
|
||||
var rateDouble = double.Parse(rate);
|
||||
|
||||
DriveRates result;
|
||||
|
||||
switch (rate)
|
||||
{
|
||||
case "60.1":
|
||||
result = DriveRates.driveSidereal;
|
||||
break;
|
||||
case "60.0":
|
||||
result = DriveRates.driveSolar;
|
||||
break;
|
||||
case "57.9":
|
||||
result = DriveRates.driveLunar;
|
||||
break;
|
||||
default:
|
||||
result = DriveRates.driveKing;
|
||||
//If this is ever returned it is representing a fail condition.
|
||||
break;
|
||||
}
|
||||
|
||||
if (rateDouble.Equals(60.1))
|
||||
result = DriveRates.driveSidereal;
|
||||
else if (rateDouble.Equals(60.0))
|
||||
result = DriveRates.driveSolar;
|
||||
else if (rateDouble.Between(57.3, 58.9))
|
||||
result = DriveRates.driveLunar;
|
||||
else
|
||||
//If this is ever returned it is representing a fail condition.
|
||||
//result = DriveRates.driveKing;
|
||||
throw new ASCOM.InvalidValueException($"{rate} is not a supported tracking rate for meade mounts");
|
||||
|
||||
LogMessage("TrackingRate Get", $"{rate} {result}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user