Skip to content

Commit

Permalink
Updated Target RA and Dec to not error when checking NaN values
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorgan001 committed Apr 21, 2023
1 parent a79333c commit 21f672d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 2 additions & 6 deletions GS.Ascom.SkyTelescope/Telescope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,9 +1447,7 @@ public double TargetDeclination

CheckCapability(SkySettings.CanSlew, "TargetDeclination", true);
CheckRange(value, -90, 90, "TargetDeclination");
//var ra = SkyServer.TargetRa;
var ra = TargetRightAscension;
if (double.IsNaN(ra)) ra = RightAscension;
var ra = double.IsNaN(SkyServer.TargetRa) ? RightAscension : TargetRightAscension;
var radec = Transforms.CoordTypeToInternal(ra, value);
SkyServer.TargetDec = radec.Y;
}
Expand Down Expand Up @@ -1480,9 +1478,7 @@ public double TargetRightAscension

CheckCapability(SkySettings.CanSlew, "TargetRightAscension", true);
CheckRange(value, 0, 24, "TargetRightAscension");
//var dec = SkyServer.TargetDec;
var dec = TargetDeclination;
if (double.IsNaN(dec)) dec = Declination;
var dec = double.IsNaN(SkyServer.TargetDec) ? Declination : TargetDeclination;
var radec = Transforms.CoordTypeToInternal(value, dec);
SkyServer.TargetRa = radec.X;
}
Expand Down
4 changes: 0 additions & 4 deletions GS.Server/SkyTelescope/SkyServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4020,10 +4020,6 @@ private static bool MountConnect()
{ Datetime = HiResDateTime.UtcNow, Device = MonitorDevice.Server, Category = MonitorCategory.Mount, Type = MonitorType.Information, Method = MethodBase.GetCurrentMethod()?.Name, Thread = Thread.CurrentThread.ManagedThreadId, Message = $"Pec: {pecmsg}" };
MonitorLog.LogToMonitor(monitorItem);

//set Ra Dec targets to current location
_targetRaDec.X = RightAscension;
_targetRaDec.Y = Declination;

return true;
}

Expand Down

0 comments on commit 21f672d

Please sign in to comment.