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:
Code: Select all
def get_Capture(self):
self.appendMessageText('Starting Capture Sequence...')
SharpCap.ShowNotification('Starting Capture Sequence...')
time.sleep(0.5)
SharpCap.ShowNotification('Moving Filter Wheel To LUMINANCE Position.')
self.appendMessageText('Moving Filter Wheel To LUMINANCE Position.')
SharpCap.Wheels.SelectedWheel.Position = 1
time.sleep(0.5)
for count in range(1,capSeq+1):
SharpCap.ShowNotification('Capturing LUMINANCE Channel: (' + str(count) + '/' + str(capSeq) + ')')
self.appendMessageText('Capturing LUMINANCE Channel: (' + str(count) + '/' + str(capSeq) + ')')
SharpCap.Wheels.SelectedWheel.Position = 1
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitType = capTYPE
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitValue = capTF
SharpCap.SelectedCamera.Controls.Exposure.Value = expL
SharpCap.SelectedCamera.Controls.Gain.Value = gainL
SharpCap.SelectedCamera.PrepareToCapture()
SharpCap.SelectedCamera.RunCapture()
while True:
if not SharpCap.SelectedCamera.Capturing :
break
time.sleep(0.5)
SharpCap.ShowNotification('Capturing RED Channel: (' + str(count) + '/' + str(capSeq) + ')')
self.appendMessageText('Capturing RED Channel: (' + str(count) + '/' + str(capSeq) + ')')
SharpCap.Wheels.SelectedWheel.Position = 2
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitType = capTYPE
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitValue = capTF
SharpCap.SelectedCamera.Controls.Exposure.Value = expR
SharpCap.SelectedCamera.Controls.Gain.Value = gainR
SharpCap.SelectedCamera.PrepareToCapture()
SharpCap.SelectedCamera.RunCapture()
while True:
if not SharpCap.SelectedCamera.Capturing :
break
time.sleep(0.5)
SharpCap.ShowNotification('Capturing GREEN Channel: (' + str(count) + '/' + str(capSeq) + ')')
self.appendMessageText('Capturing GREEN Channel: (' + str(count) + '/' + str(capSeq) + ')')
SharpCap.Wheels.SelectedWheel.Position = 3
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitType = capTYPE
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitValue = capTF
SharpCap.SelectedCamera.Controls.Exposure.Value = expG
SharpCap.SelectedCamera.Controls.Gain.Value = gainG
SharpCap.SelectedCamera.PrepareToCapture()
SharpCap.SelectedCamera.RunCapture()
while True:
if not SharpCap.SelectedCamera.Capturing :
break
time.sleep(0.5)
SharpCap.ShowNotification('Capturing BLUE Channel: (' + str(count) + '/' + str(capSeq) + ')')
self.appendMessageText('Capturing BLUE Channel: (' + str(count) + '/' + str(capSeq) + ')')
SharpCap.Wheels.SelectedWheel.Position = 4
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitType = capTYPE
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitValue = capTF
SharpCap.SelectedCamera.Controls.Exposure.Value = expB
SharpCap.SelectedCamera.Controls.Gain.Value = gainB
SharpCap.SelectedCamera.PrepareToCapture()
SharpCap.SelectedCamera.RunCapture()
while True:
if not SharpCap.SelectedCamera.Capturing :
break
time.sleep(0.5)
SharpCap.ShowNotification('Moving Filter Wheel To LUMINANCE Position.')
self.appendMessageText('Moving Filter Wheel To LUMINANCE Position.')
SharpCap.Wheels.SelectedWheel.Position = 1
time.sleep(0.5)
if count == capSeq:
SharpCap.ShowNotification('Capture Sequence Finished.')
#break
Any help would be great.
Cheers..,
Kirk