Slewing now reports false when performing a guide command using the old guiding method.
This commit is contained in:
@@ -1356,6 +1356,29 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
Assert.That(exception.Message, Is.EqualTo("Unable to PulseGuide while moving same axis."));
|
Assert.That(exception.Message, Is.EqualTo("Unable to PulseGuide while moving same axis."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(GuideDirections.guideEast)]
|
||||||
|
[TestCase(GuideDirections.guideWest)]
|
||||||
|
[TestCase(GuideDirections.guideNorth)]
|
||||||
|
[TestCase(GuideDirections.guideSouth)]
|
||||||
|
public void PulseGuide_WhenConnectedAndNewerPulseGuidingNotAvailable_ThenIsSlewingRespondsFalse(GuideDirections direction)
|
||||||
|
{
|
||||||
|
var duration = 0;
|
||||||
|
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
|
||||||
|
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_30Ee);
|
||||||
|
|
||||||
|
var isSlewing = true;
|
||||||
|
_utilMock.Setup(x => x.WaitForMilliseconds(duration)).Callback(() =>
|
||||||
|
{
|
||||||
|
isSlewing = _telescope.Slewing;
|
||||||
|
});
|
||||||
|
|
||||||
|
_telescope.Connected = true;
|
||||||
|
|
||||||
|
_telescope.PulseGuide(direction, duration);
|
||||||
|
|
||||||
|
Assert.That(isSlewing, Is.False);
|
||||||
|
}
|
||||||
|
|
||||||
[TestCase(GuideDirections.guideEast)]
|
[TestCase(GuideDirections.guideEast)]
|
||||||
[TestCase(GuideDirections.guideWest)]
|
[TestCase(GuideDirections.guideWest)]
|
||||||
[TestCase(GuideDirections.guideNorth)]
|
[TestCase(GuideDirections.guideNorth)]
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
|
|
||||||
private double _guideRate;
|
private double _guideRate;
|
||||||
|
private bool _isGuiding = false;
|
||||||
|
|
||||||
private void Initialise()
|
private void Initialise()
|
||||||
{
|
{
|
||||||
//todo move the TraceLogger out to a factory class.
|
//todo move the TraceLogger out to a factory class.
|
||||||
@@ -1459,28 +1460,36 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (direction)
|
_isGuiding = true;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
case GuideDirections.guideEast:
|
switch (direction)
|
||||||
MoveAxis(TelescopeAxes.axisPrimary, 1);
|
{
|
||||||
_utilities.WaitForMilliseconds(duration);
|
case GuideDirections.guideEast:
|
||||||
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
MoveAxis(TelescopeAxes.axisPrimary, 1);
|
||||||
break;
|
_utilities.WaitForMilliseconds(duration);
|
||||||
case GuideDirections.guideNorth:
|
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
MoveAxis(TelescopeAxes.axisSecondary, 1);
|
break;
|
||||||
_utilities.WaitForMilliseconds(duration);
|
case GuideDirections.guideNorth:
|
||||||
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
MoveAxis(TelescopeAxes.axisSecondary, 1);
|
||||||
break;
|
_utilities.WaitForMilliseconds(duration);
|
||||||
case GuideDirections.guideSouth:
|
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
MoveAxis(TelescopeAxes.axisSecondary, -1);
|
break;
|
||||||
_utilities.WaitForMilliseconds(duration);
|
case GuideDirections.guideSouth:
|
||||||
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
MoveAxis(TelescopeAxes.axisSecondary, -1);
|
||||||
break;
|
_utilities.WaitForMilliseconds(duration);
|
||||||
case GuideDirections.guideWest:
|
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
MoveAxis(TelescopeAxes.axisPrimary, -1);
|
break;
|
||||||
_utilities.WaitForMilliseconds(duration);
|
case GuideDirections.guideWest:
|
||||||
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
MoveAxis(TelescopeAxes.axisPrimary, -1);
|
||||||
break;
|
_utilities.WaitForMilliseconds(duration);
|
||||||
|
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_isGuiding = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1924,6 +1933,9 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
private bool MovingAxis()
|
private bool MovingAxis()
|
||||||
{
|
{
|
||||||
|
if (_isGuiding)
|
||||||
|
return false;
|
||||||
|
|
||||||
return _movingPrimary || _movingSecondary;
|
return _movingPrimary || _movingSecondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1945,6 +1957,9 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
CheckConnected("Slewing Get");
|
CheckConnected("Slewing Get");
|
||||||
|
|
||||||
|
if (_isGuiding)
|
||||||
|
return false;
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendString("#:D#");
|
var result = _sharedResourcesWrapper.SendString("#:D#");
|
||||||
//:D# Requests a string of bars indicating the distance to the current target location.
|
//:D# Requests a string of bars indicating the distance to the current target location.
|
||||||
//Returns:
|
//Returns:
|
||||||
|
|||||||
Reference in New Issue
Block a user