You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MyBase.New(True,True,True,True,False,True,False)' Set flags for this device: HasCanProperties, HasProperties, HasMethods, PreRunCheck, PreConnectCheck, PerformanceCheck, PostRunCheck
48
+
MyBase.New(True,True,True,True,False,True,True)' Set flags for this device: HasCanProperties, HasProperties, HasMethods, PreRunCheck, PreConnectCheck, PerformanceCheck, PostRunCheck
45
49
EndSub
46
50
47
51
' IDisposable
@@ -230,30 +234,122 @@ Friend Class RotatorTester
230
234
231
235
PublicOverridesSubPreRunCheck()
232
236
Diml_NowAsDate
233
-
'Get the rotator into a standard state
237
+
238
+
' Initialise to the unknown position value
239
+
initialPosiiton=ROTATOR_POSITION_UNKNOWN
234
240
g_Stop=True
235
-
LogCallToDriver("PreRunCheck","About to call Halt method")
241
+
242
+
' Get the rotator into a standard state
243
+
LogCallToDriver("PreRun Check","About to call Halt method")
236
244
Try:m_Rotator.Halt():Catch:EndTry'Stop any movement
245
+
246
+
' Confirm that rotator is not moving or wait for it to stop
237
247
l_Now=Now
238
-
Try'Confirm that rotator is not moving or wait for it to stop
248
+
Try
239
249
Status(StatusType.staAction,"Waiting up to "&ROTATOR_WAIT_LIMIT&" seconds for rotator to stop moving")
240
-
LogCallToDriver("CanReverse","About to get IsMoving property repeatedly")
250
+
LogCallToDriver("PreRun Check","About to get IsMoving property repeatedly")
IfNotm_Rotator.IsMovingThen'Rotator is stopped so OK
247
257
g_Stop=False'Clear stop flag to allow other tests to run
258
+
LogMsg("Pre-run Check",MessageLevel.msgOK,"Rotator is stationary")
259
+
260
+
' Try to record the current position of the rotator so that it can be restored after testing. If this fails the initial position will be set to unknown value.
261
+
Try
262
+
LogCallToDriver("PreRun Check","About to get Position property")
' Restore the initial position of the rotator if possible
295
+
IfinitialPosiiton=ROTATOR_POSITION_UNKNOWNThen
296
+
' The initial position could not be determined so log a message to this effect.
297
+
LogMsg("Post-run Check",MessageLevel.msgNone,"The rotator's initial position could not be determined so it is not possible to restore it's initial position.")
298
+
Else
299
+
' We have a valid initial position so attempt to reset the rotator to this position.
300
+
Try
301
+
' Get the current position
302
+
LogCallToDriver("Post-run Check", $"About to get Position property")
IfNotm_Rotator.IsMovingThen'Rotator is stopped so OK
342
+
LogMsg("Post-run Check",MessageLevel.msgOK, $"Rotator starting position successfully restored to {initialPosiiton}")
343
+
Else'Report error message
344
+
LogMsg("Post-run Check",MessageLevel.msgError,"Unable to restore rotator starting position, the rotator is still moving after "&ROTATOR_WAIT_LIMIT&"seconds. Could IsMoving be stuck on?")
LogMsg("",MessageLevel.msgAlways,"***** CONFORM IS RUNNING WITH ADMIN PRIVILEGE!")
1271
+
LogMsg("",MessageLevel.msgAlways," ")
1272
+
LogMsg("",MessageLevel.msgAlways,"***** This increases the risk that malicious individuals will target you and cause havoc in your life.")
1273
+
LogMsg("",MessageLevel.msgAlways,"***** There is no need to run Conform with Admin privilege, the application is fully functional in normal user mode.")
1274
+
LogMsg("",MessageLevel.msgAlways,"***** Please close the Remote Server and re-open it in normal user mode.")
1275
+
LogMsg("",MessageLevel.msgAlways," ")
1276
+
DimchoiceAsDialogResult=MessageBox.Show("Close Conform because it is running as administrator.","Threat Management",MessageBoxButtons.YesNo,MessageBoxIcon.[Stop],MessageBoxDefaultButton.Button1)
IfASCOM.Utilities.ApplicationBits=Utilities.Bitness.Bits64Then' Check the 32bit registry on a 64bit system if we haven't found an executable yet
1638
+
IfUtilities.Global.ApplicationBits()=Utilities.Global.Bitness.Bits64Then' Check the 32bit registry on a 64bit system if we haven't found an executable yet
1618
1639
IfString.IsNullOrEmpty(FindDriverExecutable)Then' We are on a 64bit OS and haven't yet found an executable
1619
1640
LogMsg("FindDriverExecutable",MessageLevel.msgDebug,"We are a 64bit application and an executable has not yet been found, looking in 32bit registry")
1620
1641
'Using Reg As ASCOM.Utilities.RegistryAccess = New ASCOM.Utilities.RegistryAccess
0 commit comments