free_grasp.psyexp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?xml version="1.0" ?>
  2. <PsychoPy2experiment encoding="utf-8" version="2023.2.3">
  3. <Settings>
  4. <Param val="3" valType="str" updates="None" name="Audio latency priority"/>
  5. <Param val="ptb" valType="str" updates="None" name="Audio lib"/>
  6. <Param val="" valType="str" updates="None" name="Completed URL"/>
  7. <Param val="auto" valType="str" updates="None" name="Data file delimiter"/>
  8. <Param val="u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])" valType="code" updates="None" name="Data filename"/>
  9. <Param val="True" valType="bool" updates="None" name="Enable Escape"/>
  10. <Param val="" valType="str" updates="None" name="End Message"/>
  11. <Param val="{'participant': 'f&quot;{randint(0, 999999):06.0f}&quot;', 'session': '001'}" valType="code" updates="None" name="Experiment info"/>
  12. <Param val="True" valType="bool" updates="None" name="Force stereo"/>
  13. <Param val="True" valType="bool" updates="None" name="Full-screen window"/>
  14. <Param val="" valType="str" updates="None" name="HTML path"/>
  15. <Param val="" valType="str" updates="None" name="Incomplete URL"/>
  16. <Param val="testMonitor" valType="str" updates="None" name="Monitor"/>
  17. <Param val="[]" valType="list" updates="None" name="Resources"/>
  18. <Param val="False" valType="bool" updates="None" name="Save csv file"/>
  19. <Param val="False" valType="bool" updates="None" name="Save excel file"/>
  20. <Param val="False" valType="bool" updates="None" name="Save hdf5 file"/>
  21. <Param val="True" valType="bool" updates="None" name="Save log file"/>
  22. <Param val="True" valType="bool" updates="None" name="Save psydat file"/>
  23. <Param val="True" valType="bool" updates="None" name="Save wide csv file"/>
  24. <Param val="1" valType="num" updates="None" name="Screen"/>
  25. <Param val="True" valType="bool" updates="None" name="Show info dlg"/>
  26. <Param val="True" valType="bool" updates="None" name="Show mouse"/>
  27. <Param val="height" valType="str" updates="None" name="Units"/>
  28. <Param val="" valType="str" updates="None" name="Use version"/>
  29. <Param val="[1920, 1080]" valType="list" updates="None" name="Window size (pixels)"/>
  30. <Param val="none" valType="str" updates="None" name="backgroundFit"/>
  31. <Param val="" valType="str" updates="None" name="backgroundImg"/>
  32. <Param val="avg" valType="str" updates="None" name="blendMode"/>
  33. <Param val="{'thisRow.t': 'priority.CRITICAL', 'expName': 'priority.LOW'}" valType="dict" updates="None" name="colPriority"/>
  34. <Param val="$[1,1,1]" valType="color" updates="None" name="color"/>
  35. <Param val="rgb" valType="str" updates="None" name="colorSpace"/>
  36. <Param val="100.1.1.1" valType="str" updates="None" name="elAddress"/>
  37. <Param val="FILTER_LEVEL_2" valType="str" updates="None" name="elDataFiltering"/>
  38. <Param val="FILTER_LEVEL_OFF" valType="str" updates="None" name="elLiveFiltering"/>
  39. <Param val="EYELINK 1000 DESKTOP" valType="str" updates="None" name="elModel"/>
  40. <Param val="ELLIPSE_FIT" valType="str" updates="None" name="elPupilAlgorithm"/>
  41. <Param val="PUPIL_AREA" valType="str" updates="None" name="elPupilMeasure"/>
  42. <Param val="1000" valType="num" updates="None" name="elSampleRate"/>
  43. <Param val="False" valType="bool" updates="None" name="elSimMode"/>
  44. <Param val="RIGHT_EYE" valType="str" updates="None" name="elTrackEyes"/>
  45. <Param val="PUPIL_CR_TRACKING" valType="str" updates="None" name="elTrackingMode"/>
  46. <Param val="free_grasp" valType="str" updates="None" name="expName"/>
  47. <Param val="on Sync" valType="str" updates="None" name="exportHTML"/>
  48. <Param val="None" valType="str" updates="None" name="eyetracker"/>
  49. <Param val="127.0.0.1" valType="str" updates="None" name="gpAddress"/>
  50. <Param val="4242" valType="num" updates="None" name="gpPort"/>
  51. <Param val="ioHub" valType="str" updates="None" name="keyboardBackend"/>
  52. <Param val="debug" valType="code" updates="None" name="logging level"/>
  53. <Param val="('MIDDLE_BUTTON',)" valType="list" updates="None" name="mgBlink"/>
  54. <Param val="CONTINUOUS" valType="str" updates="None" name="mgMove"/>
  55. <Param val="0.5" valType="num" updates="None" name="mgSaccade"/>
  56. <Param val="neon.local" valType="str" updates="None" name="plCompanionAddress"/>
  57. <Param val="scene_camera.json" valType="file" updates="None" name="plCompanionCameraCalibration"/>
  58. <Param val="8080" valType="num" updates="None" name="plCompanionPort"/>
  59. <Param val="True" valType="bool" updates="None" name="plCompanionRecordingEnabled"/>
  60. <Param val="0.6" valType="num" updates="None" name="plConfidenceThreshold"/>
  61. <Param val="True" valType="bool" updates="None" name="plPupilCaptureRecordingEnabled"/>
  62. <Param val="" valType="str" updates="None" name="plPupilCaptureRecordingLocation"/>
  63. <Param val="127.0.0.1" valType="str" updates="None" name="plPupilRemoteAddress"/>
  64. <Param val="50020" valType="num" updates="None" name="plPupilRemotePort"/>
  65. <Param val="1000" valType="num" updates="None" name="plPupilRemoteTimeoutMs"/>
  66. <Param val="False" valType="bool" updates="None" name="plPupillometryOnly"/>
  67. <Param val="psychopy_iohub_surface" valType="str" updates="None" name="plSurfaceName"/>
  68. <Param val="time" valType="str" updates="None" name="sortColumns"/>
  69. <Param val="" valType="str" updates="None" name="tbLicenseFile"/>
  70. <Param val="" valType="str" updates="None" name="tbModel"/>
  71. <Param val="60" valType="num" updates="None" name="tbSampleRate"/>
  72. <Param val="" valType="str" updates="None" name="tbSerialNo"/>
  73. <Param val="pyglet" valType="str" updates="None" name="winBackend"/>
  74. </Settings>
  75. <Routines>
  76. <Routine name="feedback">
  77. <RoutineSettingsComponent name="feedback" plugin="None">
  78. <Param val="none" valType="str" updates="None" name="backgroundFit"/>
  79. <Param val="" valType="str" updates="None" name="backgroundImg"/>
  80. <Param val="$[0,0,0]" valType="color" updates="None" name="color"/>
  81. <Param val="rgb" valType="str" updates="None" name="colorSpace"/>
  82. <Param val="" valType="str" updates="constant" name="desc"/>
  83. <Param val="False" valType="bool" updates="None" name="disabled"/>
  84. <Param val="" valType="code" updates="None" name="durationEstim"/>
  85. <Param val="feedback" valType="code" updates="None" name="name"/>
  86. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  87. <Param val="" valType="code" updates="constant" name="skipIf"/>
  88. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  89. <Param val="" valType="code" updates="constant" name="stopVal"/>
  90. <Param val="False" valType="bool" updates="None" name="useWindowParams"/>
  91. </RoutineSettingsComponent>
  92. <CodeComponent name="send_feedback" plugin="None">
  93. <Param val="" valType="extendedCode" updates="constant" name="Before Experiment"/>
  94. <Param val="" valType="extendedCode" updates="constant" name="Before JS Experiment"/>
  95. <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
  96. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
  97. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
  98. <Param val="# state changed&amp;#10;feedback_bar1.progress = force&amp;#10;if decision != -1:&amp;#10; feedback_time = 3&amp;#10; trigger.send_trigger(int(decision))&amp;#10; hand_device.start(model=fingermodel_ids_inverse[decision])&amp;#10;else:&amp;#10; feedback_time = 0&amp;#10; " valType="extendedCode" updates="constant" name="Begin Routine"/>
  99. <Param val="Py" valType="str" updates="None" name="Code Type"/>
  100. <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
  101. <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
  102. <Param val="" valType="extendedCode" updates="constant" name="End Experiment"/>
  103. <Param val="" valType="extendedCode" updates="constant" name="End JS Experiment"/>
  104. <Param val="" valType="extendedCode" updates="constant" name="End JS Routine"/>
  105. <Param val="" valType="extendedCode" updates="constant" name="End Routine"/>
  106. <Param val="False" valType="bool" updates="None" name="disabled"/>
  107. <Param val="send_feedback" valType="code" updates="None" name="name"/>
  108. </CodeComponent>
  109. <ProgressComponent name="feedback_bar1" plugin="None">
  110. <Param val="bottom-left" valType="str" updates="constant" name="anchor"/>
  111. <Param val="black" valType="color" updates="constant" name="borderColor"/>
  112. <Param val="black" valType="color" updates="constant" name="color"/>
  113. <Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
  114. <Param val="1" valType="num" updates="constant" name="contrast"/>
  115. <Param val="False" valType="bool" updates="None" name="disabled"/>
  116. <Param val="" valType="code" updates="None" name="durationEstim"/>
  117. <Param val="None" valType="color" updates="constant" name="fillColor"/>
  118. <Param val="4" valType="num" updates="constant" name="lineWidth"/>
  119. <Param val="feedback_bar1" valType="code" updates="None" name="name"/>
  120. <Param val="1" valType="num" updates="constant" name="opacity"/>
  121. <Param val="270" valType="num" updates="constant" name="ori"/>
  122. <Param val="(0, -0.25)" valType="list" updates="constant" name="pos"/>
  123. <Param val="0" valType="code" updates="constant" name="progress"/>
  124. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  125. <Param val="(0.5, 0.1)" valType="list" updates="constant" name="size"/>
  126. <Param val="" valType="code" updates="None" name="startEstim"/>
  127. <Param val="time (s)" valType="str" updates="None" name="startType"/>
  128. <Param val="0" valType="code" updates="None" name="startVal"/>
  129. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  130. <Param val="feedback_time" valType="code" updates="constant" name="stopVal"/>
  131. <Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
  132. <Param val="height" valType="str" updates="None" name="units"/>
  133. </ProgressComponent>
  134. </Routine>
  135. <Routine name="decision">
  136. <RoutineSettingsComponent name="decision" plugin="None">
  137. <Param val="none" valType="str" updates="None" name="backgroundFit"/>
  138. <Param val="" valType="str" updates="None" name="backgroundImg"/>
  139. <Param val="$[0,0,0]" valType="color" updates="None" name="color"/>
  140. <Param val="rgb" valType="str" updates="None" name="colorSpace"/>
  141. <Param val="" valType="str" updates="constant" name="desc"/>
  142. <Param val="False" valType="bool" updates="None" name="disabled"/>
  143. <Param val="" valType="code" updates="None" name="durationEstim"/>
  144. <Param val="decision" valType="code" updates="None" name="name"/>
  145. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  146. <Param val="" valType="code" updates="constant" name="skipIf"/>
  147. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  148. <Param val="" valType="code" updates="constant" name="stopVal"/>
  149. <Param val="False" valType="bool" updates="None" name="useWindowParams"/>
  150. </RoutineSettingsComponent>
  151. <ProgressComponent name="feedback_bar" plugin="None">
  152. <Param val="bottom-left" valType="str" updates="constant" name="anchor"/>
  153. <Param val="black" valType="color" updates="constant" name="borderColor"/>
  154. <Param val="black" valType="color" updates="constant" name="color"/>
  155. <Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
  156. <Param val="1" valType="num" updates="constant" name="contrast"/>
  157. <Param val="False" valType="bool" updates="None" name="disabled"/>
  158. <Param val="" valType="code" updates="None" name="durationEstim"/>
  159. <Param val="None" valType="color" updates="constant" name="fillColor"/>
  160. <Param val="4" valType="num" updates="constant" name="lineWidth"/>
  161. <Param val="feedback_bar" valType="code" updates="None" name="name"/>
  162. <Param val="1" valType="num" updates="constant" name="opacity"/>
  163. <Param val="270" valType="num" updates="constant" name="ori"/>
  164. <Param val="(0, -0.25)" valType="list" updates="constant" name="pos"/>
  165. <Param val="0" valType="code" updates="constant" name="progress"/>
  166. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  167. <Param val="(0.5, 0.1)" valType="list" updates="constant" name="size"/>
  168. <Param val="" valType="code" updates="None" name="startEstim"/>
  169. <Param val="time (s)" valType="str" updates="None" name="startType"/>
  170. <Param val="0" valType="code" updates="None" name="startVal"/>
  171. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  172. <Param val="0.1" valType="code" updates="constant" name="stopVal"/>
  173. <Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
  174. <Param val="height" valType="str" updates="None" name="units"/>
  175. </ProgressComponent>
  176. <CodeComponent name="decision" plugin="None">
  177. <Param val="" valType="extendedCode" updates="constant" name="Before Experiment"/>
  178. <Param val="" valType="extendedCode" updates="constant" name="Before JS Experiment"/>
  179. <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
  180. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
  181. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
  182. <Param val="# decision&amp;#10;data_from_buffer = receiver.get_trial_data(clear=False)&amp;#10;decision = controller.decision(data_from_buffer, None)&amp;#10;force = controller.real_feedback_model.probability&amp;#10;feedback_bar.progress = force&amp;#10;&amp;#10;# logging&amp;#10;logging.exp('decision: {}'.format(decision))&amp;#10;logging.exp('probability: {}'.format(force))&amp;#10;" valType="extendedCode" updates="constant" name="Begin Routine"/>
  183. <Param val="Py" valType="str" updates="None" name="Code Type"/>
  184. <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
  185. <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
  186. <Param val="" valType="extendedCode" updates="constant" name="End Experiment"/>
  187. <Param val="" valType="extendedCode" updates="constant" name="End JS Experiment"/>
  188. <Param val="" valType="extendedCode" updates="constant" name="End JS Routine"/>
  189. <Param val="" valType="extendedCode" updates="constant" name="End Routine"/>
  190. <Param val="False" valType="bool" updates="None" name="disabled"/>
  191. <Param val="decision" valType="code" updates="None" name="name"/>
  192. </CodeComponent>
  193. </Routine>
  194. <Routine name="initialize">
  195. <RoutineSettingsComponent name="initialize" plugin="None">
  196. <Param val="none" valType="str" updates="None" name="backgroundFit"/>
  197. <Param val="" valType="str" updates="None" name="backgroundImg"/>
  198. <Param val="$[0,0,0]" valType="color" updates="None" name="color"/>
  199. <Param val="rgb" valType="str" updates="None" name="colorSpace"/>
  200. <Param val="" valType="str" updates="constant" name="desc"/>
  201. <Param val="False" valType="bool" updates="None" name="disabled"/>
  202. <Param val="" valType="code" updates="None" name="durationEstim"/>
  203. <Param val="initialize" valType="code" updates="None" name="name"/>
  204. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  205. <Param val="" valType="code" updates="constant" name="skipIf"/>
  206. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  207. <Param val="" valType="code" updates="constant" name="stopVal"/>
  208. <Param val="False" valType="bool" updates="None" name="useWindowParams"/>
  209. </RoutineSettingsComponent>
  210. <TextComponent name="text" plugin="None">
  211. <Param val="black" valType="color" updates="constant" name="color"/>
  212. <Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
  213. <Param val="1" valType="num" updates="constant" name="contrast"/>
  214. <Param val="False" valType="bool" updates="None" name="disabled"/>
  215. <Param val="" valType="code" updates="None" name="durationEstim"/>
  216. <Param val="None" valType="str" updates="constant" name="flip"/>
  217. <Param val="Open Sans" valType="str" updates="constant" name="font"/>
  218. <Param val="LTR" valType="str" updates="None" name="languageStyle"/>
  219. <Param val="0.05" valType="num" updates="constant" name="letterHeight"/>
  220. <Param val="text" valType="code" updates="None" name="name"/>
  221. <Param val="" valType="num" updates="constant" name="opacity"/>
  222. <Param val="0" valType="num" updates="constant" name="ori"/>
  223. <Param val="(0, 0)" valType="list" updates="constant" name="pos"/>
  224. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  225. <Param val="" valType="code" updates="None" name="startEstim"/>
  226. <Param val="time (s)" valType="str" updates="None" name="startType"/>
  227. <Param val="0.0" valType="code" updates="None" name="startVal"/>
  228. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  229. <Param val="" valType="code" updates="constant" name="stopVal"/>
  230. <Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
  231. <Param val="您将在接下来的任务中自主控制气动手,&amp;#10;进度条提示您当前时刻的抓握力度。&amp;#10;希望气动手握紧请用力尝试握手,&amp;#10;希望气动手松开请尝试放松。&amp;#10;按空格键继续" valType="str" updates="constant" name="text"/>
  232. <Param val="from exp settings" valType="str" updates="None" name="units"/>
  233. <Param val="" valType="num" updates="constant" name="wrapWidth"/>
  234. </TextComponent>
  235. <KeyboardComponent name="key_resp" plugin="None">
  236. <Param val="'space'" valType="list" updates="constant" name="allowedKeys"/>
  237. <Param val="" valType="str" updates="constant" name="correctAns"/>
  238. <Param val="False" valType="bool" updates="None" name="disabled"/>
  239. <Param val="True" valType="bool" updates="constant" name="discard previous"/>
  240. <Param val="" valType="code" updates="None" name="durationEstim"/>
  241. <Param val="True" valType="bool" updates="constant" name="forceEndRoutine"/>
  242. <Param val="key_resp" valType="code" updates="None" name="name"/>
  243. <Param val="press" valType="str" updates="constant" name="registerOn"/>
  244. <Param val="True" valType="bool" updates="None" name="saveStartStop"/>
  245. <Param val="" valType="code" updates="None" name="startEstim"/>
  246. <Param val="time (s)" valType="str" updates="None" name="startType"/>
  247. <Param val="1" valType="code" updates="None" name="startVal"/>
  248. <Param val="duration (s)" valType="str" updates="None" name="stopType"/>
  249. <Param val="" valType="code" updates="constant" name="stopVal"/>
  250. <Param val="last key" valType="str" updates="constant" name="store"/>
  251. <Param val="False" valType="bool" updates="constant" name="storeCorrect"/>
  252. <Param val="True" valType="bool" updates="constant" name="syncScreenRefresh"/>
  253. </KeyboardComponent>
  254. <CodeComponent name="parameter_inputs" plugin="None">
  255. <Param val="import os&amp;#10;import datetime&amp;#10;from time import sleep&amp;#10;import argparse&amp;#10;&amp;#10;from device.data_client import NeuracleDataClient&amp;#10;from device.trigger_box import TriggerNeuracle&amp;#10;from device.fubo_pneumatic_finger import FuboPneumaticFingerClient&amp;#10;from settings.config import settings&amp;#10;from bci_core.online import Controller, model_loader&amp;#10;from settings.config import settings&amp;#10;&amp;#10;&amp;#10;config_info = settings.CONFIG_INFO&amp;#10;fingermodel_ids_inverse = settings.FINGERMODEL_IDS_INVERSE&amp;#10;&amp;#10;# get train params&amp;#10;def parse_args():&amp;#10; parser = argparse.ArgumentParser(&amp;#10; description='Hand gesture train'&amp;#10; )&amp;#10; parser.add_argument(&amp;#10; '--subj',&amp;#10; dest='subj',&amp;#10; help='Subject name',&amp;#10; default=None,&amp;#10; type=str&amp;#10; )&amp;#10; parser.add_argument(&amp;#10; '--com',&amp;#10; dest='com',&amp;#10; help='Peripheral serial port',&amp;#10; type=str&amp;#10; )&amp;#10; parser.add_argument(&amp;#10; '--state-change-threshold',&amp;#10; '-scth',&amp;#10; dest='state_change_threshold',&amp;#10; help='Threshold for HMM state change',&amp;#10; type=float&amp;#10; )&amp;#10; parser.add_argument(&amp;#10; '--state-trans-prob',&amp;#10; '-stp',&amp;#10; dest='state_trans_prob',&amp;#10; help='Transition probability for HMM state change',&amp;#10; default=0.8,&amp;#10; type=float&amp;#10; )&amp;#10; parser.add_argument(&amp;#10; '--model-path',&amp;#10; dest='model_path',&amp;#10; help='Path to model file',&amp;#10; default=None,&amp;#10; type=str&amp;#10; )&amp;#10; return parser.parse_args()&amp;#10;args = parse_args()&amp;#10;&amp;#10;# load model&amp;#10;input_kwargs = {&amp;#10; 'state_trans_prob': args.state_trans_prob,&amp;#10; 'state_change_threshold': args.state_change_threshold&amp;#10; }&amp;#10;control_model = model_loader(args.model_path, **input_kwargs)&amp;#10;&amp;#10;# build bci controller&amp;#10;controller = Controller(0., control_model)" valType="extendedCode" updates="constant" name="Before Experiment"/>
  256. <Param val="force = 0;&amp;#10;" valType="extendedCode" updates="constant" name="Before JS Experiment"/>
  257. <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
  258. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
  259. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
  260. <Param val="" valType="extendedCode" updates="constant" name="Begin Routine"/>
  261. <Param val="Py" valType="str" updates="None" name="Code Type"/>
  262. <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
  263. <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
  264. <Param val="" valType="extendedCode" updates="constant" name="End Experiment"/>
  265. <Param val="" valType="extendedCode" updates="constant" name="End JS Experiment"/>
  266. <Param val="" valType="extendedCode" updates="constant" name="End JS Routine"/>
  267. <Param val="" valType="extendedCode" updates="constant" name="End Routine"/>
  268. <Param val="False" valType="bool" updates="None" name="disabled"/>
  269. <Param val="parameter_inputs" valType="code" updates="None" name="name"/>
  270. </CodeComponent>
  271. <CodeComponent name="device" plugin="None">
  272. <Param val="# connect neo&amp;#10;receiver = NeuracleDataClient(n_channel=len(config_info['channel_labels']), &amp;#10; samplerate=config_info['sample_rate'],&amp;#10; host=config_info['host'],&amp;#10; port=config_info['port'],&amp;#10; buffer_len=config_info['buffer_length'])&amp;#10;&amp;#10;# connect to trigger box&amp;#10;trigger = TriggerNeuracle()&amp;#10;&amp;#10;# connect to mechanical hand&amp;#10;hand_device = FuboPneumaticFingerClient({'port': args.com})&amp;#10;" valType="extendedCode" updates="constant" name="Before Experiment"/>
  273. <Param val="receiver = new NeuracleDataClient({&quot;n_channel&quot;: config_info[&quot;channel_labels&quot;].length, &quot;samplerate&quot;: config_info[&quot;sample_rate&quot;], &quot;host&quot;: config_info[&quot;host&quot;], &quot;port&quot;: config_info[&quot;port&quot;]});&amp;#10;trigger = new TriggerNeuracle();&amp;#10;hand_device = new FuboPneumaticFingerClient({&quot;port&quot;: args.com});&amp;#10;controller = new Controller(0.0, args.model_path, {&quot;state_change_threshold&quot;: 0.8});&amp;#10;" valType="extendedCode" updates="constant" name="Before JS Experiment"/>
  274. <Param val="" valType="extendedCode" updates="constant" name="Begin Experiment"/>
  275. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
  276. <Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
  277. <Param val="" valType="extendedCode" updates="constant" name="Begin Routine"/>
  278. <Param val="Py" valType="str" updates="None" name="Code Type"/>
  279. <Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
  280. <Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
  281. <Param val="receiver.close()" valType="extendedCode" updates="constant" name="End Experiment"/>
  282. <Param val="receiver" valType="extendedCode" updates="constant" name="End JS Experiment"/>
  283. <Param val="" valType="extendedCode" updates="constant" name="End JS Routine"/>
  284. <Param val="" valType="extendedCode" updates="constant" name="End Routine"/>
  285. <Param val="False" valType="bool" updates="None" name="disabled"/>
  286. <Param val="device" valType="code" updates="None" name="name"/>
  287. </CodeComponent>
  288. </Routine>
  289. </Routines>
  290. <Flow>
  291. <Routine name="initialize"/>
  292. <LoopInitiator loopType="TrialHandler" name="trials">
  293. <Param name="Selected rows" updates="None" val="" valType="str"/>
  294. <Param name="conditions" updates="None" val="None" valType="str"/>
  295. <Param name="conditionsFile" updates="None" val="" valType="file"/>
  296. <Param name="endPoints" updates="None" val="[0, 1]" valType="num"/>
  297. <Param name="isTrials" updates="None" val="True" valType="bool"/>
  298. <Param name="loopType" updates="None" val="random" valType="str"/>
  299. <Param name="nReps" updates="None" val="10000" valType="num"/>
  300. <Param name="name" updates="None" val="trials" valType="code"/>
  301. <Param name="random seed" updates="None" val="" valType="code"/>
  302. </LoopInitiator>
  303. <Routine name="decision"/>
  304. <Routine name="feedback"/>
  305. <LoopTerminator name="trials"/>
  306. </Flow>
  307. </PsychoPy2experiment>