Sharpcap v.4.1.12371.0 (X64, 64 bit), Windows 11 - up-to-date with patching, my own mount driver with ASCOM7 RC2 installed.
I've been trying to track down a mount issue that flashes up when using the left/right arrows. The logs are reporting that the mount is throwing an exception that Tracking can not be Set during a slew, but this only impacts the azimuth axis, not the elevation (mount is Alt-Az).
I have a 2 second settling time configured for the mount right now, so I expect my driver to report Slewing as true for 2 seconds beyond the release of the arrows.
To start off with, here is the logged error:
Here is the equivalent sequence of orders from Sharpcap for movement about the secondary axis:Verbose 11:05:40.757210 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.MoveAxis :: Starting MoveAxis(Primary, 0)
Verbose 11:05:40.797993 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.MoveAxis :: Completed (returned null) MoveAxis(Primary, 0)
Verbose 11:05:40.798016 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Tracking :: Starting get_Tracking()
Verbose 11:05:40.809403 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Tracking :: Completed (returned False) get_Tracking()
Verbose 11:05:40.809704 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.set_Tracking :: Starting set_Tracking(True)
Warning 11:05:40.846065 #13 Exception from SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.set_Tracking(True) : Exception of type 'TargetInvocationException' : Exception has been thrown by the target of an invocation.
Stack Trace: at object System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(object obj, Span<object> copyOfArgs, BindingFlags invokeAttr)
at object System.Reflection.MethodBaseInvoker.InvokeWithOneArg(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
at object SharpCap.Base.Utilities.LoggingProxyBase.Invoke(MethodInfo targetMethod, object[] args) in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/Utilities/LoggingProxy.cs:line 25 in void SharpCap.Base.Utilities.LoggingProxyBase.LogException(MethodInfo targetMethod, object[] args, Exception exception)
Warning 11:05:40.846187 #13 Inner Exception : ASCOM.InvalidOperationException: Cannot change tracking state while slewing.
at void ASCOM.Com.DriverAccess.DynamicAccess.CheckDotNetExceptions(string memberName, Exception e)
at bool ASCOM.Com.DriverAccess.DynamicAccess.TrySetMember(SetMemberBinder binder, object value)
at object CallSite.Target(Closure, CallSite, object, bool)
at TRet System.Dynamic.UpdateDelegates.UpdateAndExecute2<T0, T1, TRet>(CallSite site, T0 arg0, T1 arg1)
at void ASCOM.Com.DriverAccess.Telescope.set_Tracking(bool value)
at void SharpCap.MountProxy.ASCOM.MountInterceptionProxy.set_Tracking(bool value) in C:/Documents/Source Code/SharpCap/src/SharpCap.MountProxy.ASCOM/MountInterceptionProxy.cs:line 442
at object RuntimeMethodHandle.InvokeMethod(object target, Void** arguments, Signature sig, bool isConstructor)
at object System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(object obj, Span<object> copyOfArgs, BindingFlags invokeAttr) in void SharpCap.Base.Utilities.LoggingProxyBase.LogException(MethodInfo targetMethod, object[] args, Exception exception)
Debug 11:05:40.849355 #1 Notification (Status=Warning): SharpCap is having problems with your Track The Stars TTS-160. Currently retrying operation. in void SharpCap.UI.NotificationViewModel.DisplayMessage(NotificationMessage message)
Verbose 11:05:40.908528 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Tracking :: Starting get_Tracking()
Verbose 11:05:40.919768 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Tracking :: Completed (returned False) get_Tracking()
Verbose 11:05:40.930518 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Slewing :: Starting get_Slewing()
Verbose 11:05:40.970357 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Slewing :: Completed (returned True) get_Slewing()
You can see that there is no immediate set_Tracking order in the secondary axis after the stop movement order is returned. I believe the immediate set_Tracking is a bug.Verbose 11:05:34.577746 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.MoveAxis :: Starting MoveAxis(Secondary, 0)
Verbose 11:05:34.605515 #13 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.MoveAxis :: Completed (returned null) MoveAxis(Secondary, 0)
Verbose 11:05:34.638203 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Tracking :: Starting get_Tracking()
Verbose 11:05:34.648812 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Tracking :: Completed (returned False) get_Tracking()
Verbose 11:05:34.659423 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Slewing :: Starting get_Slewing()
Verbose 11:05:34.690619 #16 Mount : SharpCap.MountProxy.ASCOM.IMountInterceptionProxy.get_Slewing :: Completed (returned True) get_Slewing()
ASCOM doesn't appear to proscribe setting a Tracking value during slewing, however in this case I believe the correct answer is for my driver to throw the exception rather than hold the execution of the set_Tracking command until the mount is in a condition to act as that adds some ambiguity from the client perspective, particularly as that is not an asynchronous method so I have no way to acknowledge the order and indicate it is in-process...is that the behavior you would expect?