Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
klukander committed Aug 9, 2016
2 parents 7de527d + 0befd5f commit 5237dab
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,9 @@ def DrawNumOrder( xpos, ypos, number, duration=-1):
# targetVisible = False
targetn=int(item['target_n'])

zmqSend('TSB')
zmqSend('TVB')
logThis( "Begin Visual Search %s" % item['part'])

#change for number of targets between 0-2
#DrawVisSearch( 300, 100, 950, 950, 64, targetVisible, tgt=10, duration=-1)
#WaitForIt( keys=['x', 'b'], duration=-1 ) #only red&green buttons (x, m)
Expand Down
50 changes: 50 additions & 0 deletions zmqtest/zmq_rec_controller_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

import zmq
import platform
import time
from random import randint

#if platform.system == 'Windows':
import msvcrt

def kbfunc():
x = msvcrt.kbhit()
if x:
ret = ord(msvcrt.getch())
else:
ret = 0
return ret

#initialize zmq
context = zmq.Context()
socketOut = context.socket(zmq.PAIR)
portOut = "5556"
socketOut.bind("tcp://127.0.0.1:%s" % portOut)

#msgs = ("ZT", "TQB", "TQE", "IB", "IE", "MQQ0A1B2", "MKW0B2C2")

keepRunning = True
zerotime = time.time()

recording = False
videonum = 0;

msg_start = "TQB"
msg_stop = "TQE"

while keepRunning:
key = kbfunc()
if key == 27:
print "quitting"
keepRunning = False;
elif key <> 0:
recording = not recording
if recording:
videonum += 1
print "start recording %s" % videonum
socketOut.send("%s" % msg_start)
#socket
else:
print "stop recording %s" % videonum
socketOut.send("%s" % msg_stop)

0 comments on commit 5237dab

Please sign in to comment.