Oddball request

Anything that doesn't fit into any of the other forums
Post Reply
Simon2940
Posts: 9
Joined: Thu Aug 20, 2020 8:16 pm

Oddball request

#1

Post by Simon2940 »

Hello Mr Admin!

I have a request to be able to connect multiple focusers, so when using sharpcap, I can connect 2 focusers for different purposes.

I know this might sound like a specific for myself, but I would like to control 2 focus motors.

Long story short, one is to focus, and the other is to adjust something else. (Dont want to give away what im up to :lol: )
User avatar
admin
Site Admin
Posts: 17540
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Oddball request

#2

Post by admin »

Hi,

you can't do this via the SharpCap UI, but it is possible via the python scripting - not sure if that is any use to you...

To be more precise, SharpCap has the concept of the 'Selected Focuser' which appears in the UI (and in scripting via SharpCap.Focusers.SelectedFocuser), but all the other ASCOM focusers are also there in the scripting API, and you can connect to and operate with them from your script.

For instance, the following script will add two custom buttons 'F+' and 'F-' to the toolbar, which move the ascom simulator focuser plus or minus 20 points when pressed regardless of your current SharpCap focus configuration - they also bypass SharpCap's backlash handling by talking direct to the 'AscomFocuser' when requesting movements rather than going through SharpCap's own movement request which would add backlash handling.

Code: Select all


def findFocuser(name):
	for x in SharpCap.Focusers:
		if (x.Name == name):
			return x
	return None
	
deviceName = 'ASCOM Simulator Focuser Driver'
distance = 20

def MovePlus():
	f = findFocuser(deviceName)
	f.Connected = True
	f.AscomFocuser.Move(f.AscomFocuser.Position + distance)

def MoveMinus():
	f = findFocuser(deviceName)
	f.Connected = True
	f.AscomFocuser.Move(f.AscomFocuser.Position - distance)

SharpCap.AddCustomButton('F+', None, None, MovePlus)
SharpCap.AddCustomButton('F-', None, None, MoveMinus)

	
cheers,

Robin
Simon2940
Posts: 9
Joined: Thu Aug 20, 2020 8:16 pm

Re: Oddball request

#3

Post by Simon2940 »

I'll take a look at that method, thanks.

Just so you understand, i have a prototype for tuning a solar scope remotely using a ZWO EAF attached to the scope.

That's why i need another focuser controller
Post Reply