@@ -60,21 +60,28 @@ Public Class Telescope
60
60
61
61
Friend Shared comPortProfileName As String = "COM Port" 'Constants used for Profile persistence
62
62
Friend Shared traceStateProfileName As String = "Trace Level"
63
+ Friend Shared latitudeProfileName As String = "Latitude"
64
+ Friend Shared longitudeProfileName As String = "Longitude"
65
+
63
66
Friend Shared comPortDefault As String = "COM1"
64
67
Friend Shared traceStateDefault As String = "False"
68
+ Friend Shared latitudeDefault As Double = 39.8283
69
+ Friend Shared longitudeDefault As Double = - 98.5795
65
70
66
71
Friend Shared comPort As String ' Variables to hold the currrent device configuration
67
72
Friend Shared portNum As String
68
73
Friend Shared traceState As Boolean
74
+ Friend Shared latitude As Double
75
+ Friend Shared longitude As Double
69
76
70
77
Private connectedState As Boolean ' Private variable to hold the connected state
71
78
Private utilities As Util ' Private variable to hold an ASCOM Utilities object
72
79
Private astroUtilities As AstroUtils ' Private variable to hold an AstroUtils object to provide the Range method
73
80
Private TL As TraceLogger ' Private variable to hold the trace logger object (creates a diagnostic log file with information that you specify)
74
81
Private objSerial As ASCOM.Utilities.Serial
75
82
Private isParked As Boolean = False
76
-
77
83
Dim mutexBlind As Mutex, mutexCommand As Mutex
84
+ ' Dim pierSide As Integer = 1
78
85
79
86
'
80
87
' Constructor - Must be public for COM registration!
@@ -638,17 +645,33 @@ Public Class Telescope
638
645
639
646
Public Property SideOfPier() As PierSide Implements ITelescopeV3.SideOfPier
640
647
Get
641
- TL.LogMessage( "SideOfPier Get" , "Not implemented" )
642
- Throw New ASCOM.PropertyNotImplementedException( "SideOfPier" , False )
648
+ Dim retVal As PierSide
649
+ If SiderealTime < 12 Then
650
+ If RightAscension >= SiderealTime And RightAscension <= SiderealTime + 12 Then
651
+ retVal = PierSide.pierWest
652
+ Else
653
+ retVal = PierSide.pierEast
654
+ End If
655
+ Else
656
+ If RightAscension <= SiderealTime And RightAscension >= SiderealTime - 12 Then
657
+ retVal = PierSide.pierEast
658
+ Else
659
+ retVal = PierSide.pierWest
660
+ End If
661
+ End If
662
+ TL.LogMessage( "SideOfPier Get" , retVal.ToString)
663
+ Return retVal
643
664
End Get
644
665
Set (value As PierSide)
645
- TL.LogMessage( "SideOfPier Set" , "Not implemented" )
666
+ ' TL.LogMessage("SideOfPier Set", value.ToString)
667
+ ' pierSide = value
668
+ TL.LogMessage( "SideOfPier Set" , "Not Implemented" )
646
669
Throw New ASCOM.PropertyNotImplementedException( "SideOfPier" , True )
647
670
End Set
648
671
End Property
649
672
650
673
Public ReadOnly Property SiderealTime() As Double Implements ITelescopeV3.SiderealTime
651
- ' ToDo - Does this do what I think it does? If so LatLong just became handy for calculating Hour Angle of Polaris
674
+
652
675
Get
653
676
' now using novas 3.1
654
677
Dim lst As Double = 0.0
@@ -674,8 +697,10 @@ Public Class Telescope
674
697
675
698
Public Property SiteElevation() As Double Implements ITelescopeV3.SiteElevation
676
699
Get
677
- TL.LogMessage( "SiteElevation Get" , "Not implemented" )
678
- Throw New ASCOM.PropertyNotImplementedException( "SiteElevation" , False )
700
+ TL.LogMessage( "SiteElevation Get" , "0 - Hardcoded" )
701
+ ' Used by SiderealTIme
702
+ ' Throw New ASCOM.PropertyNotImplementedException("SiteElevation", False)
703
+ Return 0
679
704
End Get
680
705
Set (value As Double )
681
706
TL.LogMessage( "SiteElevation Set" , "Not implemented" )
@@ -686,8 +711,10 @@ Public Class Telescope
686
711
Public Property SiteLatitude() As Double Implements ITelescopeV3.SiteLatitude
687
712
' ToDo Can we handle this entirely here, wihtout bothering the mount?
688
713
Get
689
- TL.LogMessage( "SiteLatitude Get" , "Not implemented" )
690
- Throw New ASCOM.PropertyNotImplementedException( "SiteLatitude" , False )
714
+ ' Used by SiderealTime
715
+ ' Throw New ASCOM.PropertyNotImplementedException("SiteLatitude", False)
716
+ TL.LogMessage( "SiteLatitude Get" , latitude.ToString)
717
+ Return latitude
691
718
End Get
692
719
Set (value As Double )
693
720
TL.LogMessage( "SiteLatitude Set" , "Not implemented" )
@@ -698,8 +725,10 @@ Public Class Telescope
698
725
Public Property SiteLongitude() As Double Implements ITelescopeV3.SiteLongitude
699
726
' ToDo Can we handle this entirely here, wihtout bothering the mount?
700
727
Get
701
- TL.LogMessage( "SiteLongitude Get" , "Not implemented" )
702
- Throw New ASCOM.PropertyNotImplementedException( "SiteLongitude" , False )
728
+ ' We should be able to not implment this, but SGP (any others?) breaks if we don't. Will confirm and log issue with MSS
729
+ ' Throw New ASCOM.PropertyNotImplementedException("SiteLongitude", False)
730
+ TL.LogMessage( "SiteLongitude Get" , longitude.ToString)
731
+ Return longitude
703
732
End Get
704
733
Set (value As Double )
705
734
TL.LogMessage( "SiteLongitude Set" , "Not implemented" )
@@ -939,6 +968,8 @@ Public Class Telescope
939
968
driverProfile.DeviceType = "Telescope"
940
969
traceState = Convert.ToBoolean(driverProfile.GetValue(driverID, traceStateProfileName, String .Empty, traceStateDefault))
941
970
comPort = driverProfile.GetValue(driverID, comPortProfileName, String .Empty, comPortDefault)
971
+ latitude = driverProfile.GetValue(driverID, latitudeProfileName, String .Empty, latitudeDefault)
972
+ longitude = driverProfile.GetValue(driverID, longitudeProfileName, String .Empty, longitudeDefault)
942
973
End Using
943
974
End Sub
944
975
@@ -950,6 +981,8 @@ Public Class Telescope
950
981
driverProfile.DeviceType = "Telescope"
951
982
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString())
952
983
driverProfile.WriteValue(driverID, comPortProfileName, comPort.ToString())
984
+ driverProfile.WriteValue(driverID, latitudeProfileName, latitude.ToString())
985
+ driverProfile.WriteValue(driverID, longitudeProfileName, longitude.ToString())
953
986
End Using
954
987
955
988
End Sub
0 commit comments