Exploring the API

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
sonata31
Posts: 57
Joined: Wed May 05, 2021 3:51 pm

Exploring the API

#1

Post by sonata31 »

Hello
In the documentation page 395 it is written

------------------------------
Exploring the API
The editor automatically shows the possible methods and properties for an object upon typing the '.' – this helps explore the available API.

-----------------------------

This doesn't work for me, why?

Thanks for your help
Louis
Monture : Rainbow Astro RST135E
Lunette : Takahashi FSQ106EDX4 + PegasusAstro FocusCube
Alnitak Flip-Flat
Caméra : ZWO ASI533MC + EFW
PC : PrimaLuceLab EAGLE4 PRO
Logiciels : SharpCap, ASTAP, PHD2
User avatar
admin
Site Admin
Posts: 13266
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Exploring the API

#2

Post by admin »

Hi Louis,

one thing to note is that this only works when the thing to the left of the dot is actually a valid object. So, for example, if you type

Code: Select all

SharpCap.SelectedCamera.
You should see a list of things that you can do with the selected camera - providing a camera is actually open at the time. If no camera is open then no suggestions will pop up.

cheers,

Robin
sonata31
Posts: 57
Joined: Wed May 05, 2021 3:51 pm

Re: Exploring the API

#3

Post by sonata31 »

Hello
I have two active cameras and yet nothing appears when I write
SharpCap.SelectedCamera.

Thanks for your help
Louis
Monture : Rainbow Astro RST135E
Lunette : Takahashi FSQ106EDX4 + PegasusAstro FocusCube
Alnitak Flip-Flat
Caméra : ZWO ASI533MC + EFW
PC : PrimaLuceLab EAGLE4 PRO
Logiciels : SharpCap, ASTAP, PHD2
sonata31
Posts: 57
Joined: Wed May 05, 2021 3:51 pm

Re: Exploring the API

#4

Post by sonata31 »

Hello
I just noticed that it works in the console zone but not in the pad zone which is the most important zone for a script that we want to save in a file

Thanks for your help
Louis
Monture : Rainbow Astro RST135E
Lunette : Takahashi FSQ106EDX4 + PegasusAstro FocusCube
Alnitak Flip-Flat
Caméra : ZWO ASI533MC + EFW
PC : PrimaLuceLab EAGLE4 PRO
Logiciels : SharpCap, ASTAP, PHD2
Jean-Francois
Posts: 381
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Exploring the API

#5

Post by Jean-Francois »

Hello Louis,

Yes, that is correct.
The "." trick works only on the console (upper part), but not in the script body (lower part).

So if you want to find or explore the function, then you need to copy it on the upper part.

The console and the pad are not a full editor with autocompletion capabilities.
I have no idea if possible to have it.

Note that the IronPython (stand alone) has not this capability.

Regards,
Jean-Francois
sonata31
Posts: 57
Joined: Wed May 05, 2021 3:51 pm

Re: Exploring the API

#6

Post by sonata31 »

Hello Jean-Franoois
Thank you for your reply
It's a bit laborious but we'll make do with it.
Louis
Monture : Rainbow Astro RST135E
Lunette : Takahashi FSQ106EDX4 + PegasusAstro FocusCube
Alnitak Flip-Flat
Caméra : ZWO ASI533MC + EFW
PC : PrimaLuceLab EAGLE4 PRO
Logiciels : SharpCap, ASTAP, PHD2
Post Reply