Couple more code inspections, and changes the MoveAxis so that it will apply the settle time delay when not guiding.

This commit is contained in:
2021-03-02 13:07:21 +00:00
parent cdf1066e4e
commit acc935248b
+2 -16
View File
@@ -1342,9 +1342,6 @@ namespace ASCOM.Meade.net
private bool _movingPrimary; private bool _movingPrimary;
private bool _movingSecondary; private bool _movingSecondary;
private double _primaryRate;
private double _secondaryRate;
public void MoveAxis(TelescopeAxes axis, double rate) public void MoveAxis(TelescopeAxes axis, double rate)
{ {
LogMessage("MoveAxis", $"Axis={axis} rate={rate}"); LogMessage("MoveAxis", $"Axis={axis} rate={rate}");
@@ -1387,9 +1384,8 @@ namespace ASCOM.Meade.net
switch (rate.Compare(0)) switch (rate.Compare(0))
{ {
case ComparisonResult.Equals: case ComparisonResult.Equals:
if (_primaryRate > 1) if (!_isGuiding)
{ {
//We're going faster than Guide speed, so need to wait for the scope to settle.
SetSlewingMinEndTime(); SetSlewingMinEndTime();
} }
@@ -1400,21 +1396,18 @@ namespace ASCOM.Meade.net
SharedResourcesWrapper.SendBlind(":Qw#"); SharedResourcesWrapper.SendBlind(":Qw#");
//:Qw# Halt westward Slews //:Qw# Halt westward Slews
//Returns: Nothing //Returns: Nothing
_primaryRate = 0;
break; break;
case ComparisonResult.Greater: case ComparisonResult.Greater:
SharedResourcesWrapper.SendBlind(":Me#"); SharedResourcesWrapper.SendBlind(":Me#");
//:Me# Move Telescope East at current slew rate //:Me# Move Telescope East at current slew rate
//Returns: Nothing //Returns: Nothing
_movingPrimary = true; _movingPrimary = true;
_primaryRate = absRate;
break; break;
case ComparisonResult.Lower: case ComparisonResult.Lower:
SharedResourcesWrapper.SendBlind(":Mw#"); SharedResourcesWrapper.SendBlind(":Mw#");
//:Mw# Move Telescope West at current slew rate //:Mw# Move Telescope West at current slew rate
//Returns: Nothing //Returns: Nothing
_movingPrimary = true; _movingPrimary = true;
_primaryRate = absRate;
break; break;
} }
break; break;
@@ -1422,9 +1415,8 @@ namespace ASCOM.Meade.net
switch (rate.Compare(0)) switch (rate.Compare(0))
{ {
case ComparisonResult.Equals: case ComparisonResult.Equals:
if (_secondaryRate > 1) if (!_isGuiding)
{ {
//We're going faster than Guide speed, so need to wait for the scope to settle.
SetSlewingMinEndTime(); SetSlewingMinEndTime();
} }
_movingSecondary = false; _movingSecondary = false;
@@ -1434,26 +1426,20 @@ namespace ASCOM.Meade.net
SharedResourcesWrapper.SendBlind(":Qs#"); SharedResourcesWrapper.SendBlind(":Qs#");
//:Qs# Halt southward Slews //:Qs# Halt southward Slews
//Returns: Nothing //Returns: Nothing
_secondaryRate = 0;
break; break;
case ComparisonResult.Greater: case ComparisonResult.Greater:
SharedResourcesWrapper.SendBlind(":Mn#"); SharedResourcesWrapper.SendBlind(":Mn#");
//:Mn# Move Telescope North at current slew rate //:Mn# Move Telescope North at current slew rate
//Returns: Nothing //Returns: Nothing
_movingSecondary = true; _movingSecondary = true;
_secondaryRate = absRate;
break; break;
case ComparisonResult.Lower: case ComparisonResult.Lower:
SharedResourcesWrapper.SendBlind(":Ms#"); SharedResourcesWrapper.SendBlind(":Ms#");
//:Ms# Move Telescope South at current slew rate //:Ms# Move Telescope South at current slew rate
//Returns: Nothing //Returns: Nothing
_movingSecondary = true; _movingSecondary = true;
_secondaryRate = absRate;
break; break;
} }
break; break;
default: default:
throw new InvalidValueException("Can not move this axis."); throw new InvalidValueException("Can not move this axis.");