Skip to content

Commit

Permalink
update timelapse
Browse files Browse the repository at this point in the history
  • Loading branch information
chepo92 committed Nov 28, 2018
1 parent cf21210 commit 90b599d
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions Source/Timelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
from Dialog import *
from Mapping import *
from NotePage import *
from tkinter import filedialog
import tkFileDialog as filedialog
import os
import sys
from time import sleep
import time
import datetime

class Timelapse ( BasicNotepage ):
def BuildPage ( self ):
Expand Down Expand Up @@ -189,14 +194,9 @@ def ToggleTL ( self ):
self.Started= not self.Started
if self.Started:
self.StartButton.configure(text='Stop')
self.LoopTimeLapse()
else:
self.StartButton.configure(text='Start')
self.camera.capture(str(self.Directory+self.BaseTxt.get()+self.ExtensionCombo.get()))
self.Started= not self.Started
if self.Started:
self.StartButton.configure(text='Stop')
else:
self.StartButton.configure(text='Start')
pass
def Clear ( self ):
pass
Expand All @@ -210,37 +210,38 @@ def StartDelayCapture ( self ):
def Reset ( self ):
pass

'''
Label(f,text='Custom name').grid(row=1,column=0,sticky='E')
self.Eexecute = Button(f,text='Ok',width=10, command=self.ReadEntry)
self.Eexecute.grid(row=1,column=3,sticky='W')
self.Button2 = Button(f,text='Clear',width=10, command=self.Clear)
self.Button2.grid(row=1,column=4,sticky='W')
self.LowLightCaptureButton = Button(f,text='Low Light',width=15, \
command=self.CaptureLowLight)
self.LowLightCaptureButton.grid(row=3,column=0,sticky='W')
self.StartDelayCaptureButton = Button(f,text='Delay Capture',width=15, \
command=self.StartDelayCapture)
self.StartDelayCaptureButton.grid(row=3,column=1,sticky='W')
self.combo = Combobox(f)
self.combo['values']= (1, 2, 3, 4, 5, "Text")
self.combo.current(1) #set the selected item
def LoopTimeLapse ( self ):
steps=int(self.EndTxt.get())
folder=str(self.Directory)
filename=self.BaseTxt.get()
interval=int(self.DelayTxt.get())
# Run the timelapse loop
for i in range(steps):

t1 = time.time()
print('Cycle ' + str(i))

#Side Light
# turn the side LEDs on
os.system('python turnONs.py')

datestr = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
fname = os.path.join(folder, datestr + "_" + filename + "_%04d.png"%(i))
self.camera.capture(fname, 'png')

#turn the LEDs off
os.system('python turnOFFs.py')

elapsed = time.time()-t1

# print some relevant information
print('Elapsed cycle time: ' + str(elapsed))
#e = self.camera.exposure_speed
#print('Effective camera shutter speed :' + str(e) + '\n')

self.combo.grid( row=4, column=0)
'''
sleep(interval-elapsed) ## waiting time between cycles
pass



Expand Down

0 comments on commit 90b599d

Please sign in to comment.