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