@@ -81,7 +81,7 @@ Public Class Telescope
81
81
Private objSerial As ASCOM.Utilities.Serial
82
82
Private isParked As Boolean = False
83
83
Dim mutexBlind As Mutex, mutexCommand As Mutex
84
- ' Dim pierSide As Integer = 1
84
+ Private m_TrackingRates(- 1 ) As DriveRates
85
85
86
86
'
87
87
' Constructor - Must be public for COM registration!
@@ -313,8 +313,13 @@ Public Class Telescope
313
313
314
314
# Region "ITelescope Implementation"
315
315
Public Sub AbortSlew() Implements ITelescopeV3.AbortSlew
316
- CommandBlind( ":Q" )
317
- TL.LogMessage( "AbortSlew" , ":Q# Issued" )
316
+ If Not AtPark Then
317
+ CommandBlind( ":Q" )
318
+ TL.LogMessage( "AbortSlew" , ":Q# Issued" )
319
+ Else
320
+ Throw New ASCOM.ParkedException( "AbortSlew" )
321
+ End If
322
+
318
323
End Sub
319
324
320
325
Public ReadOnly Property AlignmentMode() As AlignmentModes Implements ITelescopeV3.AlignmentMode
@@ -758,31 +763,34 @@ Public Class Telescope
758
763
End Sub
759
764
760
765
Public Sub SlewToCoordinates(RightAscension As Double , Declination As Double ) Implements ITelescopeV3.SlewToCoordinates
761
-
762
- If Not AtPark Then
763
- TL.LogMessage( "SlewToCoordinates" , "RA " + RightAscension.ToString + ", Dec " + Declination.ToString)
764
- Dim strRAcmd = ":Sr" + utilities.HoursToHMS(RightAscension, ":" , ":" )
765
- Dim strDeccmd = utilities.DegreesToDMS(Declination, "*" , ":" , "" )
766
- If Declination < 0 Then
767
- strDeccmd = "-" + strDeccmd
768
- Else
769
- strDeccmd = "+" + strDeccmd
770
- End If
771
- strDeccmd = ":Sd" + strDeccmd
772
- TL.LogMessage( "SlewToCoordinatesRACmd" , strRAcmd)
773
- TL.LogMessage( "SlewToCoordinatesDecCmd" , strDeccmd)
774
- If CommandString(strRAcmd) = "1" Then
775
- If CommandString(strDeccmd) = "1" Then
776
- CommandString( ":MS" )
766
+ If RightAscension <= 24 And RightAscension >= 0 And Declination >= - 90 And Declination <= 90 Then
767
+
768
+ If Not AtPark Then
769
+ TL.LogMessage( "SlewToCoordinates" , "RA " + RightAscension.ToString + ", Dec " + Declination.ToString)
770
+ Dim strRAcmd = ":Sr" + utilities.HoursToHMS(RightAscension, ":" , ":" )
771
+ Dim strDeccmd = utilities.DegreesToDMS(Declination, "*" , ":" , "" )
772
+ If Declination < 0 Then
773
+ strDeccmd = "-" + strDeccmd
774
+ Else
775
+ strDeccmd = "+" + strDeccmd
777
776
End If
777
+ strDeccmd = ":Sd" + strDeccmd
778
+ TL.LogMessage( "SlewToCoordinatesRACmd" , strRAcmd)
779
+ TL.LogMessage( "SlewToCoordinatesDecCmd" , strDeccmd)
780
+ If CommandString(strRAcmd) = "1" Then
781
+ If CommandString(strDeccmd) = "1" Then
782
+ CommandString( ":MS" )
783
+ End If
778
784
785
+ End If
786
+ Else
787
+ TL.LogMessage( "SlewToCoordinates" , "Parked" )
788
+ Throw New ASCOM.ParkedException( "SlewToCoordinates" )
779
789
End If
780
790
Else
781
- TL.LogMessage( "SlewToCoordinates" , "Parked" )
782
- Throw New ASCOM.ParkedException ( "SlewToCoordinates" )
791
+ TL.LogMessage( "SlewToCoordinates" , "Invalid coordinates RA: " + RightAscension.ToString + ", Dec: " + Declination.ToString )
792
+ Throw New ASCOM.InvalidValueException ( "SlewToCoordinates" )
783
793
End If
784
-
785
-
786
794
End Sub
787
795
788
796
Public Sub SlewToCoordinatesAsync(RightAscension As Double , Declination As Double ) Implements ITelescopeV3.SlewToCoordinatesAsync
@@ -797,7 +805,7 @@ Public Class Telescope
797
805
End Sub
798
806
799
807
Public Sub SlewToTargetAsync() Implements ITelescopeV3.SlewToTargetAsync
800
- TL.LogMessage( " Public Sub SlewToTargetAsync() Implements ITelescopeV3. SlewToTargetAsync" , "Not implemented" )
808
+ TL.LogMessage( "SlewToTargetAsync" , "Not implemented" )
801
809
Throw New ASCOM.MethodNotImplementedException( "SlewToTargetAsync" )
802
810
End Sub
803
811
@@ -867,8 +875,9 @@ Public Class Telescope
867
875
868
876
Public Property TrackingRate() As DriveRates Implements ITelescopeV3.TrackingRate
869
877
Get
870
- TL.LogMessage( "TrackingRate Get" , "Not implemented" )
871
- Throw New ASCOM.PropertyNotImplementedException( "TrackingRate" , False )
878
+ TL.LogMessage( "TrackingRate Get" , DriveRates.driveSidereal.ToString)
879
+ Return DriveRates.driveSidereal
880
+ ' Throw New ASCOM.PropertyNotImplementedException("TrackingRate", False)
872
881
End Get
873
882
Set (value As DriveRates)
874
883
TL.LogMessage( "TrackingRate Set" , "Not implemented" )
0 commit comments