Search found 63 matches

by 1CM69
Fri Aug 24, 2018 9:14 pm
Forum: Scripting
Topic: Can Anyone See The Bug Here?
Replies: 5
Views: 982

Can Anyone See The Bug Here?

Hi, I've spent most of the day debugging my script but to no avail. Lots of errors have been rectified, mostly pertaining to INDENTS but still I cannot see what else I am missing. It's really strange because I have a working script version but now I have built a GUI around this script, it is failing...
by 1CM69
Fri Aug 24, 2018 8:30 pm
Forum: Scripting
Topic: CaptureLimitValue now missing
Replies: 9
Views: 1513

CaptureLimitValue now missing

Hi, I've been going around in circles trying to debug a script & I have finally narrowed it down, I think. I have been using: SharpCap.SelectedCamera.CaptureConfig.CaptureLimitValue to programmatically limit the Camera Capture in seconds, i.e.: SharpCap.SelectedCamera.CaptureConfig.CaptureLimitValue...
by 1CM69
Fri Aug 24, 2018 3:59 pm
Forum: Scripting
Topic: ERROR: Local variable 'count' referenced before assignment
Replies: 5
Views: 903

Re: ERROR: Local variable 'count' referenced before assignment

Like an idiot, I forgot that the Value of NumericUpDown is Decimal.

Solved that issue now:

Code: Select all

capSeq = int(float(NumericUpDown.Value))
Cheers..,

Kirk
by 1CM69
Fri Aug 24, 2018 3:32 pm
Forum: Scripting
Topic: ERROR: Local variable 'count' referenced before assignment
Replies: 5
Views: 903

Re: ERROR: Local variable 'count' referenced before assignment

oopfan wrote:
Fri Aug 24, 2018 3:22 pm
Try printing out 'capSeq'
Just going through things one by one & tried as you said, it's showing a value of 0

Attempting to correct it now.

Cheers..,

Kirk
by 1CM69
Fri Aug 24, 2018 3:03 pm
Forum: Scripting
Topic: ERROR: Local variable 'count' referenced before assignment
Replies: 5
Views: 903

Re: ERROR: Local variable 'count' referenced before assignment

Kirk, Indentation is very important in Python. It is not obvious to me nor Python what you want to do in that for-loop. Brian Hi Brian, thanks for the quick reply. Seems like the issue as you say is indentation. I copied the bulk of that code from a working testbed script & pasted it in my final sc...
by 1CM69
Fri Aug 24, 2018 2:40 pm
Forum: Scripting
Topic: ERROR: Local variable 'count' referenced before assignment
Replies: 5
Views: 903

ERROR: Local variable 'count' referenced before assignment

Hi, got a small sticking point on my script with the ERROR: Local variable 'count' referenced before assignment. Can't seem to find out what is wrong because the variable 'count' is nowhere else in my script except this one single function: def get_Capture(self): self.appendMessageText('Starting Cap...
by 1CM69
Wed Aug 22, 2018 9:57 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 4225

Re: Exposure & Gain

I must say, I quite like python apart from the clunky forced use of 'self' for OO concepts - it's definitely a pitfall for programmers coming from languages with a more seamless OO concept. It would be quite cool to have C# scripting in the application as well as python scripting. There are things ...
by 1CM69
Tue Aug 21, 2018 9:05 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 4225

Re: Exposure & Gain

Note both the self.get_EV() and the (self) parameter to the get_EV method. All seems a bit clunky from a C++/C# point of view, but that's the way Python works.... Actually Python is a cool language. What Kirk ought to do is to put get_EV() in global scope. He currently has it as a member function o...
by 1CM69
Tue Aug 21, 2018 6:12 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 4225

Re: Exposure & Gain

Hi Kirk, I think this is what you need def get_EV(self): 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.lblLEv.Text = self.get_EV...
by 1CM69
Mon Aug 20, 2018 9:57 pm
Forum: Scripting
Topic: Exposure & Gain
Replies: 32
Views: 4225

Re: Exposure & Gain

OK, sorry. I’m away from my PC now but basically that test script is identical to the txt file I’ve just posted except I have pasted over the def btnLE_Click section with the second lot of code wrapped in the <code> block from my earlier post including the get_EV function. If you do need me to post ...