protocol
Classes:
|
A widget used in |
|
A widget that allows sounds to be parameterized. |
- class Graduation_Widget(self, /, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags), *, modal: bool | None = None, windowModality: PySide6.QtCore.Qt.WindowModality | None = None, enabled: bool | None = None, geometry: PySide6.QtCore.QRect | None = None, frameGeometry: PySide6.QtCore.QRect | None = None, normalGeometry: PySide6.QtCore.QRect | None = None, x: int | None = None, y: int | None = None, pos: PySide6.QtCore.QPoint | None = None, frameSize: PySide6.QtCore.QSize | None = None, size: PySide6.QtCore.QSize | None = None, width: int | None = None, height: int | None = None, rect: PySide6.QtCore.QRect | None = None, childrenRect: PySide6.QtCore.QRect | None = None, childrenRegion: PySide6.QtGui.QRegion | None = None, sizePolicy: PySide6.QtWidgets.QSizePolicy | None = None, minimumSize: PySide6.QtCore.QSize | None = None, maximumSize: PySide6.QtCore.QSize | None = None, minimumWidth: int | None = None, minimumHeight: int | None = None, maximumWidth: int | None = None, maximumHeight: int | None = None, sizeIncrement: PySide6.QtCore.QSize | None = None, baseSize: PySide6.QtCore.QSize | None = None, palette: PySide6.QtGui.QPalette | None = None, font: PySide6.QtGui.QFont | None = None, cursor: PySide6.QtGui.QCursor | None = None, mouseTracking: bool | None = None, tabletTracking: bool | None = None, isActiveWindow: bool | None = None, focusPolicy: PySide6.QtCore.Qt.FocusPolicy | None = None, focus: bool | None = None, contextMenuPolicy: PySide6.QtCore.Qt.ContextMenuPolicy | None = None, updatesEnabled: bool | None = None, visible: bool | None = None, minimized: bool | None = None, maximized: bool | None = None, fullScreen: bool | None = None, sizeHint: PySide6.QtCore.QSize | None = None, minimumSizeHint: PySide6.QtCore.QSize | None = None, acceptDrops: bool | None = None, windowTitle: str | None = None, windowIcon: PySide6.QtGui.QIcon | None = None, windowIconText: str | None = None, windowOpacity: float | None = None, windowModified: bool | None = None, toolTip: str | None = None, toolTipDuration: int | None = None, statusTip: str | None = None, whatsThis: str | None = None, accessibleName: str | None = None, accessibleDescription: str | None = None, layoutDirection: PySide6.QtCore.Qt.LayoutDirection | None = None, autoFillBackground: bool | None = None, styleSheet: str | None = None, locale: PySide6.QtCore.QLocale | None = None, windowFilePath: str | None = None, inputMethodHints: PySide6.QtCore.Qt.InputMethodHint | None = None)[source]
Bases:
QWidgetA widget used in
Protocol_Wizardto define graduation parameters.See
tasks.graduation.A protocol is composed of multiple tasks (steps), and graduation criteria define when a subject should progress through those steps.
eg. a subject should graduate one stage after 300 trials, or after it reaches 75% accuracy over the last 500 trials.
- Variables:
type_selection (
QtWidgets.QComboBox) – A box to select from the available graduation types listed inautopilot.get_task(). Has its currentIndexChanged signal connected toGraduation_Widget.populate_params()param_dict (dict) – Stores the type of graduation and the relevant params, fetched by
Protocol_Wizardwhen defining a protocol.set_graduation (
Protocol_Wizard.set_graduation()) – Passed to us after we’re inited.
Initialize self. See help(type(self)) for accurate signature.
Methods:
populate_params([params])Repopulate the widget with fields to edit graduation parameters, fill fields if we are passed params.
Clear any parameter widgets we have.
When a parameter is edited, save it in our param_dict, and also call our set_graduation method, which should be
Protocol_Wizard.set_graduation()passed to us after instantiation.Attributes:
- populate_params(params=None)[source]
Repopulate the widget with fields to edit graduation parameters, fill fields if we are passed params.
Each
QtWidgets.QLineEdit‘sQLineEdit.editingFinished()signal is connected toGraduation_Widget.store_param().Todo
For now we assume all parameters are defined with a text edit box, so it’s not clear how we’d do boolean parameters for example. This will be fixed with refactoring the parameter scheme.
- Parameters:
params (dict) – In the case that
Protocol_Wizardswitches us back to a step where we have already defined graduation parameters, it will pass them so we can repopulate the relevant widgets with them.
- store_param()[source]
When a parameter is edited, save it in our param_dict, and also call our set_graduation method, which should be
Protocol_Wizard.set_graduation()passed to us after instantiation.If we were not passed set_graduation, just saves in param_dict.
- staticMetaObject = PySide6.QtCore.QMetaObject("Graduation_Widget" inherits "QWidget": )
- class Sound_Widget(self, /, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags), *, modal: bool | None = None, windowModality: PySide6.QtCore.Qt.WindowModality | None = None, enabled: bool | None = None, geometry: PySide6.QtCore.QRect | None = None, frameGeometry: PySide6.QtCore.QRect | None = None, normalGeometry: PySide6.QtCore.QRect | None = None, x: int | None = None, y: int | None = None, pos: PySide6.QtCore.QPoint | None = None, frameSize: PySide6.QtCore.QSize | None = None, size: PySide6.QtCore.QSize | None = None, width: int | None = None, height: int | None = None, rect: PySide6.QtCore.QRect | None = None, childrenRect: PySide6.QtCore.QRect | None = None, childrenRegion: PySide6.QtGui.QRegion | None = None, sizePolicy: PySide6.QtWidgets.QSizePolicy | None = None, minimumSize: PySide6.QtCore.QSize | None = None, maximumSize: PySide6.QtCore.QSize | None = None, minimumWidth: int | None = None, minimumHeight: int | None = None, maximumWidth: int | None = None, maximumHeight: int | None = None, sizeIncrement: PySide6.QtCore.QSize | None = None, baseSize: PySide6.QtCore.QSize | None = None, palette: PySide6.QtGui.QPalette | None = None, font: PySide6.QtGui.QFont | None = None, cursor: PySide6.QtGui.QCursor | None = None, mouseTracking: bool | None = None, tabletTracking: bool | None = None, isActiveWindow: bool | None = None, focusPolicy: PySide6.QtCore.Qt.FocusPolicy | None = None, focus: bool | None = None, contextMenuPolicy: PySide6.QtCore.Qt.ContextMenuPolicy | None = None, updatesEnabled: bool | None = None, visible: bool | None = None, minimized: bool | None = None, maximized: bool | None = None, fullScreen: bool | None = None, sizeHint: PySide6.QtCore.QSize | None = None, minimumSizeHint: PySide6.QtCore.QSize | None = None, acceptDrops: bool | None = None, windowTitle: str | None = None, windowIcon: PySide6.QtGui.QIcon | None = None, windowIconText: str | None = None, windowOpacity: float | None = None, windowModified: bool | None = None, toolTip: str | None = None, toolTipDuration: int | None = None, statusTip: str | None = None, whatsThis: str | None = None, accessibleName: str | None = None, accessibleDescription: str | None = None, layoutDirection: PySide6.QtCore.Qt.LayoutDirection | None = None, autoFillBackground: bool | None = None, styleSheet: str | None = None, locale: PySide6.QtCore.QLocale | None = None, windowFilePath: str | None = None, inputMethodHints: PySide6.QtCore.Qt.InputMethodHint | None = None)[source]
Bases:
QWidgetA widget that allows sounds to be parameterized.
Used in
Protocol_Wizard.Has two
Drag_Lists for left and right sounds (for a 2afc task), given Buttons beneath them allow adding and removing sounds.Adding a sound will open a
Add_SoundDialogTodo
Sounds will eventually be more elegantly managed by a … sound manager.. For now sound managers are rudimentary and only support random presentation with correction trials and bias correction.
- Variables:
sound_dict (dict) –
Dictionary with the structure:
{'L': [{'param_1':'param_1', ... }], 'R': [...]}
where multiple sounds can be present in either ‘L’ or ‘R’ list.
Initialize self. See help(type(self)) for accurate signature.
Methods:
pass_set_param_function(set_param_fnxn)Receives
Protocol_Wizard.set_sounds()add_sound(side)When the "+" button on either side is pressed, open an
Add_Sound_Dialog.remove_sound(side)When the "-" button is pressed, remove the currently highlighted sound.
populate_lists(sound_dict)Populates the sound lists after re-selecting a step.
files_dropped(files)Classes:
Add_Sound_Dialog(self, /[, parent, f, ...])Presents a dialog to define a new sound.
Attributes:
- pass_set_param_function(set_param_fnxn)[source]
Receives
Protocol_Wizard.set_sounds()- Parameters:
set_param_fnxn (
Protocol_Wizard.set_sounds()) – Called when sounds are changed.
- add_sound(side)[source]
When the “+” button on either side is pressed, open an
Add_Sound_Dialog.- Parameters:
side (str) – The buttons are connected with a lambda function, this will be either ‘L’ or ‘R’. Used to add sounds to the sound_dict
- remove_sound(side)[source]
When the “-” button is pressed, remove the currently highlighted sound.
- Parameters:
side (str) – The buttons are connected with a lambda function, this will be either ‘L’ or ‘R’. Selects that list so we can remove the currently selected row.
- populate_lists(sound_dict)[source]
Populates the sound lists after re-selecting a step.
- Parameters:
sound_dict (dict) – passed to us by
Protocol_Wizardupon reselecting a step.
- files_dropped(files)[source]
Warning
This was programmed hastily and is pretty idiosyncratic to my use.
It does work for general files but has some extra logic built in to handle my stimuli.
To be made more general in v0.3
Note
Sounds must be in the folder specified in prefs.get(‘SOUNDDIR’).
When files are dropped on the lists, strips prefs.get(‘SOUNDDIR’) from them to make them relative paths, adds them to the sound_dict
- Parameters:
files (list) – List of absolute paths.
- class Add_Sound_Dialog(self, /, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags), *, sizeGripEnabled: bool | None = None, modal: bool | None = None)[source]
Bases:
QDialogPresents a dialog to define a new sound.
Makes a selection box to choose the sound type from
autopilot.get_names('sound'), and then populates edit boxes so we can fill in its PARAMS .- Variables:
type_selection (
QtWidgets.QComboBox) – Select from a list of available soundsparam_dict (dict) – Parameters that are retreived by the calling
Sound_Widget.
Initialize self. See help(type(self)) for accurate signature.
Methods:
When a sound type is selected, make a
QtWidgets.QLineEditfor each PARAM in its definition.Clear all current widgets
When one of our edit boxes is edited, stash the parameter in param_dict
Attributes:
- populate_params()[source]
When a sound type is selected, make a
QtWidgets.QLineEditfor each PARAM in its definition.
- staticMetaObject = PySide6.QtCore.QMetaObject("Add_Sound_Dialog" inherits "QDialog": )
- staticMetaObject = PySide6.QtCore.QMetaObject("Sound_Widget" inherits "QWidget": )