Skip to content

Commit 94040ff

Browse files
authored
Merge pull request #10 from compmem/dylan_changes
Dylan changes
2 parents ad7cd13 + 92e867a commit 94040ff

File tree

14 files changed

+831
-414
lines changed

14 files changed

+831
-414
lines changed

.github/workflows/build_executables.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
- name: save exe
5858
uses: actions/upload-artifact@v4
5959
with:
60-
name: SUPREME_win
61-
path: package/dist/SUPREME.exe
60+
name: NIMHCogMood_win
61+
path: package/dist/NIMHCogMood.exe
6262

6363

6464
build-macos:
@@ -111,12 +111,12 @@ jobs:
111111
cd package
112112
python3 -m PyInstaller --noconfirm cogmood_mac.spec
113113
cd ..
114-
mkdir SUPREME
115-
cp -r package/dist/SUPREME.app SUPREME/
116-
create-dmg --volname SUPREME SUPREME.dmg SUPREME
114+
mkdir NIMHCogMood
115+
cp -r package/dist/NIMHCogMood.app NIMHCogMood/
116+
create-dmg --volname NIMHCogMood NIMHCogMood.dmg NIMHCogMood
117117
118118
- name: Upload macOS executable
119119
uses: actions/upload-artifact@v4
120120
with:
121-
name: SUPREME_mac
122-
path: SUPREME.dmg
121+
name: NIMHCogMood_mac
122+
path: NIMHCogMood.dmg

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
BartuvaExp(Bartuva_config,
201201
run_num=exp.block_number,
202202
sub_dir=Ref.object(exp)._session_dir,
203-
practice=False,
203+
practice=True,
204204
task_dir=task2dir,
205205
happy_mid=False)
206206

package/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Define the spec files for each OS
22
MAC_SPEC_FILE=cogmood_mac.spec
33
WIN_SPEC_FILE=cogmood_windows.spec
4-
EXECUTABLE_NAME=SUPREME
4+
EXECUTABLE_NAME=NIMHCogMood
55

66
# Define UPX executable path
77
WIN_UPX=upx/windows_upx.exe

package/cogmood_mac.spec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exe = EXE(
3838
a.zipfiles,
3939
a.datas,
4040
[],
41-
name='SUPREME',
41+
name='NIMHCogMood',
4242
debug=False,
4343
bootloader_ignore_signals=False,
4444
strip=False,
@@ -51,14 +51,14 @@ exe = EXE(
5151

5252
app = BUNDLE(
5353
exe,
54-
name='SUPREME.app',
54+
name='NIMHCogMood.app',
5555
icon=None,
56-
bundle_identifier='uva.compmem.supreme',
56+
bundle_identifier='nimh.mlc.nimhcogmood',
5757
info_plist={
5858
'NSHighResolutionCapable': 'True',
59-
'CFBundleDisplayName': 'SUPREME',
60-
'CFBundleName': 'SUPREME',
61-
'CFBundleIdentifier': 'uva.compmem.supreme',
59+
'CFBundleDisplayName': 'NIMHCogMood',
60+
'CFBundleName': 'NIMHCogMood',
61+
'CFBundleIdentifier': 'nimh.mlc.nimhcogmood',
6262
'CFBundleVersion': '1.0.0',
6363
'CFBundleShortVersionString': '1.0.0',
6464
'LSArchitecturePriority': ['x86_64', 'arm64'],

package/cogmood_windows.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exe = EXE(pyz,
3737
a.zipfiles,
3838
a.datas,
3939
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
40-
name='SUPREME',
40+
name='NIMHCogMood',
4141
debug=False,
4242
bootloader_ignore_signals=False,
4343
strip=False,

package/exe_versioning.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ VSVersionInfo(
1616
[
1717
StringTable(
1818
u'040904B0',
19-
[StringStruct(u'CompanyName', u'UVA CompMem'),
19+
[StringStruct(u'CompanyName', u'NIMH MLC'),
2020
StringStruct(u'FileDescription', u''),
2121
StringStruct(u'FileVersion', u'1.0.0.0'),
22-
StringStruct(u'InternalName', u'SUPREME - CogMood'),
22+
StringStruct(u'InternalName', u'NIMH - CogMood'),
2323
StringStruct(u'LegalCopyright', u''),
24-
StringStruct(u'OriginalFilename', u'SUPREME.exe'),
25-
StringStruct(u'ProductName', u'SUPREME - CogMood'),
24+
StringStruct(u'OriginalFilename', u'NIMHCogMood.exe'),
25+
StringStruct(u'ProductName', u'NIMH - CogMood'),
2626
StringStruct(u'ProductVersion', u'1.0.0.0'),
2727
StringStruct(u'WorkerID', u'"------------------------------------------------".---------------------------')])
2828
]),

tasks/AssBind/instruct.py

Lines changed: 104 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,115 @@
33
from smile.scale import scale as s
44
from .GetResponse import GetResponse
55

6+
7+
def get_is_first(run_num):
8+
return run_num == 0
69
# present instructions
710
@Subroutine
8-
def Instruct(self, config, text_names):#, resp_keys, touch, font_size):
11+
def Instruct(self, config, text_names, run_num):#, resp_keys, touch, font_size):
12+
13+
is_first = Func(get_is_first, run_num).result
914

1015
texts = get_text(config)
11-
with Parallel():
12-
if not config.TOUCH:
13-
MouseCursor(blocking=False)
14-
with Serial(blocking=False):
15-
for doc in text_names:
16-
with Parallel():
17-
title = Label(text='Memory Task Instructions',
18-
font_size=s(config.INST_TITLE_FONT_SIZE),
16+
with If(is_first):
17+
with Parallel():
18+
if not config.TOUCH:
19+
MouseCursor(blocking=False)
20+
with Serial(blocking=True):
21+
for doc in text_names:
22+
with Parallel():
23+
title = Label(text='Memory Task Instructions',
24+
font_size=s(config.INST_TITLE_FONT_SIZE),
25+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
26+
top=self.exp.screen.center_y + s(415))
27+
28+
# image != None for 4 example slides
29+
with If(texts[doc]['image'] != None):
30+
image = Image(source=texts[doc]['image'],
31+
top=(title.bottom - s(10)),
32+
width=s(config.INST_IMG_WIDTH),
33+
height=s(config.INST_IMG_HEIGHT),
34+
allow_stretch=True, keep_ratio=False)
35+
with If(texts[doc]['image'] != None):
36+
Label(text=texts[doc]['text'],
37+
font_size=s(config.INST_FONT_SIZE),
38+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
39+
top=(image.bottom - s(10)))
40+
41+
# image == None for first and last slides (instructions and reminder)
42+
with If(texts[doc]['image'] == None):
43+
Label(text=texts[doc]['text'],
44+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
45+
font_size=s(config.INST_FONT_SIZE),
46+
top=(title.bottom - s(10)))
47+
48+
with UntilDone():
49+
Wait(1.0)
50+
GetResponse(keys=texts[doc]['keys'])
51+
52+
with Else():
53+
with Parallel():
54+
if not config.TOUCH:
55+
MouseCursor(blocking=False)
56+
with Serial(blocking=False):
57+
for doc in text_names:
58+
with Parallel():
59+
title = Label(text='Memory Task Instructions',
60+
font_size=s(config.INST_TITLE_FONT_SIZE),
61+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
62+
top=self.exp.screen.center_y + s(415))
63+
64+
# image != None for 4 example slides
65+
with If(texts[doc]['image'] != None):
66+
image = Image(source=texts[doc]['image'],
67+
top=(title.bottom - s(10)),
68+
width=s(config.INST_IMG_WIDTH),
69+
height=s(config.INST_IMG_HEIGHT),
70+
allow_stretch=True, keep_ratio=False)
71+
with If(texts[doc]['image'] != None):
72+
Label(text=texts[doc]['text'],
73+
font_size=s(config.INST_FONT_SIZE),
74+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
75+
top=(image.bottom - s(10)))
76+
77+
# image == None for first and last slides (instructions and reminder)
78+
with If(texts[doc]['image'] == None):
79+
Label(text=texts[doc]['text'] + '\n\nYou may press the button in the'
80+
' lower right corner to skip the practice',
1981
text_size=(s(config.TEXT_SIZE_WIDTH), None),
20-
top=self.exp.screen.center_y + s(415))
21-
22-
# image != None for 4 example slides
23-
with If(texts[doc]['image'] != None):
24-
image = Image(source=texts[doc]['image'],
25-
top=(title.bottom - s(10)),
26-
width=s(config.INST_IMG_WIDTH),
27-
height=s(config.INST_IMG_HEIGHT),
28-
allow_stretch=True, keep_ratio=False)
29-
with If(texts[doc]['image'] != None):
30-
Label(text=texts[doc]['text'],
31-
font_size=s(config.INST_FONT_SIZE),
32-
text_size=(s(config.TEXT_SIZE_WIDTH), None),
33-
top=(image.bottom - s(10)))
34-
35-
# image == None for first and last slides (instructions and reminder)
36-
with If(texts[doc]['image'] == None):
37-
Label(text=texts[doc]['text'],
38-
text_size=(s(config.TEXT_SIZE_WIDTH), None),
39-
font_size=s(config.INST_FONT_SIZE),
40-
top=(title.bottom - s(10)))
41-
42-
with UntilDone():
43-
Wait(1.0)
44-
GetResponse(keys=texts[doc]['keys'])
45-
46-
#RstDocument(text=texts[doc]['text'],
47-
#width=self.exp.screen.height,
48-
#height=self.exp.screen.height,
49-
#base_font_size=s(config.RST_FONT_SIZE))
50-
51-
52-
with Serial(blocking=False):
53-
with ButtonPress():
54-
Button(text="Skip Practice", right=self.exp.screen.width,
55-
bottom=0, width=s(config.SKIP_SIZE[0]),
56-
height=s(config.SKIP_SIZE[1]), blocking=False,
57-
font_size=s(config.SKIP_FONT_SIZE))
82+
font_size=s(config.INST_FONT_SIZE),
83+
top=(title.bottom - s(10)))
84+
85+
with UntilDone():
86+
Wait(1.0)
87+
GetResponse(keys=texts[doc]['keys'])
88+
89+
#RstDocument(text=texts[doc]['text'],
90+
#width=self.exp.screen.height,
91+
#height=self.exp.screen.height,
92+
#base_font_size=s(config.RST_FONT_SIZE))
93+
94+
with Serial(blocking=False):
95+
with ButtonPress():
96+
Button(text="Skip Practice", right=self.exp.screen.width,
97+
bottom=0, width=s(config.SKIP_SIZE[0]),
98+
height=s(config.SKIP_SIZE[1]), blocking=False,
99+
font_size=s(config.SKIP_FONT_SIZE))
100+
with Parallel():
101+
doc = 'remind'
102+
title = Label(text='Memory Task Instructions',
103+
font_size=s(config.INST_TITLE_FONT_SIZE),
104+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
105+
top=self.exp.screen.center_y + s(415))
106+
Label(text=texts[doc]['text'],
107+
text_size=(s(config.TEXT_SIZE_WIDTH), None),
108+
font_size=s(config.INST_FONT_SIZE),
109+
top=(title.bottom - s(10)))
110+
111+
with UntilDone():
112+
Wait(1.0)
113+
GetResponse(keys=texts[doc]['keys'])
114+
58115
Wait(2.0)
59116

60117

tasks/AssBind/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ def AssBindExp(self, config, sub_dir, task_dir=None, block=0,
7171
text_names = ['main', 'ex1', 'ex2', 'ex3', 'ex4', 'remind']
7272
rem_names = ['remind']
7373
with If(reminder_only):
74-
Instruct(config=config, text_names=rem_names)
74+
Instruct(config=config, text_names=rem_names, run_num=block)
7575
with Else():
76-
Instruct(config=config, text_names=text_names)
76+
Instruct(config=config, text_names=text_names, run_num=block)
7777

7878
Wait(1.0)
7979

tasks/BARTUVA/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
BALLOON_SETUP = [{'range': [0, 8], 'number_of_balloons':8},
99
{'range': [0, 16], 'number_of_balloons':8},
1010
{'range': [8, 16], 'number_of_balloons':8}]
11-
PRACTICE_SETUP = [{'range': [10,10], 'number_of_balloons':0},
12-
{'range': [3,3], 'number_of_balloons':0},
13-
{'range': [6,6], 'number_of_balloons':0}]
11+
PRACTICE_SETUP = [{'range': [10,10], 'number_of_balloons':2},
12+
{'range': [3,3], 'number_of_balloons':2},
13+
{'range': [6,6], 'number_of_balloons':2}]
1414
NUM_BALLOONS = 18
1515
NUM_BAGS = len(BALLOON_SETUP)
1616
BALLOONS_PER_BAG = NUM_BALLOONS/NUM_BAGS

0 commit comments

Comments
 (0)