Skip to content

Commit 9027623

Browse files
committed
ASCOM Driver 0.1.4.2b - Support for :CM
1 parent 8beeb54 commit 9027623

File tree

4 files changed

+38
-29
lines changed

4 files changed

+38
-29
lines changed

Software/OpenAstroTracker ASCOM/OpenAstroTracker ASCOM/Driver.vb

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Software/OpenAstroTracker ASCOM/OpenAstroTracker ASCOM/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
3030
' You can specify all the values or you can default the Build and Revision Numbers
3131
' by using the '*' as shown below:
3232

33-
<Assembly: AssemblyVersion("0.1.4.1")>
34-
<Assembly: AssemblyFileVersion("0.1.4.1")>
33+
<Assembly: AssemblyVersion("0.1.4.2")>
34+
<Assembly: AssemblyFileVersion("0.1.4.2")>
Binary file not shown.

Software/OpenAstroTracker ASCOM/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OpenAstroTracker ASCOM driver 0.1.4.1b : 2020-04-18
1+
OpenAstroTracker ASCOM driver 0.1.4.2b : 2020-04-20
22

33
This driver is still in a great deal of flux. Capacitor levels of flux. Use at your own risk!
44

@@ -8,10 +8,11 @@ This driver is still in a great deal of flux. Capacitor levels of flux. Use at
88
* 0.1.4b 2020-04-18 : CHANGE : Implement pulse guiding.
99
BUGFIX : Uninstaller was not correctly removing previous driver DLL
1010
* 0.1.4.1b 2020-04-18 : BUGFIX : Driver not correctly handling return value from Halt
11+
* 0.1.4.2b 2020-04-20 : CHANGE : Driver uses :CM LX200 Protocol command to sync
1112
1213
* Arduino information
1314
* Tested on Arduino Uno. No other variants of Arduino have been tested.
14-
* Currently built for Version V1.6.27 of the Arduino Code (As of 2020-04-18)
15+
* Currently built for Version V1.6.29 and above of the Arduino Code (As of 2020-04-20)
1516
* Uncomment #define SUPPORT_SERIAL_CONTROL in Globals.h
1617
* Leave #define DEBUG_MODE in Globals.h commented.
1718

@@ -33,7 +34,7 @@ This driver is still in a great deal of flux. Capacitor levels of flux. Use at
3334
* All known current issues are probably documented at https://github.com/ClutchplateDude/OpenAstroTracker/issues
3435

3536
* Work in Progress / Coming soon
36-
* A simple PC Control application has been built during testing. A release version of this for basic mount control will follow soon.
37+
* A simple PC Control application is being developed.
3738
* You are welcome to play with the PC Control code included in "OAT PC Control" in this branch, but be aware it's not ready for prime time yet.
3839
* Implementation of AltAz methods and properties
3940
* Ability to set home position of mount via ASCOM

0 commit comments

Comments
 (0)