Skip to content

Commit

Permalink
FF: clock attached to wrong object in new runOnce Cedrus code
Browse files Browse the repository at this point in the history
  • Loading branch information
peircej committed Feb 19, 2020
1 parent f3a7392 commit 186ec58
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions psychopy/experiment/components/cedrusBox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,17 @@ def writeRunOnceInitCode(self, buff):
" devices = pyxid.get_xid_devices()\n"
" core.wait(0.1)\n"
" cedrusBox_%(deviceNumber)s = devices[%(deviceNumber)s]\n"
" cedrusBox_%(deviceNumber)s.clock = core.Clock()\n"
" break # found the device so can break the loop\n"
" except Exception:\n"
" pass\n"
"if not cedrusBox_%(deviceNumber)s:\n"
" logging.error('could not find a Cedrus device.')\n"
" core.quit()\n"
"%(name)s.clock = core.Clock()\n")
" core.quit()\n")
buff.writeOnceIndentedLines(code % self.params)

def writeInitCode(self, buff):
code = ("%(name)s = cedrusBox_%(deviceNumber)s\n"
"%(name)s.clock = core.Clock()\n")
code = ("%(name)s = cedrusBox_%(deviceNumber)s\n")
buff.writeIndentedLines(code % self.params)

def writeRoutineStartCode(self, buff):
Expand Down

0 comments on commit 186ec58

Please sign in to comment.