Object properties not showing

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
PetMei
Posts: 3
Joined: Thu May 10, 2018 6:08 pm

Object properties not showing

#1

Post by PetMei »

Hi All,

I'm brand-new to SharpCap, using it with my Celestron NexImage 10 both on NexStar and on a microscope.
I intended to somehow enhance the Display Histogram Stretch control (don't quite like the way the middle line (gamma) is moved when moving the left or right line).
So I tried to dig into Scripting to see which properties are defined and can be controlled, but in contrast to what Help states I do not get any automatic properties list when typing the '.' so I simply can't find out which properties of the SharpCap objects exist.
- Do I miss anything obvious?
- Is there a documentation available listing all objects and properties (a scripting reference manual)?
- Is it possible to control the three lines (black, white, gamma), i.e. get and set their position, of the Display Histogram Stretch control?
If so, a sample code snippet would be much appreciated.
My goal basically is to always have the middle line in the center of the left and right line when moving either of these, and of doing some repositioning with buttons instead of dragging with the mouse.

Cheers -
Peter
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Object properties not showing

#2

Post by admin »

Hi Peter,

the auto-suggestions really should work - they do for me in the latest 3.1 - for instance
Capture.PNG
Capture.PNG (19.54 KiB) Viewed 2346 times
The list appears as soon as I type the '.' after the Exposure. Note that it only works in the top panel in the script console and it only works if the thing to the left of the '.' is a valid object (ie not 'None').

You can adjust the level stretch with code like

Code: Select all

SharpCap.SelectedCamera.Controls.FindByName("Display Black Point").Value = 0.1
SharpCap.SelectedCamera.Controls.FindByName("Display MidTone Point").Value = 0.4
SharpCap.SelectedCamera.Controls.FindByName("Display White Point").Value = 0.9
however some values seem to work and others are rejected when making changes this way - looks like a bug in the latest 3.1. I will investigate.

cheers,

Robin
PetMei
Posts: 3
Joined: Thu May 10, 2018 6:08 pm

Re: Object properties not showing

#3

Post by PetMei »

Ah - in the top panel - I of course assumed that this happens in the coding panel like in other development systems - this is where you need this support in the first place.

Thanks for the hint!
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Object properties not showing

#4

Post by admin »

Hi,

it's because Python is a dynamically typed language - telling what properties/methods an object has is hard unless you have an object available and you can ask it. Therefore it works in the immediate panel, but can't work in the editor panel.

cheers,

Robin
PetMei
Posts: 3
Joined: Thu May 10, 2018 6:08 pm

Re: Object properties not showing

#5

Post by PetMei »

Ah - understood.

So now I klicked through the object hierarchy (at least the entities which seemed fitting) but could not find how to address the Display Histogram Stretch control. Any hints?

Cheers -
Peter
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Object properties not showing

#6

Post by admin »

Hi, it's the code at the bottom of my first reply. There are actually three separate controls for the black white and mid points.

BTW I uploaded a new version that fixes the problem with some values not be accepted via scripting.

Btw2 I am assuming you are trying to adjust the level stretch in the right control panel, not the live stack one.

Robin
Post Reply