Web Server

Discussions on extending SharpCap using the built in Python scripting functionality
User avatar
admin
Site Admin
Posts: 13529
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Web Server

#41

Post by admin »

Hi,

I managed to pop in some python scripting API for this in the new update.

Code: Select all

print (SharpCap.PolarAlignment.IsActive)
print (SharpCap.PolarAlignment.Stage)
print (SharpCap.PolarAlignment.CanAdvance)
SharpCap.PolarAlignment.AutoAdvance = False
SharpCap.PolarAlignment.Advance()
print (SharpCap.PolarAlignment.Offset)
SharpCap.PolarAlignment.Reset()
Hopefully this should cover what you need - if not, let me know

Robin
metastable
Posts: 48
Joined: Thu Oct 26, 2023 1:24 am

Re: Web Server

#42

Post by metastable »

Hey Robin,

Truly an early Christmas present! Thanks for this. I'll try this out today and report back.

Thanks,
Alejandro
metastable
Posts: 48
Joined: Thu Oct 26, 2023 1:24 am

Re: Web Server

#43

Post by metastable »

Hey Robin,

The weather has been terrible the past couple days, but I was able to test against some previous images I took for just this occasion and so far, the new functions are working great! Might be awhile before I can test this during an actual session, but I don't foresee any reason what you added won't solve the issue I was running into before.

Thanks,
Alejandro
metastable
Posts: 48
Joined: Thu Oct 26, 2023 1:24 am

Re: Web Server

#44

Post by metastable »

Hey Robin,

I've been adding a little more to my app recently and was looking for a way to stop and start Live View. I see there is SharpCap.SelectedCamera.LiveView and the intellisense shows I should be able to set it, but it gives me a NotImplementedError exception. Is there another way I could accomplish this?

Thanks,
Alejandro
Jean-Francois
Posts: 417
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Web Server

#45

Post by Jean-Francois »

Hello Alejandro,

Sometimes it is simple to test it ... and it works :-)

If you use only "SharpCap.SelectedCamera.LiveView", then it gives you back the status.
"True" for the LiveView is active or "False" if not so Still mode.
If you use "SharpCap.SelectedCamera.LiveView = False" then it will turn in Still mode
and "SharpCap.SelectedCamera.LiveView = True" then it will activate the LiveView.

Regards,
Jean-Francois
Jean-Francois
Posts: 417
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Web Server

#46

Post by Jean-Francois »

One point more ... a camera shall be selected before.
If not then you will have an error.
metastable
Posts: 48
Joined: Thu Oct 26, 2023 1:24 am

Re: Web Server

#47

Post by metastable »

Hey Jean-Francois,

How do you think I figured out what exception it was giving? ;)
>>> SharpCap.SelectedCamera.LiveView = False
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: The method or operation is not implemented
I did some more testing, and it seems that DirectShow Cameras (my webcam that I was testing with) do not support going into Still Mode, hence the above method giving an error. I connected my 120MM and things work as expected. So, no issues for my actual use case.

Thanks,
Alejandro
metastable
Posts: 48
Joined: Thu Oct 26, 2023 1:24 am

Re: Web Server

#48

Post by metastable »

Did some more testing and seeing some weird results. I tried using CanRunInStillMode to determine what can and cannot be switched to Still Mode and it looks like it's not reporting back correctly.

Code: Select all

>>> SharpCap.SelectedCamera
<SharpCap.Models.Camera object at 0x000000000000002B [ZWO ASI Cameras::ZWO ASI120MM Mini]>
>>> SharpCap.SelectedCamera.CanRunInStillMode
False
>>> SharpCap.SelectedCamera.LiveView = False
>>> 
Setting LiveView to False on this one does work although CanRunStillMode says otherwise :lol: Not a big deal as this doesn't block my work but I thought it interesting.
Post Reply