Search found 63 matches

by 1CM69
Mon Aug 20, 2018 9:22 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Probably best to post your whole script then so we can have a look at the whole thing. cheers, Robin Hi Robin, here is my script as it stands & by no means finished yet: GUI.txt Basically my attempt was to contain all the conditional if..elif..else statement in a separate function that I could ...
by 1CM69
Mon Aug 20, 2018 8:04 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

How about def get_EV(): exp = SharpCap.SelectedCamera.Controls.Exposure.ExposureMs/1000 if exp > 50: return str(format(exp, '.0f')) + "(s)" else: return str(exp) def btnLE_Click(self, sender, event): if SharpCap.SelectedCamera != None: self.lbl.LEv.Text = get_EV() else: SharpCap.ShowNotif...
by 1CM69
Mon Aug 20, 2018 3:14 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Slightly stuck again. I have got my new approach script working fine and am now trying to refine & tidy it up somewhat. I am attempting to create a custom function that can be used by 4 different button click events, the idea is to cut down drastically on the number of lines in my script. Howeve...
by 1CM69
Sun Aug 19, 2018 10:13 am
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Finally have it solved & working - sort of :| Looking over my previous code time & time again and not spotting the glaring error, doh! The ExpMax value of 2000000 I used for the TrackBar.Maximum value was the culprit. This value is the actual Max Exposure time of my selected camera but using...
by 1CM69
Sun Aug 19, 2018 9:38 am
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Kirk, In your OnChange method change this line: ExpVal = ExpMin + (val / 1000.0) to this: ExpVal = ExpMin + val Brian Hi Brian, yep, tried that but that solves the top end issue to the detriment of the bottom end. All low exposure time increment in whole numbers and instead of changing from 1500ms ...
by 1CM69
Sat Aug 18, 2018 4:00 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Right, so I changed the code around to get it to work as outlined in my last post & yes, it sort of works but there are still a number of limitations. I have found that the step changes using a mouse are strictly dependent on the width of the control i.e. the wider the control is the finer the s...
by 1CM69
Sat Aug 18, 2018 10:17 am
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

OK, I think I may have just had a brain wave *very painful* :lol: Either that or everything people have been saying has finally sunk!! I set the TrackBar.Minimum = 0 & TrackBar.Maximum = ExposureMaxMs I can then use an equation as: ExposureMs = (ExposureMinMs + (TrackBar.Value / 1000)) So in my ...
by 1CM69
Sat Aug 18, 2018 9:33 am
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Kirk, Robin and I are in agreement, we just used different examples. You need to set up the control so that you are notified of changes via a user function. Your function needs to convert the integer value to a floating value that is equivalent to the exposure in milliseconds or whatever units you ...
by 1CM69
Sat Aug 18, 2018 9:27 am
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Hi, OK, just got home from work & couldn't resist firing up the PC and giving this another go with a simple TrackBar Test script. Although this seems to have got me further along the path, it is still a way off working exactly as the slider in SharpCap. I have included set variables for Exposure...
by 1CM69
Sat Aug 18, 2018 1:05 am
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 12245

Re: Exposure & Gain

Kirk, An example would be this: Challenge: Use a TrackBar to select one of three colors: "Red", "Green" or "Blue" Solution: Create a Label control next to your TrackBar control and set the value to "Red". Define your TrackBar control's range from integer 1 th...