Added check to ensure that the Lunar Tracking rate cannot be selected on the LX200 Classic.
This commit is contained in:
@@ -2768,13 +2768,25 @@ namespace Meade.net.Telescope.UnitTests
|
||||
Assert.That(result.Message, Is.EqualTo("TrackingRate Set is not implemented in this driver."));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TrackingRates_Get_ReturnsExpectedType()
|
||||
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, true )]
|
||||
[TestCase(TelescopeList.LX200CLASSIC, "", false)]
|
||||
public void TrackingRates_Get_ReturnsExpectedType(string productName, string firmwareVersion, bool supportsLunar)
|
||||
{
|
||||
ConnectTelescope(productName, firmwareVersion);
|
||||
|
||||
var result = _telescope.TrackingRates;
|
||||
|
||||
Assert.That(result, Is.Not.Null);
|
||||
Assert.That(result, Is.AssignableTo<TrackingRates>());
|
||||
|
||||
if (supportsLunar)
|
||||
{
|
||||
Assert.That(result.Count, Is.EqualTo(2));
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.That(result.Count, Is.EqualTo(1));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -149,15 +149,19 @@ namespace ASCOM.Meade.net
|
||||
// Default constructor - Internal prevents public creation
|
||||
// of instances. Returned by Telescope.AxisRates.
|
||||
//
|
||||
internal TrackingRates()
|
||||
internal TrackingRates(bool supportsLunar)
|
||||
{
|
||||
//
|
||||
// This array must hold ONE or more DriveRates values, indicating
|
||||
// the tracking rates supported by your telescope. The one value
|
||||
// (tracking rate) that MUST be supported is driveSidereal!
|
||||
//
|
||||
if (supportsLunar)
|
||||
{
|
||||
_trackingRates = new[] {DriveRates.driveSidereal, DriveRates.driveLunar};
|
||||
// TODO Initialize this array with any additional tracking rates that your driver may provide
|
||||
}
|
||||
else
|
||||
_trackingRates = new[] { DriveRates.driveSidereal };
|
||||
}
|
||||
|
||||
#region ITrackingRates Members
|
||||
|
||||
@@ -2685,7 +2685,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
ITrackingRates trackingRates = new TrackingRates();
|
||||
ITrackingRates trackingRates = new TrackingRates(SharedResourcesWrapper.ProductName != TelescopeList.LX200CLASSIC);
|
||||
LogMessage("TrackingRates", "Get - ");
|
||||
foreach (DriveRates driveRate in trackingRates)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user