本文整理汇总了Python中VisionEgg.true_time_func方法的典型用法代码示例。如果您正苦于以下问题:Python VisionEgg.true_time_func方法的具体用法?Python VisionEgg.true_time_func怎么用?Python VisionEgg.true_time_func使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisionEgg
的用法示例。
在下文中一共展示了VisionEgg.true_time_func方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: go
# 需要导入模块: import VisionEgg [as 别名]
# 或者: from VisionEgg import true_time_func [as 别名]
def go(self,duration=None,prestim=None,poststim=None,RSTART=False):
# pre stimulation go
if prestim is not None:
if RSTART:
remote_start_controller = RemoteStartController()
self.add_controller(None,None,remote_start_controller)
self.parameters.go_duration = (prestim, 'seconds')
super(FrameSweep, self).go()
if RSTART:
self.remove_controller(None,None,remote_start_controller)
# stimulation go
if duration is not None:
self.parameters.go_duration = duration
else:
self.parameters.go_duration = ('forever','')
self.add_controllers()
# use VisionEgg timing function which handles platform specific problems
sweep_begin = VisionEgg.true_time_func()
super(FrameSweep, self).go()
sweep_end = VisionEgg.true_time_func()
sweep_duration = sweep_end - sweep_begin
# remove all stimuli so that post presentation will show nothing.
self.remove_stimuli()
# the RemoveViewportController should be moved, otherwise post go will quit directly.
self.remove_controller(None,None,None)
# post stimulation go
if poststim is not None:
if RSTART:
self.add_controller(None,None,RemoteStopController())
self.parameters.go_duration = (poststim, 'seconds')
super(FrameSweep, self).go()
if self.interrupted:
self.logger.warning('Stimulation was interrupted before completion.')
else:
self.logger.info('Stimulation completes successfully.')
self.logger.info('Actual stimulus duration: %s' %str(TimeFormat(sweep_duration)))