Fixed issue when connecting, that the first attempt to set the guide rate was not in the right scale.
This commit is contained in:
@@ -339,6 +339,22 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
Assert.That(_telescope.Connected, Is.EqualTo(expectedConnected));
|
Assert.That(_telescope.Connected, Is.EqualTo(expectedConnected));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Connected_Set_WhenConnecting_Then()
|
||||||
|
{
|
||||||
|
var productName = "LX2001";
|
||||||
|
var firmware = string.Empty;
|
||||||
|
|
||||||
|
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(productName);
|
||||||
|
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(firmware);
|
||||||
|
_telescope.Connected = true;
|
||||||
|
|
||||||
|
_sharedResourcesWrapperMock.Verify( x => x.Connect("Serial"), Times.Once);
|
||||||
|
_sharedResourcesWrapperMock.Verify(x => x.SendString(":GZ#"), Times.Once);
|
||||||
|
|
||||||
|
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"),Times.Once);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Connected_Set_SettingTrueWhenTrue_ThenDoesNothing()
|
public void Connected_Set_SettingTrueWhenTrue_ThenDoesNothing()
|
||||||
|
|||||||
@@ -1091,15 +1091,13 @@ namespace ASCOM.Meade.net
|
|||||||
throw new PropertyNotImplementedException(propertyName, true);
|
throw new PropertyNotImplementedException(propertyName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var valueInArcSecondsPerSecond = DegreesPerSecondToArcSecondPerSecond(value);
|
if (!value.InRange(0, 15.0417))
|
||||||
|
|
||||||
if (!valueInArcSecondsPerSecond.InRange(0, 15.0417))
|
|
||||||
{
|
{
|
||||||
throw new InvalidValueException(propertyName, valueInArcSecondsPerSecond.ToString(), "0 to 15.0417”/sec");
|
throw new InvalidValueException(propertyName, value.ToString(), "0 to 15.0417”/sec");
|
||||||
}
|
}
|
||||||
|
|
||||||
LogMessage($"{propertyName} Set", $"Setting new guiderate {valueInArcSecondsPerSecond.ToString()} arc seconds/second ({value.ToString()} degrees/second)");
|
LogMessage($"{propertyName} Set", $"Setting new guiderate {value.ToString()} arc seconds/second ({value.ToString()} degrees/second)");
|
||||||
_sharedResourcesWrapper.SendBlind($":Rg{valueInArcSecondsPerSecond:00.0}#");
|
_sharedResourcesWrapper.SendBlind($":Rg{value:00.0}#");
|
||||||
//:RgSS.S#
|
//:RgSS.S#
|
||||||
//Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking
|
//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
|
//Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed
|
||||||
@@ -1108,7 +1106,7 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
//info from RickB says that 15.04107 is a better value for
|
//info from RickB says that 15.04107 is a better value for
|
||||||
|
|
||||||
_guideRate = valueInArcSecondsPerSecond;
|
_guideRate = value;
|
||||||
|
|
||||||
WriteProfile();
|
WriteProfile();
|
||||||
}
|
}
|
||||||
@@ -1133,7 +1131,8 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetNewGuideRate(value, "GuideRateDeclination");
|
var newValue = DegreesPerSecondToArcSecondPerSecond(value);
|
||||||
|
SetNewGuideRate(newValue, "GuideRateDeclination");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1147,7 +1146,8 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetNewGuideRate(value, "GuideRateRightAscension");
|
var newValue = DegreesPerSecondToArcSecondPerSecond(value);
|
||||||
|
SetNewGuideRate(newValue, "GuideRateRightAscension");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user