-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadEmotivData.py
49 lines (48 loc) · 1.77 KB
/
loadEmotivData.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from pyGameGraph.GraphicManager import *
from emotivDetector import *
from FakePacket import *
import time
packet = FakePacket('signals/vep.txt') #arquivo
teste = GraphicManager()
teste.addGraphic('gyroX',50,0,1,0)
teste.addGraphic('gyroY',160,0,1,0)
teste.addGraphic('AF3',50,110,54,-150)
teste.addGraphic('F7',160,110,54,-150)
teste.addGraphic('F3',270,110,54,-150)
teste.addGraphic('FC5',380,110,54,-150)
teste.addGraphic('T7',50,220,54,-150)
teste.addGraphic('P7',160,220,54,-150)
teste.addGraphic('O1',270,220,5,-1725)
teste.addGraphic('O2',380,220,5,-1750)
teste.addGraphic('P8',50,330,54,-150)
teste.addGraphic('T8',160,330,54,-150)
teste.addGraphic('FC6',270,330,54,-150)
teste.addGraphic('F4',380,330,54,-150)
teste.addGraphic('F8',50,440,54,-150)
teste.addGraphic('AF4',160,440,54,-150)
start = time.clock()
ed = emotivDetector()
while True:
if (time.clock() - start) >= 0.0001:
packet.dequeue() #caso que carregou um arquivo
start = time.clock()
if ed.leftBlink(packet):
print packet.F7[0]
print 'LBLINK'
teste.updateGraphic('gyroX',packet.gyroX)
teste.updateGraphic('gyroY',packet.gyroY)
teste.updateGraphic('AF3',packet.AF3[0])
teste.updateGraphic('F7',packet.F7[0])
teste.updateGraphic('F3',packet.F3[0])
teste.updateGraphic('FC5',packet.FC5[0])
teste.updateGraphic('T7',packet.T7[0])
teste.updateGraphic('P7',packet.P7[0])
teste.updateGraphic('O1',packet.O1[0])
teste.updateGraphic('O2',packet.O2[0])
teste.updateGraphic('P8',packet.P8[0])
teste.updateGraphic('T8',packet.T8[0])
teste.updateGraphic('FC6',packet.FC6[0])
teste.updateGraphic('F4',packet.F4[0])
teste.updateGraphic('F8',packet.F8[0])
teste.updateGraphic('AF4',packet.AF4[0])
teste.show()