@@ -883,7 +883,7 @@ Public Class Telescope
883
883
TargetRightAscension = RightAscension
884
884
' Looks like there's an LX200 command to sync to target, so...
885
885
SyncToTarget()
886
-
886
+ TL.LogMessage( "SyncToCoordinates" , "Synced to " + utilities.DegreesToDMS(Declination) + ", " + utilities.HoursToHMS(RightAscension))
887
887
'If RightAscension <= 24 And RightAscension >= 0 And Declination >= -90 And Declination <= 90 Then
888
888
' Dim sign As String = String.Empty
889
889
' If Declination >= 0 Then
@@ -913,13 +913,14 @@ Public Class Telescope
913
913
914
914
If targetRASet Then
915
915
916
- Dim sign As String = String .Empty
917
- If TargetDeclination >= 0 Then
918
- sign = "+"
919
- End If
916
+ ' Dim sign As String = String.Empty
917
+ ' If TargetDeclination >= 0 Then
918
+ ' sign = "+"
919
+ ' End If
920
920
' Looks like there's an LX200 command to sync to target, so...
921
921
922
922
CommandBlind( ":CM" )
923
+ TL.LogMessage( "SyncToTarget" , "Synced to " + utilities.DegreesToDMS(TargetDeclination) + ", " + utilities.HoursToHMS(TargetRightAscension))
923
924
'Dim success As String = CommandString(":SY" + sign + utilities.DegreesToDMS(TargetDeclination, "*", ":", String.Empty) + "." + utilities.HoursToHMS(TargetRightAscension, ":", ":"), False)
924
925
'If success = "1" Then
925
926
' TL.LogMessage("SyncToTarget", "Synced to " + utilities.DegreesToDMS(TargetDeclination) + ", " + utilities.HoursToHMS(TargetRightAscension))
@@ -949,6 +950,7 @@ Public Class Telescope
949
950
Public Property TargetDeclination() As Double Implements ITelescopeV3.TargetDeclination
950
951
Get
951
952
If targetDecSet Then
953
+ targetDec = utilities.DMSToDegrees(CommandString( ":Gd" ))
952
954
TL.LogMessage( "TargetDeclination Get" , targetDec.ToString)
953
955
Return targetDec
954
956
Else
@@ -959,9 +961,24 @@ Public Class Telescope
959
961
End Get
960
962
Set (value As Double )
961
963
If value >= - 90 And value <= 90 Then
962
- TL.LogMessage( "TargetDeclination Set" , value.ToString)
963
- targetDec = value
964
- targetDecSet = True
964
+
965
+ Dim strDeccmd = utilities.DegreesToDMS(value, "*" , ":" , "" )
966
+ If Declination >= 0 Then
967
+ strDeccmd = "+" + strDeccmd
968
+ End If
969
+ strDeccmd = ":Sd" + strDeccmd
970
+
971
+ TL.LogMessage( "TargetDeclination" , strDeccmd)
972
+
973
+ If CommandString(strDeccmd) <> "1" Then
974
+ targetDecSet = False
975
+ Throw New ASCOM.DriverException( "ERR TargetDeclination" , strDeccmd)
976
+ Else
977
+ TL.LogMessage( "TargetDeclination Set" , value.ToString)
978
+ targetDec = value
979
+ targetDecSet = True
980
+ End If
981
+
965
982
Else
966
983
TL.LogMessage( "TargetDeclination Set" , "Invalid Value " + value.ToString)
967
984
Throw New ASCOM.InvalidValueException( "TargetDeclination" )
@@ -973,6 +990,7 @@ Public Class Telescope
973
990
Public Property TargetRightAscension() As Double Implements ITelescopeV3.TargetRightAscension
974
991
Get
975
992
If targetRASet Then
993
+ targetRA = targetDec = utilities.HMSToHours(CommandString( ":Gr" ))
976
994
TL.LogMessage( "TargetRightAscension Get" , targetRA.ToString)
977
995
Return targetRA
978
996
Else
@@ -982,10 +1000,17 @@ Public Class Telescope
982
1000
983
1001
End Get
984
1002
Set (value As Double )
1003
+
985
1004
If value >= 0 And value <= 24 Then
986
- TL.LogMessage( "TargetRightAscension Set" , value.ToString)
987
- targetRA = value
988
- targetRASet = True
1005
+ Dim strRAcmd = ":Sr" + utilities.HoursToHMS(value, ":" , ":" )
1006
+ If CommandString(strRAcmd) <> "1" Then
1007
+ targetRASet = False
1008
+ Throw New ASCOM.DriverException( "ERR TargetRightAscension" , strRAcmd)
1009
+ Else
1010
+ TL.LogMessage( "TargetRightAscension Set" , value.ToString)
1011
+ targetRA = value
1012
+ targetRASet = True
1013
+ End If
989
1014
Else
990
1015
TL.LogMessage( "TargetRightAscension Set" , "Invalid Value " + value.ToString)
991
1016
Throw New ASCOM.InvalidValueException( "TargetRightAscension" )
0 commit comments