diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 3c97754..bc217c2 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -643,7 +643,8 @@ namespace Meade.net.Telescope.UnitTests var result = _telescope.CanSetGuideRates; - Assert.That(result, Is.True); + //Assert.That(result, Is.True); + Assert.That(result, Is.False); } [Test] @@ -832,7 +833,7 @@ namespace Meade.net.Telescope.UnitTests } [Test] - public void GuideRateDeclination_Set_ThenThrowsException() + public void GuideRateDeclination_Set_WhenNotSupported_ThenThrowsException() { _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497); @@ -842,19 +843,19 @@ namespace Meade.net.Telescope.UnitTests Assert.That(excpetion.AccessorSet, Is.True); } - [Test] - public void GuideRateDeclination_Set_WhenIsSupported_ThenSetsNewGuideRate() - { - var newGuideRate = 10; + //[Test] + //public void GuideRateDeclination_Set_WhenIsSupported_ThenSetsNewGuideRate() + //{ + // var newGuideRate = 10; - _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS); + // _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS); - _telescope.GuideRateDeclination = newGuideRate; + // _telescope.GuideRateDeclination = newGuideRate; - _sharedResourcesWrapperMock.Verify( x => x.SendBlind(":Rg10.0#"),Times.Once); + // _sharedResourcesWrapperMock.Verify( x => x.SendBlind(":Rg10.0#"),Times.Once); - Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate)); - } + // Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate)); + //} [Test] public void GuideRateRightAscension_Get_ThenThrowsException() @@ -865,7 +866,7 @@ namespace Meade.net.Telescope.UnitTests } [Test] - public void GuideRateRightAscension_Set_ThenThrowsException() + public void GuideRateRightAscension_Set_WhenNotSupported_ThenThrowsException() { _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497); @@ -875,19 +876,19 @@ namespace Meade.net.Telescope.UnitTests Assert.That(excpetion.AccessorSet, Is.True); } - [Test] - public void GuideRateRightAscension_Set_WhenIsSupported_ThenSetsNewGuideRate() - { - var newGuideRate = 10; + //[Test] + //public void GuideRateRightAscension_Set_WhenIsSupported_ThenSetsNewGuideRate() + //{ + // var newGuideRate = 10; - _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS); + // _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS); - _telescope.GuideRateRightAscension = newGuideRate; + // _telescope.GuideRateRightAscension = newGuideRate; - _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg10.0#"), Times.Once); + // _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg10.0#"), Times.Once); - Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate)); - } + // Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate)); + //} [Test] public void IsPulseGuiding_Get_ReturnsFalse() diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index e78899c..6b62306 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -375,14 +375,15 @@ namespace ASCOM.Meade.net return false; } - private bool IsGuideRateSettingSupported() - { - if (_sharedResourcesWrapper.ProductName == TelescopeList.LX200GPS) - { - return true; - } - return false; - } + //todo implement ability to read and write the guide rate from the telescope. + //private bool IsGuideRateSettingSupported() + //{ + // if (_sharedResourcesWrapper.ProductName == TelescopeList.LX200GPS) + // { + // return true; + // } + // return false; + //} private bool FirmwareIsGreaterThan(string minVersion) { @@ -757,7 +758,8 @@ namespace ASCOM.Meade.net { CheckConnected("CanSetGuideRates Get"); - var canSetGuideRate = IsGuideRateSettingSupported(); + //var canSetGuideRate = IsGuideRateSettingSupported(); + var canSetGuideRate = false; LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate.ToString()); return canSetGuideRate; @@ -943,25 +945,25 @@ namespace ASCOM.Meade.net private void SetNewGuideRate(double value, string propertyName) { - if (!IsGuideRateSettingSupported()) - { + //if (!IsGuideRateSettingSupported()) + //{ LogMessage("GuideRateDeclination Set", "Not implemented"); throw new PropertyNotImplementedException(propertyName, true); - } + //} - if (!value.InRange(0, 15.0417)) - { - throw new InvalidValueException(propertyName, value.ToString(), "0 to 15.0417”/sec"); - } + //if (!value.InRange(0, 15.0417)) + //{ + // throw new InvalidValueException(propertyName, value.ToString(), "0 to 15.0417”/sec"); + //} - _sharedResourcesWrapper.SendBlind($":Rg{value:00.0}#"); - //:RgSS.S# - //Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking - //Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed - //sidereal speed(approx 15.0417”/sec)[Autostar II only] - //Returns: Nothing + //_sharedResourcesWrapper.SendBlind($":Rg{value:00.0}#"); + ////:RgSS.S# + ////Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking + ////Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed + ////sidereal speed(approx 15.0417”/sec)[Autostar II only] + ////Returns: Nothing - _guideRate = value; + // _guideRate = value; } public double GuideRateDeclination