From 1bf68d6ec5121eaabbdd9ee76cf0016b82d37298 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 19 Sep 2019 16:07:36 -0400 Subject: [PATCH 01/17] Making changes to main GUI to support new pre-trial action settings (and other changes with that). Note: This is based off Marks work --- GUI.py | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/GUI.py b/GUI.py index fc45737..59116c4 100644 --- a/GUI.py +++ b/GUI.py @@ -172,6 +172,10 @@ def __init__(self, *args, **kwds): self.score_check = wx.CheckBox(self, wx.ID_ANY, ("Accuracy Rewards")) self.score_settings_button = wx.Button(self, wx.ID_ANY, ("Settings")) + #Pre-Trial Action Settings + self.pre_trial= wx.CheckBox(self, wx.ID_ANY, ("Pre-Trial Action")) + self.pre_trial_settings_button = wx.Button(self, wx.ID_ANY, ("Settings")) + # Participant stuff (column 6) self.participants_statictext = wx.StaticText(self, wx.ID_ANY, "Participants") self.participants_staticline = wx.StaticLine(self, wx.ID_ANY, style = wx.EXPAND) @@ -234,6 +238,10 @@ def __init__(self, *args, **kwds): # self.Bind(wx.EVT_LISTBOX, self.group_listbox_click, self.group_listbox) # end wxGlade + # Pre-Trial Action Events + self.Bind(wx.EVT_CHECKBOX, self.pre_trial_press, self.pre_trial) + self.Bind(wx.EVT_BUTTON, self.pre_trial_settings_press, self.pre_trial_settings_button) + def __set_properties(self): # begin wxGlade: MyFrame.__set_properties @@ -405,7 +413,11 @@ def __do_layout(self): sizer_10 = wx.BoxSizer(wx.VERTICAL) sizer_10.Add(self.radio_box_1, 0, wx.EXPAND | wx.ALL, 3) - sizer_10.Add(self.static_line_3, 0, wx.EXPAND | wx.ALL, 5) + #sizer_10.Add(self.static_line_3, 0, wx.EXPAND | wx.ALL, 5) -->EXTRA PART WE DO NOT WANT + #ADD PRE-TRIAL ACTION CHECK BUTTON HERE AND BUTTON NEXT TO IT + sizer_10.Add(self.pre_trial, 0, wx.LEFT, 0) + sizer_10.Add(self.pre_trial_settings_button, 0, 0, 0) + target_sizer = wx.BoxSizer(wx.VERTICAL) @@ -626,11 +638,20 @@ def regular_experiment_show(self): self.score_check.Enable(False) self.score_check.SetValue(False) self.score_settings_button.Enable(False) + + #Pre-Trial Action Settings + self.pre_trial.Enable(False) + self.pre_trial.SetValue(False) + self.pre_trial_settings_button.Enable(False) else: # Scoring System self.score_check.Enable(True) self.score_settings_button.Enable(self.score_check.GetValue()) + #Pre-Trial Action Settings + self.pre_trial.Enable(True) + self.pre_trial_settings_button.Enable(self.pre_trial.GetValue()) + #self.pause_static_text.Hide() #self.pause_txt.Hide() #self.PM_static_text.Hide() @@ -718,6 +739,10 @@ def pause_experiment_show(self): self.score_check.Enable(False) self.score_settings_button.Enable(False) + # Pre-Trial Action + self.pre_trial.Enable(False) + self.pre_trial_settings_button.Enable(False) + def list_box_dclick(self, event): @@ -795,6 +820,10 @@ def task_list_box_click(self, event): self.score_check.SetValue(self.current_experiment[self.highlit_task_num]['use_score']) self.score_settings_button.Enable(self.current_experiment[self.highlit_task_num]['use_score']) + # Pre-Trial Action + self.pre_trial.SetValue(self.current_experiment[self.highlit_task_num]['pre_trial_check']) + self.pre_trial_settings_button.Enable(self.current_experiment[self.highlit_task_num]['pre_trial_check']) + if (self.current_experiment[self.highlit_task_num]['rotation_change_type'] == 'gradual'): # self.MIN_TRIAL_BOOL = True self.Rotation_angle_statictext.SetLabel("Initial rotation") @@ -1064,6 +1093,9 @@ def Plus_Press(self, event): # wxGlade: MyFrame. self.current_experiment[self.highlit_task_num]['pause_instruction'] = "" self.current_experiment[self.highlit_task_num]['final_rotation_angle'] = 0 + # Pre-Trial Action + self.current_experiment[self.highlit_task_num]['pre_trial_check'] = False + # Scoring System self.current_experiment[self.highlit_task_num]['use_score'] = False @@ -1102,6 +1134,9 @@ def Plus_Press(self, event): # wxGlade: MyFrame. self.score_check.SetValue(False) self.score_settings_button.Enable(False) + self.pre_trial.SetValue(False) + self.pre_trial_settings_button.Enable(False) + # with open(self.experiment_folder + self.current_experiment_name + ".json", "wb") as f: # dump(self.experiment_holder, f) # f.close() @@ -1483,6 +1518,19 @@ def score_settings_press(self, event): scoreframe = ScoreFrame(self, wx.ID_ANY, "") scoreframe.Show(True) event.Skip() + + # Pre-Trial Action Events + def pre_trial_press(self, event): + self.current_experiment[self.highlit_task_num]['pre_trial_check'] = event.IsChecked() + self.pre_trial_settings_button.Disable() + if (self.pre_trial.IsChecked()): + self.pre_trial_settings_button.Enable() + event.Skip() + + def pre_trial_settings_press(self, event): + pretrialframe = PreTrialFrame(self, wx.ID_ANY, "") + pretrialframe.Show(True) + event.Skip() # def rotation_angle_direction_press(self, event): # self.current_experiment[self.highlit_task_num]['rotation_angle_direction'] = event.GetString() # event.Skip() @@ -2684,6 +2732,67 @@ def onLowAccTargClr(self, event): event.GetColour().Get(includeAlpha=False) event.Skip() +class PreTrialFrame(wx.Frame): + def __init__(self, *args, **kwds): + + # begin wxGlade: scoreFrame.__init__ + kwds["style"] = kwds.get("style", 0) \ + | wx.CAPTION | wx.CLIP_CHILDREN | wx.MINIMIZE_BOX \ + | wx.CLOSE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU + wx.Frame.__init__(self, *args, **kwds) + self.SetSize((250, 250)) + + self.__set_properties() + self.__do_layout() + + def Option_Press(self, event): # wxGlade: MyFrame. + chosen_option = event.GetString() + if (chosen_option == "Pre-Reach Aiming"): + print "Pre-Reach Aiming" + self.hold_home_statictext.Disable() + self.hold_home_slider.Disable() + elif (chosen_option == "Hold At Home"): + print "Hold At Home" + self.hold_home_statictext.Enable() + self.hold_home_slider.Enable() + + def hold_home_choose(self, event): # wxGlade: MyFrame. + self.hold_home_chosen = exp.myRounder(event.GetInt(), 5) + if self.hold_home_chosen < self.hold_home_chosen: + self.hold_home_slider.SetValue(self.hold_home_chosen) + else: + self.hold_home_chosen = self.hold_home_chosen + self.hold_home_slider.SetValue(self.hold_home_chosen) + self.hold_home_slider.SetValue(self.hold_home_chosen) + self.current_experiment[self.highlit_task_num]['hold_home'] = self.hold_home_chosen + self.current_experiment[self.highlit_task_num]['hold_home'] = self.hold_home_chosen + event.Skip() + + def __set_properties(self): + self.SetTitle("Pre-Trial Action Settings") + self.pre_trial_radio_box = wx.RadioBox(self, wx.ID_ANY, ("Options"), choices=[("Pre-Reach Aiming"), ("Hold At Home")], majorDimension=1, style=wx.RA_SPECIFY_COLS) + self.Bind(wx.EVT_RADIOBOX, self.Option_Press, self.pre_trial_radio_box) + + self.hold_home_statictext = wx.StaticText(self, wx.ID_ANY, ("Time Holding Home (in ms)")) + self.hold_home_slider = wx.Slider(self, wx.ID_ANY, minValue = 0, maxValue = 10000, value = 100, style=wx.SL_HORIZONTAL | wx.SL_LABELS) + self.Bind(wx.EVT_SLIDER, self.hold_home_choose, self.hold_home_slider) + + self.hold_home_statictext.SetPosition((5,80)) + self.hold_home_slider.SetPosition((5,100)) + + + def __do_layout(self): + # begin wxGlade: scoreFrame.__do_layout + mainSizer = wx.BoxSizer(wx.HORIZONTAL) + secondSizer = wx.BoxSizer(wx.VERTICAL) + + mainSizer.Add(self.pre_trial_radio_box, 0, wx.EXPAND | wx.ALL, 3) + secondSizer.Add(self.hold_home_statictext, 0, wx.EXPAND | wx.ALL, 3) + secondSizer.Add(self.hold_home_slider, 0, wx.EXPAND, 3) + self.hold_home_statictext.Disable() + self.hold_home_slider.Disable() + + # end of class MyFrame class MyApp(wx.App): def OnInit(self): From e6631909cc1f6133ac3d41ffcb9ae425d2b425ef Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 19 Sep 2019 16:19:11 -0400 Subject: [PATCH 02/17] Minor fix to GUI: Disabling Settings button on Run --- GUI.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GUI.py b/GUI.py index 59116c4..c27a29e 100644 --- a/GUI.py +++ b/GUI.py @@ -175,6 +175,7 @@ def __init__(self, *args, **kwds): #Pre-Trial Action Settings self.pre_trial= wx.CheckBox(self, wx.ID_ANY, ("Pre-Trial Action")) self.pre_trial_settings_button = wx.Button(self, wx.ID_ANY, ("Settings")) + self.pre_trial_settings_button.Disable() # Participant stuff (column 6) self.participants_statictext = wx.StaticText(self, wx.ID_ANY, "Participants") @@ -642,7 +643,7 @@ def regular_experiment_show(self): #Pre-Trial Action Settings self.pre_trial.Enable(False) self.pre_trial.SetValue(False) - self.pre_trial_settings_button.Enable(False) + self.pre_trial_settings_button.Disable() else: # Scoring System self.score_check.Enable(True) @@ -650,7 +651,7 @@ def regular_experiment_show(self): #Pre-Trial Action Settings self.pre_trial.Enable(True) - self.pre_trial_settings_button.Enable(self.pre_trial.GetValue()) + self.pre_trial_settings_button.Disable() #self.pause_static_text.Hide() #self.pause_txt.Hide() @@ -741,7 +742,7 @@ def pause_experiment_show(self): # Pre-Trial Action self.pre_trial.Enable(False) - self.pre_trial_settings_button.Enable(False) + self.pre_trial_settings_button.Disable() def list_box_dclick(self, event): @@ -822,7 +823,7 @@ def task_list_box_click(self, event): # Pre-Trial Action self.pre_trial.SetValue(self.current_experiment[self.highlit_task_num]['pre_trial_check']) - self.pre_trial_settings_button.Enable(self.current_experiment[self.highlit_task_num]['pre_trial_check']) + self.pre_trial_settings_button.Disable() if (self.current_experiment[self.highlit_task_num]['rotation_change_type'] == 'gradual'): # self.MIN_TRIAL_BOOL = True @@ -1135,7 +1136,7 @@ def Plus_Press(self, event): # wxGlade: MyFrame. self.score_settings_button.Enable(False) self.pre_trial.SetValue(False) - self.pre_trial_settings_button.Enable(False) + self.pre_trial_settings_button.Disable() # with open(self.experiment_folder + self.current_experiment_name + ".json", "wb") as f: # dump(self.experiment_holder, f) From 19165c1e6036641f93a7672a0abb7855eb285340 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 24 Sep 2019 12:59:06 -0400 Subject: [PATCH 03/17] Implementation for the arrow in exp.py added (not functioning yet. Does not work when called and arrow objects must be created properly in the runExp function --- Exp.py | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- GUI.py | 6 ++-- 2 files changed, 101 insertions(+), 4 deletions(-) diff --git a/Exp.py b/Exp.py index 99095b1..e1d8542 100644 --- a/Exp.py +++ b/Exp.py @@ -5,6 +5,7 @@ from numpy import sqrt, arctan2, cos, sin, linalg, clip, ndarray, array, diff, mean, arange, pi, dot import csv import math +import scipy as sp from pandas import concat, DataFrame from random import choice, seed, shuffle from Tkinter import Tk @@ -220,6 +221,96 @@ def angle_split(min_angle, max_angle, num_splits): # myWin.flip() # event.waitKeys(keyList=['space']) +####################################PRE AIM STUFF######################################################### + + class myHomeArrow: + + def __init__(self,cfg,ori=0,color='#999999',size=1): + self.ori = ori + self.color = color + self.size = size + self.rightArrow = visual.ShapeStim(win=cfg['win'], + lineWidth=0, + lineColorSpace='rgb', + lineColor=None, + fillColorSpace='rgb', + fillColor=self.color, + closeShape=True, + size=self.size, + ori=self.ori, + vertices=((-.1,0),(.9,0),(-.636,-.636)) + ) + self.leftArrow = visual.ShapeStim(win=cfg['win'], + lineWidth=0, + lineColorSpace='rgb', + lineColor=None, + fillColorSpace='rgb', + fillColor=self.color, + closeShape=True, + size=self.size, + ori=self.ori, + vertices=((-.1,0),(.9,0),(-.636,.636)) + ) + + def draw(self): + self.rightArrow.ori = self.ori + self.leftArrow.ori = self.ori + self.rightArrow.fillColor = self.color + self.leftArrow.fillColor = self.color + self.rightArrow.size = self.size + self.leftArrow.size = self.size + self.rightArrow.draw() + self.leftArrow.draw() + + cfg['home_arrow'] = myHomeArrow(cfg,size=cfg['radius']) + +def doAiming(cfg): + + cfg['aim'] = sp.NaN + cfg['aimtime_ms'] = sp.NaN + + cfg['aim_arrow'].draw() + + aimDecided = False + + event.clearEvents() + + startaiming = time.time() + + while(not(aimDecided)): + + keys = event.getKeys(keyList=['num_enter']) + if ('num_enter' in keys): + cfg['aim'] = -1 * cfg['aim_arrow'].ori + aimDecided = True + stopaiming = time.time() + + #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only + if cfg['keyboard'][key.LEFT]: + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 + #print(cfg['aim_arrow'].ori) + if cfg['keyboard'][key.RIGHT]: + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 + #print(cfg['aim_arrow'].ori) + #print(cfg['keyboard']) + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + + + cfg['aim_arrow'].draw() + + if cfg['keyboard'][key.ESCAPE]: + sys.exit('escape key pressed') + + #if (cfg['aim'] < 0) or (cfg['aim'] > 360): + cfg['aim'] = cfg['aim'] % 360 + cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) + + #print(cfg['tasks'][cfg['taskno']]['target'][cfg['trialno']]) + #print(cfg['aim']) + + + return(cfg) + def trial_runner(cfg={}): try: @@ -437,6 +528,8 @@ def trial_runner(cfg={}): pass # SHOW OBJECTS + #cfg = doAiming(cfg) + #aim = cfg['aim'] try: if (pos_buffer == 0): pos_buffer = pos_buffer + 1 @@ -690,11 +783,14 @@ def trial_runner(cfg={}): timePos_dict['accuracy_reward'] = [cfg['score_points']] * len(mouseposXArray) + if (cfg['use_score']): timePos_dict['accuracy_reward_bool'] = ['True'] * len(mouseposXArray) else: timePos_dict['accuracy_reward_bool'] = ['False'] * len(mouseposXArray) + + return timePos_dict elif ((cfg['trial_type'] == 'no_cursor' or cfg['trial_type'] == 'error_clamp' or (cfg['trial_type'] == 'cursor' and cfg['terminal_feedback'] == True)) and get_dist(circle_pos, startPos) <= 3*get_dist(startPos, endPos)/20): @@ -760,6 +856,7 @@ def run_experiment(participant, experiment = {}): configureWindow(cfg, experiment) + #print cfg.keys() cfg['psyMouse'] = event.Mouse(visible = False, newPos = None, win = cfg['win']) class myMouse: @@ -788,7 +885,7 @@ def Pos(self): fillColor=[0, 0, 0], size=cfg['circle_radius']*0.6, lineColor=[0,0,0]) - + # there is no 'else' following this... don't we need to do something else? if settings['custom_stim_enable'] == True: # shouldn't this be in a separate function? diff --git a/GUI.py b/GUI.py index c27a29e..eee8eb5 100644 --- a/GUI.py +++ b/GUI.py @@ -175,7 +175,7 @@ def __init__(self, *args, **kwds): #Pre-Trial Action Settings self.pre_trial= wx.CheckBox(self, wx.ID_ANY, ("Pre-Trial Action")) self.pre_trial_settings_button = wx.Button(self, wx.ID_ANY, ("Settings")) - self.pre_trial_settings_button.Disable() + self.pre_trial_settings_button.Enable(self.pre_trial.IsChecked()) # Participant stuff (column 6) self.participants_statictext = wx.StaticText(self, wx.ID_ANY, "Participants") @@ -2758,7 +2758,7 @@ def Option_Press(self, event): # wxGlade: MyFrame. self.hold_home_slider.Enable() def hold_home_choose(self, event): # wxGlade: MyFrame. - self.hold_home_chosen = exp.myRounder(event.GetInt(), 5) + self.hold_home_chosen = exp.myRounder(event.GetInt(), 100) if self.hold_home_chosen < self.hold_home_chosen: self.hold_home_slider.SetValue(self.hold_home_chosen) else: @@ -2775,7 +2775,7 @@ def __set_properties(self): self.Bind(wx.EVT_RADIOBOX, self.Option_Press, self.pre_trial_radio_box) self.hold_home_statictext = wx.StaticText(self, wx.ID_ANY, ("Time Holding Home (in ms)")) - self.hold_home_slider = wx.Slider(self, wx.ID_ANY, minValue = 0, maxValue = 10000, value = 100, style=wx.SL_HORIZONTAL | wx.SL_LABELS) + self.hold_home_slider = wx.Slider(self, wx.ID_ANY, minValue = 0, maxValue = 10000, value = 1500, style=wx.SL_HORIZONTAL | wx.SL_LABELS) self.Bind(wx.EVT_SLIDER, self.hold_home_choose, self.hold_home_slider) self.hold_home_statictext.SetPosition((5,80)) From 348e6823e68e639a15be65d6e68a4a6142abcf78 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 26 Sep 2019 17:00:00 -0400 Subject: [PATCH 04/17] Arrow added to the screen. Aim still does not work fully (must use win.flip to repopulate the entire screen after every move --- Exp.py | 82 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 16 deletions(-) diff --git a/Exp.py b/Exp.py index e1d8542..6029d65 100644 --- a/Exp.py +++ b/Exp.py @@ -1,10 +1,12 @@ from psychopy.visual import Window, Circle, ShapeStim, TextStim, ImageStim from psychopy import event, core +from pyglet.window import key from os import path, listdir from json import dump from numpy import sqrt, arctan2, cos, sin, linalg, clip, ndarray, array, diff, mean, arange, pi, dot import csv import math +import time import scipy as sp from pandas import concat, DataFrame from random import choice, seed, shuffle @@ -229,7 +231,7 @@ def __init__(self,cfg,ori=0,color='#999999',size=1): self.ori = ori self.color = color self.size = size - self.rightArrow = visual.ShapeStim(win=cfg['win'], + self.rightArrow = ShapeStim(win=cfg['win'], lineWidth=0, lineColorSpace='rgb', lineColor=None, @@ -240,7 +242,7 @@ def __init__(self,cfg,ori=0,color='#999999',size=1): ori=self.ori, vertices=((-.1,0),(.9,0),(-.636,-.636)) ) - self.leftArrow = visual.ShapeStim(win=cfg['win'], + self.leftArrow = ShapeStim(win=cfg['win'], lineWidth=0, lineColorSpace='rgb', lineColor=None, @@ -266,44 +268,66 @@ def draw(self): def doAiming(cfg): + print "IN doAiming FUNCTION" + cfg['aim'] = sp.NaN + print "1" cfg['aimtime_ms'] = sp.NaN - + print "2" + cfg['keyboard'] = key.KeyStateHandler() + print "3" + cfg['win'].winHandle.push_handlers(cfg['keyboard']) + print "4" + cfg['aim_arrow'].ori = -1 cfg['aim_arrow'].draw() + cfg['win'].flip() + print "drew arrow" aimDecided = False + n = 1 - event.clearEvents() + #event.clearEvents() - startaiming = time.time() + #startaiming = time.time() - while(not(aimDecided)): + while(n == 1): + #print 'entered loop' - keys = event.getKeys(keyList=['num_enter']) - if ('num_enter' in keys): + if (cfg['keyboard'][key.ENTER]): cfg['aim'] = -1 * cfg['aim_arrow'].ori aimDecided = True - stopaiming = time.time() + print 'aim decided' + #stopaiming = time.time() #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only if cfg['keyboard'][key.LEFT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 + #cfg['aim_arrow'].draw() + print "LEFT" + n = n + 1 + #time.sleep(0.5) #print(cfg['aim_arrow'].ori) if cfg['keyboard'][key.RIGHT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 + #cfg['aim_arrow'].draw() + print "RIGHT" + n = n + 1 + #time.sleep(0.5) #print(cfg['aim_arrow'].ori) #print(cfg['keyboard']) - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 - + #cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 cfg['aim_arrow'].draw() + cfg['win'].flip() + if cfg['keyboard'][key.ESCAPE]: sys.exit('escape key pressed') #if (cfg['aim'] < 0) or (cfg['aim'] > 360): - cfg['aim'] = cfg['aim'] % 360 - cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) + #cfg['aim'] = cfg['aim'] % 360 + #cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) + #cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) #print(cfg['tasks'][cfg['taskno']]['target'][cfg['trialno']]) #print(cfg['aim']) @@ -528,13 +552,25 @@ def trial_runner(cfg={}): pass # SHOW OBJECTS - #cfg = doAiming(cfg) - #aim = cfg['aim'] + + winSize = cfg['win'].size + PPC = max(winSize)/31. + + cfg['NSU'] = PPC * 8 + + arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) + + cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) + + #doAiming(cfg) + try: if (pos_buffer == 0): pos_buffer = pos_buffer + 1 if (show_home == True): startCircle.draw() # home position + #cfg['aim_arrow'].draw() + #doAiming(cfg) if (show_target == True): endCircle.draw() # target position if (show_arrow == True): @@ -549,6 +585,7 @@ def trial_runner(cfg={}): print('Failed to show object: ') print(e) pass + doAiming(cfg) # phase 1 is getting to the home position (usually over very soon) try: @@ -859,6 +896,19 @@ def run_experiment(participant, experiment = {}): #print cfg.keys() cfg['psyMouse'] = event.Mouse(visible = False, newPos = None, win = cfg['win']) + #winSize = cfg['win'].size + + # PPC = max(winSize)/31. + # + # cfg['NSU'] = PPC * 8 + # + # arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) + # + # cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) + + #doAiming(cfg) + + class myMouse: def Pos(self): #print('PsychoPy mouse') @@ -885,7 +935,7 @@ def Pos(self): fillColor=[0, 0, 0], size=cfg['circle_radius']*0.6, lineColor=[0,0,0]) - + # there is no 'else' following this... don't we need to do something else? if settings['custom_stim_enable'] == True: # shouldn't this be in a separate function? From 0311e50dece8185128bf7aff96e938871f950b46 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 3 Oct 2019 14:19:29 -0400 Subject: [PATCH 05/17] It finally works. Full arrow functionality. Now making it work only when boolean true and adding this angle value to the spreadsheet --- Exp.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Exp.py b/Exp.py index 6029d65..5872e71 100644 --- a/Exp.py +++ b/Exp.py @@ -278,6 +278,8 @@ def doAiming(cfg): print "3" cfg['win'].winHandle.push_handlers(cfg['keyboard']) print "4" + + cfg['end_circle'].draw() cfg['aim_arrow'].ori = -1 cfg['aim_arrow'].draw() cfg['win'].flip() @@ -290,24 +292,27 @@ def doAiming(cfg): #startaiming = time.time() - while(n == 1): + while(aimDecided == False): #print 'entered loop' if (cfg['keyboard'][key.ENTER]): cfg['aim'] = -1 * cfg['aim_arrow'].ori aimDecided = True print 'aim decided' + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + print cfg['aim_arrow'].ori + sys.exit('Aim chosen and exited') #stopaiming = time.time() #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only - if cfg['keyboard'][key.LEFT]: + elif cfg['keyboard'][key.LEFT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 #cfg['aim_arrow'].draw() print "LEFT" n = n + 1 #time.sleep(0.5) #print(cfg['aim_arrow'].ori) - if cfg['keyboard'][key.RIGHT]: + elif cfg['keyboard'][key.RIGHT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 #cfg['aim_arrow'].draw() print "RIGHT" @@ -315,8 +320,9 @@ def doAiming(cfg): #time.sleep(0.5) #print(cfg['aim_arrow'].ori) #print(cfg['keyboard']) - #cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + cfg['end_circle'].draw() cfg['aim_arrow'].draw() cfg['win'].flip() @@ -876,6 +882,8 @@ def run_experiment(participant, experiment = {}): task_save = DataFrame({}) running = deepcopy(experiment['experiment']) # why copy this? set up a window, a mouse object and add those, plus a task-index to your cfg, then simply loop through the tasks, and throw that to a run-task function? settings = deepcopy(experiment['settings']) # same here... + print running + print settings cfg = {} #### Generate seed #### From c4f17a7edab27a75dc8e1a7f695fd47ff7788514 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 8 Oct 2019 11:47:43 -0400 Subject: [PATCH 06/17] Successfully connected GUI entry to Exp.py. Can now check boolean value before calling aim. NOTE: Change in Exp.py was done only for testing purposes. Will be reverted in next push --- Exp.py | 4 +++- GUI.py | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Exp.py b/Exp.py index 5872e71..49c8f8f 100644 --- a/Exp.py +++ b/Exp.py @@ -883,7 +883,9 @@ def run_experiment(participant, experiment = {}): running = deepcopy(experiment['experiment']) # why copy this? set up a window, a mouse object and add those, plus a task-index to your cfg, then simply loop through the tasks, and throw that to a run-task function? settings = deepcopy(experiment['settings']) # same here... print running - print settings + print "---------------------------------------------------------------------------------" + print running[0]['pre_reach_aim'] + cfg = {} #### Generate seed #### diff --git a/GUI.py b/GUI.py index eee8eb5..ea36eb5 100644 --- a/GUI.py +++ b/GUI.py @@ -1096,6 +1096,9 @@ def Plus_Press(self, event): # wxGlade: MyFrame. # Pre-Trial Action self.current_experiment[self.highlit_task_num]['pre_trial_check'] = False + self.current_experiment[self.highlit_task_num]['pre_reach_aim'] = False + self.current_experiment[self.highlit_task_num]['hold_on_home'] = False + # Scoring System self.current_experiment[self.highlit_task_num]['use_score'] = False @@ -2752,10 +2755,15 @@ def Option_Press(self, event): # wxGlade: MyFrame. print "Pre-Reach Aiming" self.hold_home_statictext.Disable() self.hold_home_slider.Disable() + self.Parent.current_experiment[self.Parent.highlit_task_num]['pre_reach_aim'] = True + # self.pre_trial_radio_box.SetValue(self.current_experiment[self.highlit_task_num]['pre_reach_aim']) + + elif (chosen_option == "Hold At Home"): print "Hold At Home" self.hold_home_statictext.Enable() self.hold_home_slider.Enable() + self.Parent.current_experiment[self.Parent.highlit_task_num]['hold_on_home'] = True def hold_home_choose(self, event): # wxGlade: MyFrame. self.hold_home_chosen = exp.myRounder(event.GetInt(), 100) @@ -2765,8 +2773,8 @@ def hold_home_choose(self, event): # wxGlade: MyFrame. self.hold_home_chosen = self.hold_home_chosen self.hold_home_slider.SetValue(self.hold_home_chosen) self.hold_home_slider.SetValue(self.hold_home_chosen) - self.current_experiment[self.highlit_task_num]['hold_home'] = self.hold_home_chosen - self.current_experiment[self.highlit_task_num]['hold_home'] = self.hold_home_chosen + self.Parent.current_experiment[self.Parent.highlit_task_num]['hold_home'] = self.hold_home_chosen + self.Parent.current_experiment[self.Parent.highlit_task_num]['hold_home'] = self.hold_home_chosen event.Skip() def __set_properties(self): From f77eb494d1feaa5b9f0bddb5229f4cec0ac39490 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 8 Oct 2019 12:10:51 -0400 Subject: [PATCH 07/17] Functionality of if statement works. Now to complete hold on home --- Exp.py | 125 +++++++++++++++++++++++++++++---------------------------- GUI.py | 2 + 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/Exp.py b/Exp.py index 49c8f8f..e5e17b1 100644 --- a/Exp.py +++ b/Exp.py @@ -266,80 +266,81 @@ def draw(self): cfg['home_arrow'] = myHomeArrow(cfg,size=cfg['radius']) -def doAiming(cfg): +def doAiming(cfg,isAim): + if (isAim == True): + print "IN doAiming FUNCTION" + + cfg['aim'] = sp.NaN + print "1" + cfg['aimtime_ms'] = sp.NaN + print "2" + cfg['keyboard'] = key.KeyStateHandler() + print "3" + cfg['win'].winHandle.push_handlers(cfg['keyboard']) + print "4" - print "IN doAiming FUNCTION" - - cfg['aim'] = sp.NaN - print "1" - cfg['aimtime_ms'] = sp.NaN - print "2" - cfg['keyboard'] = key.KeyStateHandler() - print "3" - cfg['win'].winHandle.push_handlers(cfg['keyboard']) - print "4" + cfg['end_circle'].draw() + cfg['aim_arrow'].ori = -1 + cfg['aim_arrow'].draw() + cfg['win'].flip() + print "drew arrow" - cfg['end_circle'].draw() - cfg['aim_arrow'].ori = -1 - cfg['aim_arrow'].draw() - cfg['win'].flip() - print "drew arrow" + aimDecided = False + n = 1 - aimDecided = False - n = 1 + #event.clearEvents() - #event.clearEvents() + #startaiming = time.time() - #startaiming = time.time() + while(aimDecided == False): + #print 'entered loop' - while(aimDecided == False): - #print 'entered loop' + if (cfg['keyboard'][key.ENTER]): + cfg['aim'] = -1 * cfg['aim_arrow'].ori + aimDecided = True + print 'aim decided' + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + print cfg['aim_arrow'].ori + sys.exit('Aim chosen and exited') + #stopaiming = time.time() - if (cfg['keyboard'][key.ENTER]): - cfg['aim'] = -1 * cfg['aim_arrow'].ori - aimDecided = True - print 'aim decided' + #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only + elif cfg['keyboard'][key.LEFT]: + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 + #cfg['aim_arrow'].draw() + print "LEFT" + n = n + 1 + #time.sleep(0.5) + #print(cfg['aim_arrow'].ori) + elif cfg['keyboard'][key.RIGHT]: + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 + #cfg['aim_arrow'].draw() + print "RIGHT" + n = n + 1 + #time.sleep(0.5) + #print(cfg['aim_arrow'].ori) + #print(cfg['keyboard']) cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 - print cfg['aim_arrow'].ori - sys.exit('Aim chosen and exited') - #stopaiming = time.time() - - #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only - elif cfg['keyboard'][key.LEFT]: - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 - #cfg['aim_arrow'].draw() - print "LEFT" - n = n + 1 - #time.sleep(0.5) - #print(cfg['aim_arrow'].ori) - elif cfg['keyboard'][key.RIGHT]: - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 - #cfg['aim_arrow'].draw() - print "RIGHT" - n = n + 1 - #time.sleep(0.5) - #print(cfg['aim_arrow'].ori) - #print(cfg['keyboard']) - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 - cfg['end_circle'].draw() - cfg['aim_arrow'].draw() - cfg['win'].flip() + cfg['end_circle'].draw() + cfg['aim_arrow'].draw() + cfg['win'].flip() + + if cfg['keyboard'][key.ESCAPE]: + sys.exit('escape key pressed') - if cfg['keyboard'][key.ESCAPE]: - sys.exit('escape key pressed') + #if (cfg['aim'] < 0) or (cfg['aim'] > 360): + #cfg['aim'] = cfg['aim'] % 360 + #cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) + #cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) - #if (cfg['aim'] < 0) or (cfg['aim'] > 360): - #cfg['aim'] = cfg['aim'] % 360 - #cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) - #cfg['aimtime_ms'] = int((stopaiming - startaiming) * 1000) + #print(cfg['tasks'][cfg['taskno']]['target'][cfg['trialno']]) + #print(cfg['aim']) - #print(cfg['tasks'][cfg['taskno']]['target'][cfg['trialno']]) - #print(cfg['aim']) + return(cfg) - return(cfg) def trial_runner(cfg={}): @@ -591,7 +592,7 @@ def trial_runner(cfg={}): print('Failed to show object: ') print(e) pass - doAiming(cfg) + doAiming(cfg,isAim) # phase 1 is getting to the home position (usually over very soon) try: @@ -884,7 +885,9 @@ def run_experiment(participant, experiment = {}): settings = deepcopy(experiment['settings']) # same here... print running print "---------------------------------------------------------------------------------" - print running[0]['pre_reach_aim'] + global isAim + isAim = running[0]['pre_reach_aim'] + print isAim cfg = {} diff --git a/GUI.py b/GUI.py index ea36eb5..ba38968 100644 --- a/GUI.py +++ b/GUI.py @@ -2756,6 +2756,7 @@ def Option_Press(self, event): # wxGlade: MyFrame. self.hold_home_statictext.Disable() self.hold_home_slider.Disable() self.Parent.current_experiment[self.Parent.highlit_task_num]['pre_reach_aim'] = True + self.Parent.current_experiment[self.Parent.highlit_task_num]['hold_on_home'] = False # self.pre_trial_radio_box.SetValue(self.current_experiment[self.highlit_task_num]['pre_reach_aim']) @@ -2764,6 +2765,7 @@ def Option_Press(self, event): # wxGlade: MyFrame. self.hold_home_statictext.Enable() self.hold_home_slider.Enable() self.Parent.current_experiment[self.Parent.highlit_task_num]['hold_on_home'] = True + self.Parent.current_experiment[self.Parent.highlit_task_num]['pre_reach_aim'] = False def hold_home_choose(self, event): # wxGlade: MyFrame. self.hold_home_chosen = exp.myRounder(event.GetInt(), 100) From 1b70c61347e3a1bacde64d899f962af99d490f7d Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 8 Oct 2019 12:32:49 -0400 Subject: [PATCH 08/17] Further changes to ensure GUI works with Exp --- Exp.py | 7 +++++-- GUI.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Exp.py b/Exp.py index e5e17b1..98c2d4b 100644 --- a/Exp.py +++ b/Exp.py @@ -267,7 +267,7 @@ def draw(self): cfg['home_arrow'] = myHomeArrow(cfg,size=cfg['radius']) def doAiming(cfg,isAim): - if (isAim == True): + if (preTrialAction == True and isAim == True): print "IN doAiming FUNCTION" cfg['aim'] = sp.NaN @@ -885,9 +885,12 @@ def run_experiment(participant, experiment = {}): settings = deepcopy(experiment['settings']) # same here... print running print "---------------------------------------------------------------------------------" + global preTrialAction global isAim + preTrialAction = running[0]['pre_trial_check'] isAim = running[0]['pre_reach_aim'] - print isAim + print "Pre Trial: " + str(preTrialAction) + print "Is Aim: " + str(isAim) cfg = {} diff --git a/GUI.py b/GUI.py index ba38968..d4e1ad0 100644 --- a/GUI.py +++ b/GUI.py @@ -2750,6 +2750,7 @@ def __init__(self, *args, **kwds): self.__do_layout() def Option_Press(self, event): # wxGlade: MyFrame. + chosen_option = event.GetString() if (chosen_option == "Pre-Reach Aiming"): print "Pre-Reach Aiming" From 94539cfa4820a4ebc37f8f3bdb60c062ac374c5e Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Wed, 30 Oct 2019 13:58:17 -0400 Subject: [PATCH 09/17] Updating slider values for Hold at Home --- GUI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GUI.py b/GUI.py index d4e1ad0..c9b667e 100644 --- a/GUI.py +++ b/GUI.py @@ -2786,7 +2786,7 @@ def __set_properties(self): self.Bind(wx.EVT_RADIOBOX, self.Option_Press, self.pre_trial_radio_box) self.hold_home_statictext = wx.StaticText(self, wx.ID_ANY, ("Time Holding Home (in ms)")) - self.hold_home_slider = wx.Slider(self, wx.ID_ANY, minValue = 0, maxValue = 10000, value = 1500, style=wx.SL_HORIZONTAL | wx.SL_LABELS) + self.hold_home_slider = wx.Slider(self, wx.ID_ANY, minValue = 50, maxValue = 10000, value = 50, style=wx.SL_HORIZONTAL | wx.SL_LABELS) self.Bind(wx.EVT_SLIDER, self.hold_home_choose, self.hold_home_slider) self.hold_home_statictext.SetPosition((5,80)) From 4f61897cbb5165b42d6f370ae9cc598029accd2b Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Wed, 30 Oct 2019 14:55:39 -0400 Subject: [PATCH 10/17] Adding in hold_home test to see if data is stored. NOTE: Will have to test with delay in tomorrow plus further functionality of holding to be added. Put into a function so all logic occurs outside of main trial_runner --- Exp.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Exp.py b/Exp.py index 98c2d4b..ad0e13f 100644 --- a/Exp.py +++ b/Exp.py @@ -286,7 +286,6 @@ def doAiming(cfg,isAim): print "drew arrow" aimDecided = False - n = 1 #event.clearEvents() @@ -301,7 +300,8 @@ def doAiming(cfg,isAim): print 'aim decided' cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 print cfg['aim_arrow'].ori - sys.exit('Aim chosen and exited') + cfg['win'].flip() + #sys.exit('Aim chosen and exited') #stopaiming = time.time() #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only @@ -309,14 +309,12 @@ def doAiming(cfg,isAim): cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 #cfg['aim_arrow'].draw() print "LEFT" - n = n + 1 #time.sleep(0.5) #print(cfg['aim_arrow'].ori) elif cfg['keyboard'][key.RIGHT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 #cfg['aim_arrow'].draw() print "RIGHT" - n = n + 1 #time.sleep(0.5) #print(cfg['aim_arrow'].ori) #print(cfg['keyboard']) @@ -570,6 +568,11 @@ def trial_runner(cfg={}): cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) #doAiming(cfg) + if (holdHome >= 50): + print holdHome + + doAiming(cfg,isAim) + try: if (pos_buffer == 0): @@ -592,7 +595,7 @@ def trial_runner(cfg={}): print('Failed to show object: ') print(e) pass - doAiming(cfg,isAim) + #doAiming(cfg,isAim) # phase 1 is getting to the home position (usually over very soon) try: @@ -653,6 +656,7 @@ def trial_runner(cfg={}): if (get_dist(circle_pos, endPos) < dist_criterion and velocity < 35 and cfg['terminal_feedback'] == False): phase_2 = True show_home = True + show_target = False # If we are using end of reach to show feedback, change the colours for @@ -887,8 +891,10 @@ def run_experiment(participant, experiment = {}): print "---------------------------------------------------------------------------------" global preTrialAction global isAim + global holdHome preTrialAction = running[0]['pre_trial_check'] isAim = running[0]['pre_reach_aim'] + holdHome = running[0]['hold_home'] print "Pre Trial: " + str(preTrialAction) print "Is Aim: " + str(isAim) From 8875fd4e47339c79739dabba49a7d9f362310ee6 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 5 Nov 2019 12:44:55 -0500 Subject: [PATCH 11/17] Removed sleep for hold. Hold compares current time now with hold time. Currently has an infinite loop occurring when comparing time that must be fixed (breaking to temp fix now) --- Exp.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Exp.py b/Exp.py index ad0e13f..2c6b3fc 100644 --- a/Exp.py +++ b/Exp.py @@ -6,7 +6,7 @@ from numpy import sqrt, arctan2, cos, sin, linalg, clip, ndarray, array, diff, mean, arange, pi, dot import csv import math -import time +#import time import scipy as sp from pandas import concat, DataFrame from random import choice, seed, shuffle @@ -20,7 +20,7 @@ except: pass -from time import time +from time import time, sleep root = Tk() def addWorkSpaceLimits(screen): @@ -339,7 +339,22 @@ def doAiming(cfg,isAim): return(cfg) - +def hold_at_home_function(holdHome): + if (holdHome >= 50 and isHold == True): + firstTime = time() + print firstTime + holdTime = firstTime + holdHome + print holdTime + holding = True + while (holding == True): + currentTime = time() + if (currentTime >= holdTime): + holding = False + break + else: + print "still holding" + break + print "We held" def trial_runner(cfg={}): try: @@ -568,8 +583,11 @@ def trial_runner(cfg={}): cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) #doAiming(cfg) - if (holdHome >= 50): + if (holdHome >= 50 and isHold == True): print holdHome + hold_at_home_function(holdHome) + print "WE HELD" + #time.sleep() doAiming(cfg,isAim) @@ -892,11 +910,14 @@ def run_experiment(participant, experiment = {}): global preTrialAction global isAim global holdHome + global isHold preTrialAction = running[0]['pre_trial_check'] isAim = running[0]['pre_reach_aim'] holdHome = running[0]['hold_home'] + isHold = running[0]['hold_on_home'] print "Pre Trial: " + str(preTrialAction) print "Is Aim: " + str(isAim) + print "Hold at home run_experiment: " + str(holdHome) cfg = {} From 29bac03f3f9ab5d573921797af6670ce15118959 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 12 Nov 2019 13:00:15 -0500 Subject: [PATCH 12/17] aiming: Can only aim on trial now. Must fix so arrow updates origin position --- Exp.py | 154 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 60 deletions(-) diff --git a/Exp.py b/Exp.py index 2c6b3fc..795fdcd 100644 --- a/Exp.py +++ b/Exp.py @@ -267,66 +267,64 @@ def draw(self): cfg['home_arrow'] = myHomeArrow(cfg,size=cfg['radius']) def doAiming(cfg,isAim): - if (preTrialAction == True and isAim == True): - print "IN doAiming FUNCTION" - - cfg['aim'] = sp.NaN - print "1" - cfg['aimtime_ms'] = sp.NaN - print "2" - cfg['keyboard'] = key.KeyStateHandler() - print "3" - cfg['win'].winHandle.push_handlers(cfg['keyboard']) - print "4" - cfg['end_circle'].draw() - cfg['aim_arrow'].ori = -1 - cfg['aim_arrow'].draw() - cfg['win'].flip() - print "drew arrow" + print "IN doAiming FUNCTION" - aimDecided = False + cfg['aim'] = sp.NaN + cfg['aimtime_ms'] = sp.NaN + cfg['keyboard'] = key.KeyStateHandler() + cfg['win'].winHandle.push_handlers(cfg['keyboard']) - #event.clearEvents() + cfg['end_circle'].draw() + cfg['aim_arrow'].ori = -1 + cfg['aim_arrow'].draw() + cfg['win'].flip() + print "drew arrow" + + aimDecided = False + + #event.clearEvents() #startaiming = time.time() - while(aimDecided == False): + while(aimDecided == False): #print 'entered loop' - if (cfg['keyboard'][key.ENTER]): - cfg['aim'] = -1 * cfg['aim_arrow'].ori - aimDecided = True - print 'aim decided' - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 - print cfg['aim_arrow'].ori - cfg['win'].flip() - #sys.exit('Aim chosen and exited') - #stopaiming = time.time() + if (cfg['keyboard'][key.ENTER]): + cfg['aim'] = -1 * cfg['aim_arrow'].ori + aimDecided = True + print 'aim decided' + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + print cfg['aim_arrow'].ori + #cfg['win'].flip() + print "Aim Decided " + str(aimDecided) + break + return cfg['aim_arrow'].ori + #sys.exit('Aim chosen and exited') + #stopaiming = time.time() #NOTE: RYAN CHANGED key.NUM_LEFT and key.NUM_RIGHT to key.LEFT and key.RIGHT --> Local change only - elif cfg['keyboard'][key.LEFT]: - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 - #cfg['aim_arrow'].draw() - print "LEFT" - #time.sleep(0.5) - #print(cfg['aim_arrow'].ori) - elif cfg['keyboard'][key.RIGHT]: - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 - #cfg['aim_arrow'].draw() - print "RIGHT" + elif cfg['keyboard'][key.LEFT]: + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 + #cfg['aim_arrow'].draw() + print "LEFT" + #time.sleep(0.5) + #print(cfg['aim_arrow'].ori) + elif cfg['keyboard'][key.RIGHT]: + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 + #cfg['aim_arrow'].draw() + print "RIGHT" #time.sleep(0.5) #print(cfg['aim_arrow'].ori) #print(cfg['keyboard']) - cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 - - cfg['end_circle'].draw() - cfg['aim_arrow'].draw() - cfg['win'].flip() + cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 + cfg['end_circle'].draw() + cfg['aim_arrow'].draw() + cfg['win'].flip() - if cfg['keyboard'][key.ESCAPE]: - sys.exit('escape key pressed') + if cfg['keyboard'][key.ESCAPE]: + sys.exit('escape key pressed') #if (cfg['aim'] < 0) or (cfg['aim'] > 360): #cfg['aim'] = cfg['aim'] % 360 @@ -337,7 +335,10 @@ def doAiming(cfg,isAim): #print(cfg['aim']) - return(cfg) + #return(cfg) + print "we done" + isAim = False + return cfg['aim_arrow'].ori def hold_at_home_function(holdHome): if (holdHome >= 50 and isHold == True): @@ -348,11 +349,14 @@ def hold_at_home_function(holdHome): holding = True while (holding == True): currentTime = time() + print currentTime if (currentTime >= holdTime): holding = False break else: print "still holding" + currentTime = time() + print currentTime break print "We held" @@ -464,6 +468,18 @@ def trial_runner(cfg={}): if (cfg['use_score']): myCircle.lineColor = myCircle.fillColor = [0, 0, 0] endCircle.lineColor = endCircle.fillColor = [0, 0, 0] + #doAiming(cfg,isAim) + if (preTrialAction == True and isAim == True): + winSize = cfg['win'].size + PPC = max(winSize)/31. + cfg['NSU'] = PPC * 8 + print startPos + print startPos[0] + print startPos[1] + arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) + cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) + aimValue = doAiming(cfg,isAim) + print "AIM VALUE: " + str(aimValue) except Exception as e: print "error in Block 1" # what is block 1? @@ -573,23 +589,28 @@ def trial_runner(cfg={}): # SHOW OBJECTS - winSize = cfg['win'].size - PPC = max(winSize)/31. - - cfg['NSU'] = PPC * 8 - - arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) - - cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) + # winSize = cfg['win'].size + # PPC = max(winSize)/31. + # + # cfg['NSU'] = PPC * 8 + # + # arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) + # + # cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) #doAiming(cfg) - if (holdHome >= 50 and isHold == True): - print holdHome - hold_at_home_function(holdHome) - print "WE HELD" + #if (holdHome >= 50 and isHold == True): + # print holdHome + # hold_at_home_function(holdHome) + # print "WE HELD" #time.sleep() - doAiming(cfg,isAim) + + #doAiming(cfg,isAim) + # if (preTrialAction == True and isAim == True): + # aimValue = doAiming(cfg,isAim) + # print "AIM VALUE: " + str(aimValue) + # pass try: @@ -614,9 +635,14 @@ def trial_runner(cfg={}): print(e) pass #doAiming(cfg,isAim) - + #if (isAim == True): + # print "Target aim: " + str(doAiming(cfg,isAim)) + # break # phase 1 is getting to the home position (usually over very soon) try: + #if (isAim == True): + # print "Target aim: " + str(doAiming(cfg,isAim)) + # break if (phase_1 == False): if (cfg['trial_type'] == 'cursor'): if (get_dist(circle_pos, startPos) < dist_criterion and velocity < 35): @@ -1207,6 +1233,14 @@ def Pos(self): running[i]['target_distance'] = int(running[i]['max_distance']*running[i]['target_distance_ratio']) running[i]['time'] = core.getTime() + + #checking if we must do a pre-trail action, if yes: do it then proceed to do trial + #if (preTrialAction == True): + #if (isAim == True): + #doAiming(cfg,isAim) + #elif (isHold == True): + #hold_at_home_function(holdHome) + exp = trial_runner(running[i]) # but this runs a whole task, not a single trial, right? since we are going from the experiment runner straight to task... is the function misnamed or is the code not organized? if exp == 'escaped': From 9716c5cef820ade33e291b5534310f5371028179 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 14 Nov 2019 15:01:26 -0500 Subject: [PATCH 13/17] aiming: aim option boolean and aim value in degrees successfully added to exp table --- Exp.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Exp.py b/Exp.py index 795fdcd..381651b 100644 --- a/Exp.py +++ b/Exp.py @@ -469,6 +469,8 @@ def trial_runner(cfg={}): myCircle.lineColor = myCircle.fillColor = [0, 0, 0] endCircle.lineColor = endCircle.fillColor = [0, 0, 0] #doAiming(cfg,isAim) + global aimValue + aimValue = -1 if (preTrialAction == True and isAim == True): winSize = cfg['win'].size PPC = max(winSize)/31. @@ -874,6 +876,9 @@ def trial_runner(cfg={}): timePos_dict['targetdistance_percmax'] = int(cfg['target_distance_ratio']*100) timePos_dict['accuracy_reward'] = [cfg['score_points']] * len(mouseposXArray) + timePos_dict['pre_reach_aim'] = cfg['pre_reach_aim'] + timePos_dict['aim_value'] = 0 + if (cfg['use_score']): @@ -881,8 +886,8 @@ def trial_runner(cfg={}): else: timePos_dict['accuracy_reward_bool'] = ['False'] * len(mouseposXArray) - - + print "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + print timePos_dict['aim_value'] return timePos_dict elif ((cfg['trial_type'] == 'no_cursor' or cfg['trial_type'] == 'error_clamp' or (cfg['trial_type'] == 'cursor' and cfg['terminal_feedback'] == True)) and get_dist(circle_pos, startPos) <= 3*get_dist(startPos, endPos)/20): @@ -1242,6 +1247,12 @@ def Pos(self): #hold_at_home_function(holdHome) exp = trial_runner(running[i]) # but this runs a whole task, not a single trial, right? since we are going from the experiment runner straight to task... is the function misnamed or is the code not organized? + if (isAim == True): + #print cfg + #print "===============================================================" + exp['aim_value'] = aimValue + #print exp['aim_value'] + #timePos_dict['aim_value'] = cfg['aim_arrow'].ori if exp == 'escaped': running[i]['win'].close() @@ -1249,7 +1260,7 @@ def Pos(self): else: # is this where the data is saved? # would make more sense to me to do that in the trial function, as it is the trial data that is being stored? - df_exp = DataFrame(exp, columns=['task_num','task_name', 'trial_type', 'trial_num', 'terminalfeedback_bool','rotation_angle','targetangle_deg','targetdistance_percmax','homex_px','homey_px','targetx_px','targety_px', 'time_s', 'mousex_px', 'mousey_px', 'cursorx_px', 'cursory_px', 'accuracy_reward', 'accuracy_reward_bool']) + df_exp = DataFrame(exp, columns=['task_num','task_name', 'trial_type', 'trial_num', 'terminalfeedback_bool','rotation_angle','targetangle_deg','targetdistance_percmax','homex_px','homey_px','targetx_px','targety_px', 'time_s', 'mousex_px', 'mousey_px', 'cursorx_px', 'cursory_px', 'accuracy_reward', 'accuracy_reward_bool', 'pre_reach_aim', 'aim_value']) df_exp.to_csv(path_or_buf = path.join("data", settings['experiment_folder'], participant, running[i]['task_name'] + "_" + str(trial_num) + ".csv"), index=False) task_save = concat([task_save, df_exp]) end_exp = concat([end_exp, df_exp]) @@ -1564,7 +1575,7 @@ def Pos(self): running[i]['win'].close() return end_exp else: - df_exp = DataFrame(exp, columns=['task_num','task_name', 'trial_type', 'trial_num', 'terminalfeedback_bool','rotation_angle','targetangle_deg','targetdistance_percmax','homex_px','homey_px','targetx_px','targety_px', 'time_s', 'mousex_px', 'mousey_px', 'cursorx_px', 'cursory_px', 'accuracy_reward', 'accuracy_reward_bool']) + df_exp = DataFrame(exp, columns=['task_num','task_name', 'trial_type', 'trial_num', 'terminalfeedback_bool','rotation_angle','targetangle_deg','targetdistance_percmax','homex_px','homey_px','targetx_px','targety_px', 'time_s', 'mousex_px', 'mousey_px', 'cursorx_px', 'cursory_px', 'accuracy_reward', 'accuracy_reward_bool', 'pre_reach_aim']) df_exp.to_csv(path_or_buf = path.join("data", settings['experiment_folder'], participant, running[i]['task_name'] + "_" + str(trial_num) + ".csv"), index=False) end_exp = concat([end_exp, df_exp]) From f964060ec288ce2ad1a30e487c4742870c7f6476 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 21 Nov 2019 14:37:39 -0500 Subject: [PATCH 14/17] aiming: aim updated so arrow starts at proper home position --- Exp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Exp.py b/Exp.py index 381651b..1ace1bc 100644 --- a/Exp.py +++ b/Exp.py @@ -307,13 +307,13 @@ def doAiming(cfg,isAim): elif cfg['keyboard'][key.LEFT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori - 1 #cfg['aim_arrow'].draw() - print "LEFT" + #print "LEFT" #time.sleep(0.5) #print(cfg['aim_arrow'].ori) elif cfg['keyboard'][key.RIGHT]: cfg['aim_arrow'].ori = cfg['aim_arrow'].ori + 1 #cfg['aim_arrow'].draw() - print "RIGHT" + #print "RIGHT" #time.sleep(0.5) #print(cfg['aim_arrow'].ori) #print(cfg['keyboard']) @@ -457,6 +457,7 @@ def trial_runner(cfg={}): ### starting circle startCircle.setPos(startPos) + print "START: " + str(startPos) arrow.setPos(startPos) arrowFill.setPos(startPos) ### Rotation direction @@ -480,6 +481,8 @@ def trial_runner(cfg={}): print startPos[1] arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) + cfg['aim_arrow'].pos = startPos + print cfg['aim_arrow'].pos aimValue = doAiming(cfg,isAim) print "AIM VALUE: " + str(aimValue) From 2665012ca9bc43337d2d35d63977d1224ba6b105 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Thu, 21 Nov 2019 14:57:45 -0500 Subject: [PATCH 15/17] aiming: Aiming arrow starts 10 degrees away from target to make user aiming easier --- Exp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Exp.py b/Exp.py index 1ace1bc..55b8b1a 100644 --- a/Exp.py +++ b/Exp.py @@ -276,7 +276,7 @@ def doAiming(cfg,isAim): cfg['win'].winHandle.push_handlers(cfg['keyboard']) cfg['end_circle'].draw() - cfg['aim_arrow'].ori = -1 + cfg['aim_arrow'].ori = (-1 * cfg['target_angle']) + 10 cfg['aim_arrow'].draw() cfg['win'].flip() print "drew arrow" @@ -457,7 +457,6 @@ def trial_runner(cfg={}): ### starting circle startCircle.setPos(startPos) - print "START: " + str(startPos) arrow.setPos(startPos) arrowFill.setPos(startPos) ### Rotation direction @@ -482,6 +481,7 @@ def trial_runner(cfg={}): arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) cfg['aim_arrow'].pos = startPos + cfg['aim_arrow'].ori = cfg['target_angle'] print cfg['aim_arrow'].pos aimValue = doAiming(cfg,isAim) print "AIM VALUE: " + str(aimValue) From d226d6168b9f6a964e6cd8b54cede834e84784fe Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Tue, 26 Nov 2019 12:50:13 -0500 Subject: [PATCH 16/17] Aiming: Cleaned up print statements and other bugs. Added random for arrow starting angle --- Exp.py | 80 ++++++++++++++++++++-------------------------------------- 1 file changed, 28 insertions(+), 52 deletions(-) diff --git a/Exp.py b/Exp.py index 55b8b1a..c344a49 100644 --- a/Exp.py +++ b/Exp.py @@ -6,6 +6,7 @@ from numpy import sqrt, arctan2, cos, sin, linalg, clip, ndarray, array, diff, mean, arange, pi, dot import csv import math +import random #import time import scipy as sp from pandas import concat, DataFrame @@ -268,7 +269,7 @@ def draw(self): def doAiming(cfg,isAim): - print "IN doAiming FUNCTION" + #print "IN doAiming FUNCTION" cfg['aim'] = sp.NaN cfg['aimtime_ms'] = sp.NaN @@ -276,10 +277,10 @@ def doAiming(cfg,isAim): cfg['win'].winHandle.push_handlers(cfg['keyboard']) cfg['end_circle'].draw() - cfg['aim_arrow'].ori = (-1 * cfg['target_angle']) + 10 + cfg['aim_arrow'].ori = (-1 * cfg['target_angle']) + random.randint(-10,10) cfg['aim_arrow'].draw() cfg['win'].flip() - print "drew arrow" + #print "drew arrow" aimDecided = False @@ -293,11 +294,11 @@ def doAiming(cfg,isAim): if (cfg['keyboard'][key.ENTER]): cfg['aim'] = -1 * cfg['aim_arrow'].ori aimDecided = True - print 'aim decided' + #print 'aim decided' cfg['aim_arrow'].ori = cfg['aim_arrow'].ori % 360 - print cfg['aim_arrow'].ori + #print cfg['aim_arrow'].ori --->PRINTS DEGREE #cfg['win'].flip() - print "Aim Decided " + str(aimDecided) + #print "Aim Decided " + str(aimDecided) break return cfg['aim_arrow'].ori #sys.exit('Aim chosen and exited') @@ -336,8 +337,7 @@ def doAiming(cfg,isAim): #return(cfg) - print "we done" - isAim = False + #print "we done" return cfg['aim_arrow'].ori def hold_at_home_function(holdHome): @@ -471,20 +471,24 @@ def trial_runner(cfg={}): #doAiming(cfg,isAim) global aimValue aimValue = -1 + # if (isAim == True): + # show_home = False + # show_cursor = False + if (preTrialAction == True and isAim == True): winSize = cfg['win'].size PPC = max(winSize)/31. cfg['NSU'] = PPC * 8 - print startPos - print startPos[0] - print startPos[1] + #print startPos + #print startPos[0] + #print startPos[1] arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) cfg['aim_arrow'].pos = startPos cfg['aim_arrow'].ori = cfg['target_angle'] - print cfg['aim_arrow'].pos + #print cfg['aim_arrow'].pos aimValue = doAiming(cfg,isAim) - print "AIM VALUE: " + str(aimValue) + #print "AIM VALUE: " + str(aimValue) except Exception as e: print "error in Block 1" # what is block 1? @@ -594,34 +598,11 @@ def trial_runner(cfg={}): # SHOW OBJECTS - # winSize = cfg['win'].size - # PPC = max(winSize)/31. - # - # cfg['NSU'] = PPC * 8 - # - # arrowvertices = ((-.02,-.02),(0.82,-.02),(0.8,-.08),(1,0),(0.8,.08),(0.82,.02),(-.02,.02)) - # - # cfg['aim_arrow'] = ShapeStim(win=cfg['win'], lineWidth=cfg['NSU']*0.005, lineColorSpace='rgb', lineColor='#CC00CC', fillColorSpace='rgb', fillColor=None, vertices=arrowvertices, closeShape=True, size=PPC*7) - - #doAiming(cfg) - #if (holdHome >= 50 and isHold == True): - # print holdHome - # hold_at_home_function(holdHome) - # print "WE HELD" - #time.sleep() - - - #doAiming(cfg,isAim) - # if (preTrialAction == True and isAim == True): - # aimValue = doAiming(cfg,isAim) - # print "AIM VALUE: " + str(aimValue) - # pass - - try: if (pos_buffer == 0): pos_buffer = pos_buffer + 1 if (show_home == True): + #print "PRINT START CIRCLE HERE" startCircle.draw() # home position #cfg['aim_arrow'].draw() #doAiming(cfg) @@ -631,6 +612,7 @@ def trial_runner(cfg={}): arrow.draw() arrowFill.draw() if (show_cursor == True): + #print "PRINT MY CURSOR HERE" myCircle.draw() # cursor # Show the score text only in cursor and error-clamp if (cfg['use_score'] and cfg['trial_type'] != 'no_cursor' and cfg['trial_type'] != 'pause'): @@ -639,15 +621,7 @@ def trial_runner(cfg={}): print('Failed to show object: ') print(e) pass - #doAiming(cfg,isAim) - #if (isAim == True): - # print "Target aim: " + str(doAiming(cfg,isAim)) - # break - # phase 1 is getting to the home position (usually over very soon) try: - #if (isAim == True): - # print "Target aim: " + str(doAiming(cfg,isAim)) - # break if (phase_1 == False): if (cfg['trial_type'] == 'cursor'): if (get_dist(circle_pos, startPos) < dist_criterion and velocity < 35): @@ -745,6 +719,7 @@ def trial_runner(cfg={}): score_text.draw() # show feedback: + #print "PRINT END CIRCLE HERE 2" endCircle.draw() myCircle.draw() @@ -812,6 +787,7 @@ def trial_runner(cfg={}): while (show_terminal): # show feedback: + #print "PRINTING END CIRCLE HERE 3" endCircle.draw() myCircle.draw() myWin.flip() @@ -889,8 +865,8 @@ def trial_runner(cfg={}): else: timePos_dict['accuracy_reward_bool'] = ['False'] * len(mouseposXArray) - print "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - print timePos_dict['aim_value'] + #print "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + #print timePos_dict['aim_value'] return timePos_dict elif ((cfg['trial_type'] == 'no_cursor' or cfg['trial_type'] == 'error_clamp' or (cfg['trial_type'] == 'cursor' and cfg['terminal_feedback'] == True)) and get_dist(circle_pos, startPos) <= 3*get_dist(startPos, endPos)/20): @@ -939,8 +915,8 @@ def run_experiment(participant, experiment = {}): task_save = DataFrame({}) running = deepcopy(experiment['experiment']) # why copy this? set up a window, a mouse object and add those, plus a task-index to your cfg, then simply loop through the tasks, and throw that to a run-task function? settings = deepcopy(experiment['settings']) # same here... - print running - print "---------------------------------------------------------------------------------" + #print running + #print "---------------------------------------------------------------------------------" global preTrialAction global isAim global holdHome @@ -949,9 +925,9 @@ def run_experiment(participant, experiment = {}): isAim = running[0]['pre_reach_aim'] holdHome = running[0]['hold_home'] isHold = running[0]['hold_on_home'] - print "Pre Trial: " + str(preTrialAction) - print "Is Aim: " + str(isAim) - print "Hold at home run_experiment: " + str(holdHome) + #print "Pre Trial: " + str(preTrialAction) + #print "Is Aim: " + str(isAim) + #print "Hold at home run_experiment: " + str(holdHome) cfg = {} From f67a3d1e1322823df45343a5a1f33091545ba888 Mon Sep 17 00:00:00 2001 From: ryanguido29 Date: Wed, 12 Feb 2020 11:48:54 -0500 Subject: [PATCH 17/17] changes --- Exp.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Exp.py b/Exp.py index c344a49..45950ce 100644 --- a/Exp.py +++ b/Exp.py @@ -290,7 +290,6 @@ def doAiming(cfg,isAim): while(aimDecided == False): #print 'entered loop' - if (cfg['keyboard'][key.ENTER]): cfg['aim'] = -1 * cfg['aim_arrow'].ori aimDecided = True