Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/build_executables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
- name: save exe
uses: actions/upload-artifact@v4
with:
name: SUPREME_win
path: package/dist/SUPREME.exe
name: NIMHCogMood_win
path: package/dist/NIMHCogMood.exe


build-macos:
Expand Down Expand Up @@ -111,12 +111,12 @@ jobs:
cd package
python3 -m PyInstaller --noconfirm cogmood_mac.spec
cd ..
mkdir SUPREME
cp -r package/dist/SUPREME.app SUPREME/
create-dmg --volname SUPREME SUPREME.dmg SUPREME
mkdir NIMHCogMood
cp -r package/dist/NIMHCogMood.app NIMHCogMood/
create-dmg --volname NIMHCogMood NIMHCogMood.dmg NIMHCogMood

- name: Upload macOS executable
uses: actions/upload-artifact@v4
with:
name: SUPREME_mac
path: SUPREME.dmg
name: NIMHCogMood_mac
path: NIMHCogMood.dmg
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
BartuvaExp(Bartuva_config,
run_num=exp.block_number,
sub_dir=Ref.object(exp)._session_dir,
practice=False,
practice=True,
task_dir=task2dir,
happy_mid=False)

Expand Down
2 changes: 1 addition & 1 deletion package/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Define the spec files for each OS
MAC_SPEC_FILE=cogmood_mac.spec
WIN_SPEC_FILE=cogmood_windows.spec
EXECUTABLE_NAME=SUPREME
EXECUTABLE_NAME=NIMHCogMood

# Define UPX executable path
WIN_UPX=upx/windows_upx.exe
Expand Down
12 changes: 6 additions & 6 deletions package/cogmood_mac.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exe = EXE(
a.zipfiles,
a.datas,
[],
name='SUPREME',
name='NIMHCogMood',
debug=False,
bootloader_ignore_signals=False,
strip=False,
Expand All @@ -51,14 +51,14 @@ exe = EXE(

app = BUNDLE(
exe,
name='SUPREME.app',
name='NIMHCogMood.app',
icon=None,
bundle_identifier='uva.compmem.supreme',
bundle_identifier='nimh.mlc.nimhcogmood',
info_plist={
'NSHighResolutionCapable': 'True',
'CFBundleDisplayName': 'SUPREME',
'CFBundleName': 'SUPREME',
'CFBundleIdentifier': 'uva.compmem.supreme',
'CFBundleDisplayName': 'NIMHCogMood',
'CFBundleName': 'NIMHCogMood',
'CFBundleIdentifier': 'nimh.mlc.nimhcogmood',
'CFBundleVersion': '1.0.0',
'CFBundleShortVersionString': '1.0.0',
'LSArchitecturePriority': ['x86_64', 'arm64'],
Expand Down
2 changes: 1 addition & 1 deletion package/cogmood_windows.spec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exe = EXE(pyz,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
name='SUPREME',
name='NIMHCogMood',
debug=False,
bootloader_ignore_signals=False,
strip=False,
Expand Down
8 changes: 4 additions & 4 deletions package/exe_versioning.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ VSVersionInfo(
[
StringTable(
u'040904B0',
[StringStruct(u'CompanyName', u'UVA CompMem'),
[StringStruct(u'CompanyName', u'NIMH MLC'),
StringStruct(u'FileDescription', u''),
StringStruct(u'FileVersion', u'1.0.0.0'),
StringStruct(u'InternalName', u'SUPREME - CogMood'),
StringStruct(u'InternalName', u'NIMH - CogMood'),
StringStruct(u'LegalCopyright', u''),
StringStruct(u'OriginalFilename', u'SUPREME.exe'),
StringStruct(u'ProductName', u'SUPREME - CogMood'),
StringStruct(u'OriginalFilename', u'NIMHCogMood.exe'),
StringStruct(u'ProductName', u'NIMH - CogMood'),
StringStruct(u'ProductVersion', u'1.0.0.0'),
StringStruct(u'WorkerID', u'"------------------------------------------------".---------------------------')])
]),
Expand Down
151 changes: 104 additions & 47 deletions tasks/AssBind/instruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,115 @@
from smile.scale import scale as s
from .GetResponse import GetResponse


def get_is_first(run_num):
return run_num == 0
# present instructions
@Subroutine
def Instruct(self, config, text_names):#, resp_keys, touch, font_size):
def Instruct(self, config, text_names, run_num):#, resp_keys, touch, font_size):

is_first = Func(get_is_first, run_num).result

texts = get_text(config)
with Parallel():
if not config.TOUCH:
MouseCursor(blocking=False)
with Serial(blocking=False):
for doc in text_names:
with Parallel():
title = Label(text='Memory Task Instructions',
font_size=s(config.INST_TITLE_FONT_SIZE),
with If(is_first):
with Parallel():
if not config.TOUCH:
MouseCursor(blocking=False)
with Serial(blocking=True):
for doc in text_names:
with Parallel():
title = Label(text='Memory Task Instructions',
font_size=s(config.INST_TITLE_FONT_SIZE),
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=self.exp.screen.center_y + s(415))

# image != None for 4 example slides
with If(texts[doc]['image'] != None):
image = Image(source=texts[doc]['image'],
top=(title.bottom - s(10)),
width=s(config.INST_IMG_WIDTH),
height=s(config.INST_IMG_HEIGHT),
allow_stretch=True, keep_ratio=False)
with If(texts[doc]['image'] != None):
Label(text=texts[doc]['text'],
font_size=s(config.INST_FONT_SIZE),
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=(image.bottom - s(10)))

# image == None for first and last slides (instructions and reminder)
with If(texts[doc]['image'] == None):
Label(text=texts[doc]['text'],
text_size=(s(config.TEXT_SIZE_WIDTH), None),
font_size=s(config.INST_FONT_SIZE),
top=(title.bottom - s(10)))

with UntilDone():
Wait(1.0)
GetResponse(keys=texts[doc]['keys'])

with Else():
with Parallel():
if not config.TOUCH:
MouseCursor(blocking=False)
with Serial(blocking=False):
for doc in text_names:
with Parallel():
title = Label(text='Memory Task Instructions',
font_size=s(config.INST_TITLE_FONT_SIZE),
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=self.exp.screen.center_y + s(415))

# image != None for 4 example slides
with If(texts[doc]['image'] != None):
image = Image(source=texts[doc]['image'],
top=(title.bottom - s(10)),
width=s(config.INST_IMG_WIDTH),
height=s(config.INST_IMG_HEIGHT),
allow_stretch=True, keep_ratio=False)
with If(texts[doc]['image'] != None):
Label(text=texts[doc]['text'],
font_size=s(config.INST_FONT_SIZE),
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=(image.bottom - s(10)))

# image == None for first and last slides (instructions and reminder)
with If(texts[doc]['image'] == None):
Label(text=texts[doc]['text'] + '\n\nYou may press the button in the'
' lower right corner to skip the practice',
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=self.exp.screen.center_y + s(415))

# image != None for 4 example slides
with If(texts[doc]['image'] != None):
image = Image(source=texts[doc]['image'],
top=(title.bottom - s(10)),
width=s(config.INST_IMG_WIDTH),
height=s(config.INST_IMG_HEIGHT),
allow_stretch=True, keep_ratio=False)
with If(texts[doc]['image'] != None):
Label(text=texts[doc]['text'],
font_size=s(config.INST_FONT_SIZE),
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=(image.bottom - s(10)))

# image == None for first and last slides (instructions and reminder)
with If(texts[doc]['image'] == None):
Label(text=texts[doc]['text'],
text_size=(s(config.TEXT_SIZE_WIDTH), None),
font_size=s(config.INST_FONT_SIZE),
top=(title.bottom - s(10)))

with UntilDone():
Wait(1.0)
GetResponse(keys=texts[doc]['keys'])

#RstDocument(text=texts[doc]['text'],
#width=self.exp.screen.height,
#height=self.exp.screen.height,
#base_font_size=s(config.RST_FONT_SIZE))


with Serial(blocking=False):
with ButtonPress():
Button(text="Skip Practice", right=self.exp.screen.width,
bottom=0, width=s(config.SKIP_SIZE[0]),
height=s(config.SKIP_SIZE[1]), blocking=False,
font_size=s(config.SKIP_FONT_SIZE))
font_size=s(config.INST_FONT_SIZE),
top=(title.bottom - s(10)))

with UntilDone():
Wait(1.0)
GetResponse(keys=texts[doc]['keys'])

#RstDocument(text=texts[doc]['text'],
#width=self.exp.screen.height,
#height=self.exp.screen.height,
#base_font_size=s(config.RST_FONT_SIZE))

with Serial(blocking=False):
with ButtonPress():
Button(text="Skip Practice", right=self.exp.screen.width,
bottom=0, width=s(config.SKIP_SIZE[0]),
height=s(config.SKIP_SIZE[1]), blocking=False,
font_size=s(config.SKIP_FONT_SIZE))
with Parallel():
doc = 'remind'
title = Label(text='Memory Task Instructions',
font_size=s(config.INST_TITLE_FONT_SIZE),
text_size=(s(config.TEXT_SIZE_WIDTH), None),
top=self.exp.screen.center_y + s(415))
Label(text=texts[doc]['text'],
text_size=(s(config.TEXT_SIZE_WIDTH), None),
font_size=s(config.INST_FONT_SIZE),
top=(title.bottom - s(10)))

with UntilDone():
Wait(1.0)
GetResponse(keys=texts[doc]['keys'])

Wait(2.0)


Expand Down
4 changes: 2 additions & 2 deletions tasks/AssBind/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def AssBindExp(self, config, sub_dir, task_dir=None, block=0,
text_names = ['main', 'ex1', 'ex2', 'ex3', 'ex4', 'remind']
rem_names = ['remind']
with If(reminder_only):
Instruct(config=config, text_names=rem_names)
Instruct(config=config, text_names=rem_names, run_num=block)
with Else():
Instruct(config=config, text_names=text_names)
Instruct(config=config, text_names=text_names, run_num=block)

Wait(1.0)

Expand Down
6 changes: 3 additions & 3 deletions tasks/BARTUVA/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
BALLOON_SETUP = [{'range': [0, 8], 'number_of_balloons':8},
{'range': [0, 16], 'number_of_balloons':8},
{'range': [8, 16], 'number_of_balloons':8}]
PRACTICE_SETUP = [{'range': [10,10], 'number_of_balloons':0},
{'range': [3,3], 'number_of_balloons':0},
{'range': [6,6], 'number_of_balloons':0}]
PRACTICE_SETUP = [{'range': [10,10], 'number_of_balloons':2},
{'range': [3,3], 'number_of_balloons':2},
{'range': [6,6], 'number_of_balloons':2}]
NUM_BALLOONS = 18
NUM_BAGS = len(BALLOON_SETUP)
BALLOONS_PER_BAG = NUM_BALLOONS/NUM_BAGS
Expand Down
Loading
Loading