Merge pull request #284 from jcosmo/timelapse_spelling
timelaps -> timelapse
This commit is contained in:
commit
a4f4b7ae0e
2 changed files with 13 additions and 13 deletions
|
@ -280,7 +280,7 @@ class printWindow(wx.Frame):
|
||||||
sizer = wx.GridBagSizer(2, 2)
|
sizer = wx.GridBagSizer(2, 2)
|
||||||
self.camPage.SetSizer(sizer)
|
self.camPage.SetSizer(sizer)
|
||||||
|
|
||||||
self.timelapsEnable = wx.CheckBox(self.camPage, -1, 'Enable timelaps movie recording')
|
self.timelapsEnable = wx.CheckBox(self.camPage, -1, 'Enable timelapse movie recording')
|
||||||
sizer.Add(self.timelapsEnable, pos=(0, 0), span=(1, 2), flag=wx.EXPAND)
|
sizer.Add(self.timelapsEnable, pos=(0, 0), span=(1, 2), flag=wx.EXPAND)
|
||||||
|
|
||||||
pages = self.cam.propertyPages()
|
pages = self.cam.propertyPages()
|
||||||
|
@ -443,7 +443,7 @@ class printWindow(wx.Frame):
|
||||||
return
|
return
|
||||||
self.currentZ = -1
|
self.currentZ = -1
|
||||||
if self.cam != None and self.timelapsEnable.GetValue():
|
if self.cam != None and self.timelapsEnable.GetValue():
|
||||||
self.cam.startTimelaps(self.filename[: self.filename.rfind('.')] + ".mpg")
|
self.cam.startTimelapse(self.filename[: self.filename.rfind('.')] + ".mpg")
|
||||||
self.machineCom.printGCode(self.gcodeList)
|
self.machineCom.printGCode(self.gcodeList)
|
||||||
self.UpdateButtonStates()
|
self.UpdateButtonStates()
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ class printWindow(wx.Frame):
|
||||||
def mcStateChange(self, state):
|
def mcStateChange(self, state):
|
||||||
if self.machineCom != None:
|
if self.machineCom != None:
|
||||||
if state == self.machineCom.STATE_OPERATIONAL and self.cam != None:
|
if state == self.machineCom.STATE_OPERATIONAL and self.cam != None:
|
||||||
self.cam.endTimelaps()
|
self.cam.endTimelapse()
|
||||||
if state == self.machineCom.STATE_OPERATIONAL:
|
if state == self.machineCom.STATE_OPERATIONAL:
|
||||||
taskbar.setBusy(self, False)
|
taskbar.setBusy(self, False)
|
||||||
if self.machineCom.isClosedOrError():
|
if self.machineCom.isClosedOrError():
|
||||||
|
|
|
@ -55,7 +55,7 @@ class webcam(object):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self._doTimelaps = False
|
self._doTimelapse = False
|
||||||
self._bitmap = None
|
self._bitmap = None
|
||||||
|
|
||||||
def hasCamera(self):
|
def hasCamera(self):
|
||||||
|
@ -115,7 +115,7 @@ class webcam(object):
|
||||||
|
|
||||||
self._bitmap = bitmap
|
self._bitmap = bitmap
|
||||||
|
|
||||||
if self._doTimelaps:
|
if self._doTimelapse:
|
||||||
filename = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../__tmp_snap",
|
filename = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../__tmp_snap",
|
||||||
"__tmp_snap_%04d.jpg" % (self._snapshotCount)))
|
"__tmp_snap_%04d.jpg" % (self._snapshotCount)))
|
||||||
self._snapshotCount += 1
|
self._snapshotCount += 1
|
||||||
|
@ -126,24 +126,24 @@ class webcam(object):
|
||||||
def getLastImage(self):
|
def getLastImage(self):
|
||||||
return self._bitmap
|
return self._bitmap
|
||||||
|
|
||||||
def startTimelaps(self, filename):
|
def startTimelapse(self, filename):
|
||||||
if self._cam == None:
|
if self._cam == None:
|
||||||
return
|
return
|
||||||
self._cleanTempDir()
|
self._cleanTempDir()
|
||||||
self._timelapsFilename = filename
|
self._timelapseFilename = filename
|
||||||
self._snapshotCount = 0
|
self._snapshotCount = 0
|
||||||
self._doTimelaps = True
|
self._doTimelapse = True
|
||||||
print "startTimelaps"
|
print "startTimelapse"
|
||||||
|
|
||||||
def endTimelaps(self):
|
def endTimelapse(self):
|
||||||
if self._doTimelaps:
|
if self._doTimelapse:
|
||||||
ffmpeg = getFFMPEGpath()
|
ffmpeg = getFFMPEGpath()
|
||||||
basePath = os.path.normpath(
|
basePath = os.path.normpath(
|
||||||
os.path.join(os.path.split(__file__)[0], "../__tmp_snap", "__tmp_snap_%04d.jpg"))
|
os.path.join(os.path.split(__file__)[0], "../__tmp_snap", "__tmp_snap_%04d.jpg"))
|
||||||
subprocess.call(
|
subprocess.call(
|
||||||
[ffmpeg, '-r', '12.5', '-i', basePath, '-vcodec', 'mpeg2video', '-pix_fmt', 'yuv420p', '-r', '25', '-y',
|
[ffmpeg, '-r', '12.5', '-i', basePath, '-vcodec', 'mpeg2video', '-pix_fmt', 'yuv420p', '-r', '25', '-y',
|
||||||
'-b:v', '1500k', '-f', 'vob', self._timelapsFilename])
|
'-b:v', '1500k', '-f', 'vob', self._timelapseFilename])
|
||||||
self._doTimelaps = False
|
self._doTimelapse = False
|
||||||
|
|
||||||
def _cleanTempDir(self):
|
def _cleanTempDir(self):
|
||||||
basePath = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../__tmp_snap"))
|
basePath = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../__tmp_snap"))
|
||||||
|
|
Loading…
Reference in a new issue