def __init__(self): """We break up initialization a bit as we need to go back and forth with some information. In this case, we need screen size before specifying the stimuli""" self.screen = get_default_screen() self.keys = [] self.presses = [] self.releases = []
def __init__(self, TR=None, eps=None): # Get the initial setup if TR: self.TR = TR if eps: self.eps = eps self.trial_times = [] self.missed_trigs = [] self.state = self.state_generator() self.screen = get_default_screen() # background black (RGBA) self.screen.parameters.bgcolor = (0.0,0.0,0.0,0.0) self.keyboard_controller = KeyboardResponseController() self.firstTTL_trigger = KeyboardTriggerInController(K_5)
def __init__(self): """We break up initialization a bit as we need to go back and forth with some information. In this case, we need screen size before specifying the stimuli""" VisionEgg.start_default_logging() VisionEgg.watch_exceptions() # get screen size for setting fullscreen resolution # comment this block out if you don't want to use full-screen. screen = pygame.display.set_mode((0, 0)) # this opens up a pygame window WIDTH, HEIGHT = screen.get_size() pygame.quit() # close this pygame window, or else it interferes w/ VE VisionEgg.config.VISIONEGG_SCREEN_W = WIDTH VisionEgg.config.VISIONEGG_SCREEN_H = HEIGHT self.screen = get_default_screen() self.keys = [] self.presses = [] self.releases = []
def __init__(self): """We break up initialization a bit as we need to go back and forth with some information. In this case, we need screen size before specifying the stimuli""" # pasted in from where it used to be at the beginning of the script # used to be outside of any methods... VisionEgg.start_default_logging() VisionEgg.watch_exceptions() # get screen size for setting fullscreen resolution # comment this block out if you don't want to use full-screen. screen = pygame.display.set_mode((0,0)) WIDTH, HEIGHT = screen.get_size() pygame.quit() VisionEgg.config.VISIONEGG_SCREEN_W = WIDTH VisionEgg.config.VISIONEGG_SCREEN_H = HEIGHT self.screen = get_default_screen() self.keys = [] self.presses = [] self.releases = []
fontsize = 80 boxsize = 160 numbers = range(1, 41) random.shuffle(numbers) n1s = numbers[:20] n2s = numbers[20:] mag_problems = [] for n1, n2 in zip(n1s, n2s): mag_problems.append([n1, n2]) ###SET SCREEN screen = get_default_screen() screen.parameters.bgcolor = (0, 0, 0) pygame.font.init() framerate = 60 #helper functions def frame_to_time(f): t = float(f) / float(framerate) return t def time_to_frame(t): f = t * framerate return f
fontsize = 80 boxsize = 160 numbers = range(1, 41) random.shuffle(numbers) n1s = numbers[:20] n2s = numbers[20:] mag_problems = [] for n1, n2 in zip(n1s, n2s): mag_problems.append([n1, n2]) ###SET SCREEN screen = get_default_screen() screen.parameters.bgcolor = (0, 0, 0) pygame.font.init() framerate = 60 # helper functions def frame_to_time(f): t = float(f) / float(framerate) return t def time_to_frame(t): f = t * framerate return f
VisionEgg.config.VISIONEGG_MONITOR_WIDTH = 960 VisionEgg.config.VISIONEGG_MONITOR_HEIGHT = 600 VisionEgg.config.VISIONEGG_FULLSCREEN = 1 VisionEgg.config.VISIONEGG_MONITOR_REFRESH_HZ = 60.0 #VisionEgg.config.VISIONEGG_MONITOR_WIDTH = 1280 #VisionEgg.config.VISIONEGG_MONITOR_HEIGHT = 1024 #VisionEgg.config.VISIONEGG_MONITOR_REFRESH_HZ = 75.0 #window = VisionEgg.GUI.GraphicsConfigurationWindow() #window.mainloop() # All this does is adjust VisionEgg.config #if not window.clicked_ok: # sys.exit() # User wants to quit #VisionEgg.Configuration.save_settings() VisionEgg.config.VISIONEGG_GUI_INIT = 1 globalScreen = get_default_screen() # TODO: check which of these settings are used at the moment, get rid of the unnecessary ones class Config: jsNumber = 0 # (left, right, start, next, terminate) # left and right are used for responses to questions jsSetup = { #"WingMan Action Pad": (6, 7, 8, 8, (3,4,5)), #"Microsoft": (5, 4, 0, 0, (100,100,100)), #"PS Converter ": (4, 5, 2, 2, (100,100,100)), #"Logitech(R) Precision(TM) Gamepad": (6, 7, 0, 0, (3,2,1)), #"Generic USB Joystick ": (6, 7, 0, 0, (3,2,1)), "?": {
VisionEgg.config.VISIONEGG_MONITOR_HEIGHT = 600 VisionEgg.config.VISIONEGG_FULLSCREEN = 1 VisionEgg.config.VISIONEGG_MONITOR_REFRESH_HZ = 60.0 #VisionEgg.config.VISIONEGG_MONITOR_WIDTH = 1280 #VisionEgg.config.VISIONEGG_MONITOR_HEIGHT = 1024 #VisionEgg.config.VISIONEGG_MONITOR_REFRESH_HZ = 75.0 #window = VisionEgg.GUI.GraphicsConfigurationWindow() #window.mainloop() # All this does is adjust VisionEgg.config #if not window.clicked_ok: # sys.exit() # User wants to quit #VisionEgg.Configuration.save_settings() VisionEgg.config.VISIONEGG_GUI_INIT = 1 globalScreen = get_default_screen() # TODO: check which of these settings are used at the moment, get rid of the unnecessary ones class Config: jsNumber = 0 # (left, right, start, next, terminate) # left and right are used for responses to questions jsSetup = {#"WingMan Action Pad": (6, 7, 8, 8, (3,4,5)), #"Microsoft": (5, 4, 0, 0, (100,100,100)), #"PS Converter ": (4, 5, 2, 2, (100,100,100)), #"Logitech(R) Precision(TM) Gamepad": (6, 7, 0, 0, (3,2,1)), #"Generic USB Joystick ": (6, 7, 0, 0, (3,2,1)), "?": {'left': 4, 'right': 5, 'start': 9,