@@ -40,7 +40,7 @@ Public Class Telescope
4040 '
4141 ' Driver ID and descriptive string that shows in the Chooser
4242 '
43- Private Version As String = "0.1.4.1b "
43+ Private Version As String = "0.1.4.2b "
4444 Friend Shared driverID As String = "ASCOM.OpenAstroTracker.Telescope"
4545 Private Shared driverDescription As String = "OpenAstroTracker Telescope"
4646
@@ -879,22 +879,27 @@ Public Class Telescope
879879
880880 Public Sub SyncToCoordinates(RightAscension As Double , Declination As Double ) Implements ITelescopeV3.SyncToCoordinates
881881 If Not AtPark Then
882- If RightAscension <= 24 And RightAscension >= 0 And Declination >= - 90 And Declination <= 90 Then
883- Dim sign As String = String .Empty
884- If Declination >= 0 Then
885- sign = "+"
886- End If
887- Dim success As String = CommandString( ":SY" + sign + utilities.DegreesToDMS(Declination, "*" , ":" , String .Empty) + "." + utilities.HoursToHMS(RightAscension, ":" , ":" ), False )
888- If success = "1" Then
889- TL.LogMessage( "SyncToCoordinates" , "Synced to " + utilities.DegreesToDMS(Declination) + ", " + utilities.HoursToHMS(RightAscension))
890- Else
891- TL.LogMessage( "SyncToCoordinates" , "Err - Failed to sync to " + utilities.DegreesToDMS(Declination) + ", " + utilities.HoursToHMS(RightAscension))
892- Throw New ASCOM.DriverException( "SyncToCoordinates" )
893- End If
894- Else
895- TL.LogMessage( "SyncToCoordinates" , "Err - Invalid coordinates RA: " + RightAscension.ToString + ", Dec: " + Declination.ToString)
896- Throw New ASCOM.InvalidValueException( "SyncToCoordinates" )
897- End If
882+ TargetDeclination = Declination
883+ TargetRightAscension = RightAscension
884+ ' Looks like there's an LX200 command to sync to target, so...
885+ SyncToTarget()
886+
887+ 'If RightAscension <= 24 And RightAscension >= 0 And Declination >= -90 And Declination <= 90 Then
888+ ' Dim sign As String = String.Empty
889+ ' If Declination >= 0 Then
890+ ' sign = "+"
891+ ' End If
892+ ' Dim success As String = CommandString(":SY" + sign + utilities.DegreesToDMS(Declination, "*", ":", String.Empty) + "." + utilities.HoursToHMS(RightAscension, ":", ":"), False)
893+ ' If success = "1" Then
894+ ' TL.LogMessage("SyncToCoordinates", "Synced to " + utilities.DegreesToDMS(Declination) + ", " + utilities.HoursToHMS(RightAscension))
895+ ' Else
896+ ' TL.LogMessage("SyncToCoordinates", "Err - Failed to sync to " + utilities.DegreesToDMS(Declination) + ", " + utilities.HoursToHMS(RightAscension))
897+ ' Throw New ASCOM.DriverException("SyncToCoordinates")
898+ ' End If
899+ 'Else
900+ ' TL.LogMessage("SyncToCoordinates", "Err - Invalid coordinates RA: " + RightAscension.ToString + ", Dec: " + Declination.ToString)
901+ ' Throw New ASCOM.InvalidValueException("SyncToCoordinates")
902+ 'End If
898903 Else
899904 TL.LogMessage( "SyncToCoordinates" , "Err - Parked" )
900905 Throw New ASCOM.ParkedException( "SyncToCoordinates" )
@@ -912,13 +917,16 @@ Public Class Telescope
912917 If TargetDeclination >= 0 Then
913918 sign = "+"
914919 End If
915- Dim success As String = CommandString( ":SY" + sign + utilities.DegreesToDMS(TargetDeclination, "*" , ":" , String .Empty) + "." + utilities.HoursToHMS(TargetRightAscension, ":" , ":" ), False )
916- If success = "1" Then
917- TL.LogMessage( "SyncToTarget" , "Synced to " + utilities.DegreesToDMS(TargetDeclination) + ", " + utilities.HoursToHMS(TargetRightAscension))
918- Else
919- TL.LogMessage( "SyncToTarget" , "Failed to sync to " + utilities.DegreesToDMS(TargetDeclination) + ", " + utilities.HoursToHMS(TargetRightAscension))
920- Throw New ASCOM.DriverException( "SyncToTarget" )
921- End If
920+ ' Looks like there's an LX200 command to sync to target, so...
921+
922+ CommandBlind( ":CM" )
923+ 'Dim success As String = CommandString(":SY" + sign + utilities.DegreesToDMS(TargetDeclination, "*", ":", String.Empty) + "." + utilities.HoursToHMS(TargetRightAscension, ":", ":"), False)
924+ 'If success = "1" Then
925+ ' TL.LogMessage("SyncToTarget", "Synced to " + utilities.DegreesToDMS(TargetDeclination) + ", " + utilities.HoursToHMS(TargetRightAscension))
926+ 'Else
927+ ' TL.LogMessage("SyncToTarget", "Failed to sync to " + utilities.DegreesToDMS(TargetDeclination) + ", " + utilities.HoursToHMS(TargetRightAscension))
928+ ' Throw New ASCOM.DriverException("SyncToTarget")
929+ 'End If
922930
923931 Else
924932
0 commit comments