File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
psychopy/experiment/components/form Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -159,10 +159,22 @@ def writeRoutineStartCode(self, buff):
159159 pass
160160
161161 def writeFrameCode (self , buff ):
162- buff .writeIndented ("%(name)s.draw()\n " % (self .params ))
162+ cond = "if "
163+ if self .params ['startVal' ]:
164+ cond += "t > %(startVal)s"
165+ if self .params ['stopVal' ] and self .params ['startVal' ]:
166+ cond += " and "
167+ if self .params ['stopVal' ]:
168+ cond += "t < %(startVal)s+%(stopVal)s"
169+ cond += ":\n "
170+ if not self .params ['stopVal' ] and not self .params ['startVal' ]:
171+ cond = ""
172+ buff .writeIndented ((cond +
173+ " %(name)s.draw()\n " ) % (self .params ))
163174
164175 def writeFrameCodeJS (self , buff ):
165- buff .writeIndented ("%(name)s.draw();\n " % (self .params ))
176+ buff .writeIndented ("if t > %(start)s and t < %(stop)s:"
177+ " %(name)s.draw();\n " % (self .params ))
166178
167179 def writeRoutineEndCode (self , buff ):
168180 # save data, according to row/col format
You can’t perform that action at this time.
0 commit comments