本文整理汇总了Python中session.Session.addRun方法的典型用法代码示例。如果您正苦于以下问题:Python Session.addRun方法的具体用法?Python Session.addRun怎么用?Python Session.addRun使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类session.Session
的用法示例。
在下文中一共展示了Session.addRun方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Recorder
# 需要导入模块: from session import Session [as 别名]
# 或者: from session.Session import addRun [as 别名]
#.........这里部分代码省略.........
- setup server
- setup timer (if no eternity is toggled)
- setup progress bar
- setup buttons
- setup session
- start recorder
'''
#setup server
self.server.exitFlag = False
try:
self.startTime = datetime.now()
self.server.start()
except:
print("something went wrong")
self.server.exitFlag = True
raise socket.timeout("Could not connect to Delsys Station")
else:
if self.showRunMeta.ui.cbEternity.checkState() == 0:
duration = self.showRunMeta.ui.timeEdit.time()
d = duration.second() + duration.minute()*60
self.runPinger.start(d*1000)
self.ui.elapsedTime.setRange(0,d)
elif self.showRunMeta.ui.cbEternity.checkState() == 2:
self.ui.elapsedTime.setRange(0,0)
self.pinger.start()
self.ui.tbStop.setEnabled(True)
self.ui.tbTrigger.setEnabled(True)
self.ui.tbStart.setEnabled(False)
name = self.showRunMeta.ui.leCurrentRun.text()
self.session.addRun(name)
if self.kinectRecorder is not None:
self.kinectRecorder.startRecording(self.newpath+'\\'+name+'.oni')
self.ui.elapsedTime.setRange(0,d)
def stop(self):
''' stop recording due to button press or timeout
- setup buttons
- stop timers
- stop server
- kill kinectRecorder
- add item to list of runs
'''
self.ui.tbStop.setEnabled(False)
self.ui.tbTrigger.setEnabled(False)
self.ui.tbStart.setEnabled(True)
self.ui.elapsedTime.reset()
QListWidgetItem(self.showRunMeta.ui.leCurrentRun.text(),
self.showRunMeta.ui.lwRuns)
self.showRunMeta.ui.leCurrentRun.setText(str(len(self.session.runs)))
self.server.exitFlag = True
self.server.stop()
self.runPinger.stop()
self.pinger.stop()
self.session.stopRun(self.server.buffer)
self.server.buffer = None
if self.kinectRecorder is not None:
self.kinectRecorder.stopRecording()
self.server.flush()