本文整理汇总了Python中target.Target.set_fb_mode方法的典型用法代码示例。如果您正苦于以下问题:Python Target.set_fb_mode方法的具体用法?Python Target.set_fb_mode怎么用?Python Target.set_fb_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类target.Target
的用法示例。
在下文中一共展示了Target.set_fb_mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Trainer
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import set_fb_mode [as 别名]
#.........这里部分代码省略.........
self.total_block_count = 0
self.trial_block_count = 0
##########################
# set playback variables #
##########################
self.TIME_SHIFT = 6
self.PLAYBACK_TRS = self.BLOCK_TRS + self.TIME_SHIFT/self.tr
self.EXTRA_TRS = 2
self.playback_buffer_length = (self.BLOCK_TIME
+ self.EXTRA_TRS)*self.FRAME_RATE
self.move_counter = 0
self.reset_playback_buffers()
def reset_playback_buffers(self):
self.playback_counter = 0
self.playback_time_buffer = np.zeros(self.playback_buffer_length)
self.playback_pos_buffer = np.zeros((2,self.playback_buffer_length))
self.playback_nfb_buffer = np.zeros(self.playback_buffer_length)
self.playback_nfb_points = np.zeros(self.PLAYBACK_TRS)
def get_pos(self):
if self.input_mode=='mouse' or not(SENSOR_ACTIVE):
return pygame.mouse.get_pos()
else:
f_out = self.daq.get_force()
return (self.SENSOR_INPUT_OFFSET[0]+self.NEWTONS_2_PIXEL*f_out[0],
self.SENSOR_INPUT_OFFSET[1]+self.NEWTONS_2_PIXEL*f_out[1])
def set_trial(self):
self.set_dof(self.next_dof)
self.target.set_fb_mode(self.next_ir)
self.set_training_mode(self.next_visible)
def set_noise(self):
if self.next_noise == 'good':
self.noise_var = self.NOISE_VAR_GOOD
elif self.next_noise == 'bad':
self.noise_var = self.NOISE_VAR_BAD
def set_training_mode(self, bool_arg):
self.training_mode = bool_arg
def set_tr(self, tr):
if tr == 0.125:
self.tr = 0.125
self.timers['tr'] = self.timers['tr_8hz']
elif tr == 0.25:
self.tr = 0.25
self.timers['tr'] = self.timers['tr_4hz']
elif tr == 0.5:
self.tr = 0.5
self.timers['tr'] = self.timers['tr_2hz']
elif tr == 1:
self.tr = 1.
self.timers['tr'] = self.timers['tr_1hz']
elif tr == 2:
self.tr = 2.
self.timers['tr'] = self.timers['tr_p5hz']
elif tr == 4:
self.tr = 4.