From 846fb79d3d71126e72c2a144b76c8c10cdbfdaf1 Mon Sep 17 00:00:00 2001 From: Tab Memmott Date: Thu, 28 Apr 2022 14:49:19 -0700 Subject: [PATCH 1/3] Clear events before getting key presses in inquiry preview Add better psychopy unit definitions and return as a recommended option --- bcipy/display/paradigm/rsvp/display.py | 3 ++- bcipy/parameters/parameters.json | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bcipy/display/paradigm/rsvp/display.py b/bcipy/display/paradigm/rsvp/display.py index 17f79c5d1..7d0f2a124 100644 --- a/bcipy/display/paradigm/rsvp/display.py +++ b/bcipy/display/paradigm/rsvp/display.py @@ -2,7 +2,7 @@ import os.path as path from typing import List, Optional, Tuple -from psychopy import core, visual +from psychopy import core, visual, event from bcipy.helpers.clock import Clock from bcipy.helpers.task import SPACE_CHAR, get_key_press @@ -243,6 +243,7 @@ def preview_inquiry(self) -> Tuple[List[float], bool]: timer = core.CountdownTimer(self._preview_inquiry.preview_inquiry_length) response = False + event.clearEvents(eventType='keyboard') while timer.getTime() > 0: # wait for a key press event response = get_key_press( diff --git a/bcipy/parameters/parameters.json b/bcipy/parameters/parameters.json index dc9990d5f..041c85e5f 100755 --- a/bcipy/parameters/parameters.json +++ b/bcipy/parameters/parameters.json @@ -286,7 +286,7 @@ "value": "500", "section": "bci_config", "readableName": "Task Window Height", - "helpTip": "Specifies the height (in pixels) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). Default: 500", + "helpTip": "Specifies the height (in norm units) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). See https://www.psychopy.org/general/units.html. Default: 500", "recommended_values": "", "type": "int" }, @@ -294,7 +294,7 @@ "value": "500", "section": "bci_config", "readableName": "Task Window Width", - "helpTip": "Specifies the width (in pixels) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). Default: 500", + "helpTip": "Specifies the width (in norm units) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). See https://www.psychopy.org/general/units.html. Default: 500", "recommended_values": "", "type": "int" }, @@ -442,10 +442,10 @@ "type": "str" }, "stim_height": { - "value": "0.6", + "value": "0.5", "section": "bci_config", "readableName": "Stimulus Size", - "helpTip": "Specifies the height (in ???) of text stimuli. Possible values range from X to X. Default: 0.6", + "helpTip": "Specifies the height of text stimuli. See https://www.psychopy.org/general/units.html. Default: 0.5", "recommended_values": "", "type": "float" }, @@ -532,8 +532,8 @@ "info_height": { "value": "0.1", "section": "bci_config", - "readableName": "Text Height", - "helpTip": "Text Height", + "readableName": "Text below main presentation height", + "helpTip": "Specifies the height of iinfo text stimuli. See https://www.psychopy.org/general/units.html. Default: 0.1", "recommended_values": [ "0.1" ], @@ -603,7 +603,7 @@ "value": "0.1", "section": "bci_config", "readableName": "Task Text Size", - "helpTip": "Specifies the height (in ???) of task-specific text, e.g. #/100 in calibration and target phrase in copy/spelling. Possible values range from 0 to 1. Default: 0.1", + "helpTip": "Specifies the height of task-specific text, e.g. #/100 in calibration and target phrase in copy/spelling. See https://www.psychopy.org/general/units.html. Default: 0.1", "recommended_values": [ "0.1" ], @@ -811,13 +811,14 @@ "type": "float" }, "preview_inquiry_key_input": { - "value": "space", + "value": "return", "section": "bci_config", "readableName": "Preview Inquiry Display Key Input Method", "helpTip": "Defines the key used to engage with inquiry preview.", "recommended_values": [ "space", - "escape" + "escape", + "return" ], "type": "str" }, @@ -873,7 +874,7 @@ "value": "0.2", "section": "feedback_config", "readableName": "Feedback Stimuli Height", - "helpTip": "Specifies the height of the feedback stimuli. Default: 0.2", + "helpTip": "Specifies the height of the feedback stimuli. See https://www.psychopy.org/general/units.html. Default: 0.2", "recommended_values": "", "type": "float" }, From c99a7f6cce0c95ae242ec02c2e1fceea232dca59 Mon Sep 17 00:00:00 2001 From: Tab Memmott Date: Thu, 28 Apr 2022 15:00:04 -0700 Subject: [PATCH 2/3] update the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ab983564..301dbadfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ The details (incomplete, our apologies!): - `CODE_OF_CONDUCT.md`: to latest version of the Contributor Covenant - `README.md`: Add new glossary terms: mode, session and task #126 #127 and cleanup #129 - `bcipy/main.py`: formally, `bci_main.py`. To give a better console entry point and infrastructure for integration testing. In the terminal, you can now run `bcipy` instead of `python bci_main.py` -- `parameters.json`: add stim_order #153 add max selections #175 remove max_inq_per_trial in favor of max_inq_per_series #176 add inquiry preview #177 +- `parameters.json`: add stim_order #153 add max selections #175 remove max_inq_per_trial in favor of max_inq_per_series #176 add inquiry preview #177 with relevant stimuli units in help text, better starting stim_height, and inquiry preview keys #216 - `demo_stimuli_generation.py`: update imports and add a case showing the new ordering functionality. #153 - `copy_phrase_wrapper`: update logging and exception handling. add stim order. #153 BUGFIX: return transformed sampling rate #159 - `random_rsvp_calibration_inq_gen`: rename to `calibration_inquiry_generator` #153 From 2c684743ea46e524776de716a1f9aa005b3fa326 Mon Sep 17 00:00:00 2001 From: Tab Memmott Date: Thu, 28 Apr 2022 15:25:45 -0700 Subject: [PATCH 3/3] typo --- bcipy/parameters/parameters.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bcipy/parameters/parameters.json b/bcipy/parameters/parameters.json index 041c85e5f..e3dd82e3a 100755 --- a/bcipy/parameters/parameters.json +++ b/bcipy/parameters/parameters.json @@ -533,7 +533,7 @@ "value": "0.1", "section": "bci_config", "readableName": "Text below main presentation height", - "helpTip": "Specifies the height of iinfo text stimuli. See https://www.psychopy.org/general/units.html. Default: 0.1", + "helpTip": "Specifies the height of info text stimuli. See https://www.psychopy.org/general/units.html. Default: 0.1", "recommended_values": [ "0.1" ],