From 6479b3f900d16840cc7de848775e55cc70e19120 Mon Sep 17 00:00:00 2001
From: tiborauer <tibor.auer@gmail.com>
Date: Tue, 23 Aug 2022 12:31:33 +0100
Subject: [PATCH] ENH - practice

---
 rMtS_multiblock.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/rMtS_multiblock.py b/rMtS_multiblock.py
index a0a0b50..98f1244 100644
--- a/rMtS_multiblock.py
+++ b/rMtS_multiblock.py
@@ -43,7 +43,9 @@ if __name__ == '__main__':
         ('match type', ['single','multi']), # match type ("single" - ~Alekseichuk or "multi" - ~Berger)
         ('match number',1), # number of matches per sample
         ('dedicated response period "?"', False),
-        ('scanner mode', False), # Is it inside the scanner
+        ('practice "?"', False), # practice run
+        ('wait for scanner', False), # waits for scanner pulse
+        ('button box', False), # uses button box
         ('stimulation', False), # Run tES
         ('trigger port', ['none']+listSerial()),
         ('stimulation intensity [mA]', 1) # desired intensity (mA)
@@ -57,14 +59,17 @@ if __name__ == '__main__':
     # Settings
     Monitor = 'testMonitor'
 
-    EMUL = not(expInfo['scanner mode']) # Is it outside the scanner
-    EMUL_BUTTONS = EMUL
+    EMUL = not(expInfo['wait for scanner']) # Is it outside the scanner
+    EMUL_BUTTONS = not(expInfo['button box'])
     doSTIMULATION = expInfo['stimulation'] # Run tES
 
     # - timings
     nDummies = 5 # [5]
     conditionBlockJitterRange = [9, 11]# duration of rest between condition blocks
-    nConditionBlock = 12 # number of condition blocks [12]
+    if expInfo['practice']:
+        nConditionBlock = 2
+    else:
+        nConditionBlock = 12 # number of condition blocks [12]
 
     trialBlockJitterRange = [5, 7] # duration of rest between trialblocks
     nTrialBlock = 3 # number of trial blocks per condition block
@@ -271,7 +276,7 @@ if __name__ == '__main__':
     # - for multimonitor: 
     #   - set the external screen to primary
     #   - set screen=1
-    win = visual.Window([1280,1024],winType='pyglet',screen=1,monitor=mon,units='pix',fullscr=False, autoLog=False, gammaErrorPolicy='ignore')
+    win = visual.Window([1280,1024],winType='pyglet',screen=1,monitor=mon,units='pix',fullscr=True, autoLog=False, gammaErrorPolicy='ignore')
     win.mouseVisible = False
     gridForm = visual.ElementArrayStim(win=win, name='gridForm', nElements=(gridXY+1)*2, sizes=[gridSize,2], xys = gridCoordinates, oris=gridAngles, units='pix', 
             elementTex=ones([16,16]), elementMask=ones([16,16]), colors=colour, colorSpace='rgb', autoLog=False)
@@ -295,8 +300,8 @@ if __name__ == '__main__':
         img = visual.ImageStim(win, image=infoImg[i], pos=[0, -325], size=[int(i*0.7) for i in [1280, 530]])
         img.draw()
         win.flip()
-        if EMUL == EMUL_BUTTONS: SSO.wait_for_button(timeout=inf)
-        else: sleep(2) # EMUL but not EMUL_BUTTONS
+        if not(EMUL_BUTTONS): SSO.wait_for_button(timeout=inf)
+        else: sleep(2)
         
     ######## WAIT FOR SYNCH ########
     msg = visual.TextStim(win, text="Wait for scanner...", height=gridSize*0.1, wrapWidth=win.size[0], autoLog=False)
-- 
GitLab