Made a few minor tweaks whilst reviewing.
This commit is contained in:
@@ -515,7 +515,6 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
private bool IsTargetCoordinateInitRequired()
|
||||
{
|
||||
const double eps = 0.00001d;
|
||||
if (!_isTargetCoordinateInitRequired)
|
||||
return _isTargetCoordinateInitRequired;
|
||||
|
||||
@@ -528,20 +527,17 @@ namespace ASCOM.Meade.net
|
||||
return _isTargetCoordinateInitRequired;
|
||||
}
|
||||
|
||||
var result = SharedResourcesWrapper.SendString(":Gr#");
|
||||
|
||||
double rightTargetAscension = HMToHours(result);
|
||||
const double eps = 0.00001d;
|
||||
|
||||
double rightTargetAscension = RightAscension;
|
||||
//target RA == 0
|
||||
if (Math.Abs(rightTargetAscension) > eps)
|
||||
{
|
||||
_isTargetCoordinateInitRequired = false;
|
||||
return _isTargetCoordinateInitRequired;
|
||||
}
|
||||
result = SharedResourcesWrapper.SendString(":Gd#");
|
||||
|
||||
double targetDeclination = _utilities.DMSToDegrees(result);
|
||||
|
||||
double targetDeclination = Declination;
|
||||
//target DE == 0
|
||||
if (Math.Abs(targetDeclination) > eps)
|
||||
{
|
||||
@@ -549,7 +545,6 @@ namespace ASCOM.Meade.net
|
||||
return _isTargetCoordinateInitRequired;
|
||||
}
|
||||
|
||||
|
||||
//target coordinates are equal current coordinates
|
||||
if((Math.Abs(RightAscension - rightTargetAscension ) <= eps) &&
|
||||
(Math.Abs(Declination - targetDeclination) <= eps))
|
||||
@@ -565,26 +560,23 @@ namespace ASCOM.Meade.net
|
||||
|
||||
private void InitTargetCoordinates()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var raAndDec = GetTelescopeRaAndDec();
|
||||
//when connection the first time the telescop target coordinates should be the current ones.
|
||||
//when connection the first time the telescope target coordinates should be the current ones.
|
||||
//for the classic LX200 at least this is not the case, target ra and dec are 0, when switched on.
|
||||
LogMessage("InitTargetCoordinates", "sync telescope target");
|
||||
SyncToCoordinates(raAndDec.RightAscension, raAndDec.Declination);
|
||||
|
||||
//do it only once
|
||||
_isTargetCoordinateInitRequired = false;
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogMessage("InitTargetCoordinates", $"Error sync telescope position", ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetLongFormat(bool setLongFormat)
|
||||
{
|
||||
IsLongFormat = false;
|
||||
@@ -1989,7 +1981,7 @@ namespace ASCOM.Meade.net
|
||||
//LX200's – a string of bar characters indicating the distance.
|
||||
//Autostars and Autostar II – a string containing one bar until a slew is complete, then a null string is returned.
|
||||
|
||||
bool isSlewing = result != null && result != string.Empty;
|
||||
bool isSlewing = !string.IsNullOrEmpty(result);
|
||||
|
||||
if (!isSlewing)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user