forked from knr-auv/PC_GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnectionHandler.py
More file actions
34 lines (26 loc) · 767 Bytes
/
Copy pathconnectionHandler.py
File metadata and controls
34 lines (26 loc) · 767 Bytes
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
from PyQt5 import QtCore
import time
class connectionHandler(QtCore.QObject):
dataReceived = QtCore.pyqtSignal(object)
def __init__(self):
super(connectionHandler,self).__init__()
self.txAvailable =True
self.dataBuffer = []
self.active = True
@QtCore.pyqtSlot()
def receiveData(self): #here we should use class for odroid connection.
a= 50
while self.active:
a+=1
if a>60:
a=50
time.sleep(0.3)
data=(a,1)
self.dataReceived.emit(data)
@QtCore.pyqtSlot(object)
def sendData(self, data=[]):
self.dataBuffer=data
def stop(self):
self.active=False
def start(self):
self.active = True