psychopy-neuroplaypro-neurolab 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- psychopy_neuroplaypro/plugin.py +1 -1
- {psychopy_neuroplaypro_neurolab-0.0.3.dist-info → psychopy_neuroplaypro_neurolab-0.0.4.dist-info}/METADATA +1 -1
- psychopy_neuroplaypro_neurolab-0.0.4.dist-info/RECORD +8 -0
- psychopy_neuroplaypro/component.py +0 -26
- psychopy_neuroplaypro_neurolab-0.0.3.dist-info/RECORD +0 -9
- {psychopy_neuroplaypro_neurolab-0.0.3.dist-info → psychopy_neuroplaypro_neurolab-0.0.4.dist-info}/WHEEL +0 -0
- {psychopy_neuroplaypro_neurolab-0.0.3.dist-info → psychopy_neuroplaypro_neurolab-0.0.4.dist-info}/entry_points.txt +0 -0
- {psychopy_neuroplaypro_neurolab-0.0.3.dist-info → psychopy_neuroplaypro_neurolab-0.0.4.dist-info}/licenses/LICENSE +0 -0
- {psychopy_neuroplaypro_neurolab-0.0.3.dist-info → psychopy_neuroplaypro_neurolab-0.0.4.dist-info}/top_level.txt +0 -0
psychopy_neuroplaypro/plugin.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
from psychopy.plugins import Plugin
|
2
2
|
from psychopy.experiment.components import registerComponent
|
3
|
-
from psychopy_neuroplaypro.
|
3
|
+
from psychopy_neuroplaypro.components.neuroplay import NeuroPlayComponent
|
4
4
|
|
5
5
|
class NeuroPlayPlugin(Plugin):
|
6
6
|
def onLoad(self):
|
@@ -0,0 +1,8 @@
|
|
1
|
+
psychopy_neuroplaypro/__init__.py,sha256=fd3Mi-jIseuqbdbmJqsB86t7nxhkg2fq0l3P4OiboA0,87
|
2
|
+
psychopy_neuroplaypro/plugin.py,sha256=GbEzT6NQSMDeKQkNGmi8oIhpISiiXDF-o0B0Pnc-wnk,329
|
3
|
+
psychopy_neuroplaypro_neurolab-0.0.4.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
psychopy_neuroplaypro_neurolab-0.0.4.dist-info/METADATA,sha256=1Maon8Vb7JSTGHCdTueB-cu-O1a7sDM4CkM1Mj7Q-6w,270
|
5
|
+
psychopy_neuroplaypro_neurolab-0.0.4.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
6
|
+
psychopy_neuroplaypro_neurolab-0.0.4.dist-info/entry_points.txt,sha256=wN4RTZ4kOCrKFoQrhq-pqtiMgYNrM4RtuWoYQX0i8S0,76
|
7
|
+
psychopy_neuroplaypro_neurolab-0.0.4.dist-info/top_level.txt,sha256=yFmWoUXUcLuorBVd9lVUWwjDmk9sIHoKXW8QhBO5NLI,22
|
8
|
+
psychopy_neuroplaypro_neurolab-0.0.4.dist-info/RECORD,,
|
@@ -1,26 +0,0 @@
|
|
1
|
-
from psychopy.experiment.components.basecomponent import BaseComponent
|
2
|
-
import os
|
3
|
-
|
4
|
-
class NeuroPlayComponent(BaseComponent):
|
5
|
-
categories = ['EEG']
|
6
|
-
iconFile = os.path.join(os.path.dirname(__file__), 'resources', 'icon.png')
|
7
|
-
|
8
|
-
def __init__(self, exp, parentName, name='neuroplay',
|
9
|
-
saveFolder='data', filePrefix='recording', autoTimestamp=True,
|
10
|
-
startType='time (s)', startVal='0', stopType='duration (s)', stopVal=''):
|
11
|
-
super().__init__(exp, parentName, name=name,
|
12
|
-
startType=startType, startVal=startVal,
|
13
|
-
stopType=stopType, stopVal=stopVal)
|
14
|
-
self.type = 'NeuroPlay'
|
15
|
-
self.url = "http://127.0.0.1:2336"
|
16
|
-
self.order += ['saveFolder', 'filePrefix', 'autoTimestamp']
|
17
|
-
self.params['saveFolder'] = {'val': saveFolder, 'valType': 'code', 'updates': 'constant', 'hint': 'Folder to save EEG data'}
|
18
|
-
self.params['filePrefix'] = {'val': filePrefix, 'valType': 'code', 'updates': 'constant', 'hint': 'Filename prefix'}
|
19
|
-
self.params['autoTimestamp'] = {'val': autoTimestamp, 'valType': 'bool', 'updates': 'constant', 'hint': 'Append timestamp to filename'}
|
20
|
-
|
21
|
-
def writeRoutineStartCode(self, buff):
|
22
|
-
buff.writeIndentedLines(f\"\"\"\n# Start NeuroPlay recording\nimport requests, os, datetime\n\"\"\")
|
23
|
-
buff.writeIndentedLines(f\"\"\"\nsave_folder = {self.params['saveFolder']['val']}\nfile_prefix = {self.params['filePrefix']['val']}\nauto_timestamp = {self.params['autoTimestamp']['val']}\nif auto_timestamp:\n timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')\n filename = f\"{file_prefix}_{{timestamp}}.edf\"\nelse:\n filename = f\"{file_prefix}.edf\"\nfull_path = os.path.join(save_folder, filename)\n\ntry:\n os.makedirs(save_folder, exist_ok=True)\n response = requests.post('{self.url}', json={{\"command\": \"startRecord\", \"path\": full_path}})\n if not response.ok:\n print(f\"[NeuroPlay] Failed to start: {{response.text}}\")\nexcept Exception as e:\n print(f\"[NeuroPlay] Exception: {{e}}\")\n\"\"\")
|
24
|
-
|
25
|
-
def writeRoutineEndCode(self, buff):
|
26
|
-
buff.writeIndentedLines(f\"\"\"\n# Stop NeuroPlay recording\ntry:\n response = requests.post('{self.url}', json={{\"command\": \"stopRecord\"}})\n if not response.ok:\n print(f\"[NeuroPlay] Failed to stop: {{response.text}}\")\nexcept Exception as e:\n print(f\"[NeuroPlay] Exception: {{e}}\")\n\"\"\")
|
@@ -1,9 +0,0 @@
|
|
1
|
-
psychopy_neuroplaypro/__init__.py,sha256=fd3Mi-jIseuqbdbmJqsB86t7nxhkg2fq0l3P4OiboA0,87
|
2
|
-
psychopy_neuroplaypro/component.py,sha256=ZS84qevNqBJBMp9iwiKvm0631aMVWaJikq-DoEEnvOw,2472
|
3
|
-
psychopy_neuroplaypro/plugin.py,sha256=OcVKwjRk8TFbqtGRclwsEuWdlDXI2gdf6sLv9G4jRWc,318
|
4
|
-
psychopy_neuroplaypro_neurolab-0.0.3.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
psychopy_neuroplaypro_neurolab-0.0.3.dist-info/METADATA,sha256=hCDIkyWbC1IEEIaX-CtOPJc2BwhU7Uk5NfO9lOp7WDo,270
|
6
|
-
psychopy_neuroplaypro_neurolab-0.0.3.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
7
|
-
psychopy_neuroplaypro_neurolab-0.0.3.dist-info/entry_points.txt,sha256=wN4RTZ4kOCrKFoQrhq-pqtiMgYNrM4RtuWoYQX0i8S0,76
|
8
|
-
psychopy_neuroplaypro_neurolab-0.0.3.dist-info/top_level.txt,sha256=yFmWoUXUcLuorBVd9lVUWwjDmk9sIHoKXW8QhBO5NLI,22
|
9
|
-
psychopy_neuroplaypro_neurolab-0.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|