Check if Wheel is Connected
Posted: Thu Aug 30, 2018 8:22 am
Hi,
just trying out a simple piece of script to check if a Filter Wheel is connected but hit a small bump in the road.
the above works perfectly fine when ticking or unticking the 'Connected' checkbox but for belt & braces I would like to check just incase the USB cable has been removed/knocked out after ticking the 'Connected' checkbox because at the moment, if 'Connected' is checked & the USB cable is removed, SharpCap still assumes the device is connected & returns True.
Also found that the same happens when checking for camera connected:
You can connect to your camera as normal from the menu but then pull the USB cable out & SharpCap still thinks the camera is connected.
I realise that I can go down the 'Try/Except' route but before doing that, I thought that I may be missing a property somewhere.
regards..,
Kirk
just trying out a simple piece of script to check if a Filter Wheel is connected but hit a small bump in the road.
Code: Select all
import clr
clr.AddReference("SharpCap")
if SharpCap.Wheels.SelectedWheel.Connected != False:
SharpCap.ShowNotification('HAVE WHEEL')
else:
SharpCap.ShowNotification('NO WHEEL')
Also found that the same happens when checking for camera connected:
Code: Select all
if SharpCap.SelectedCamera != None:
SharpCap.ShowNotification('HAVE CAMERA')
else:
SharpCap.ShowNotification('NO CAMERA')
I realise that I can go down the 'Try/Except' route but before doing that, I thought that I may be missing a property somewhere.
regards..,
Kirk