def openConnection(self, *args): #This function opens the thread which handles the input from the serial port #It only needs to be run once, it is run by connecting to the machine #self.data.message_queue is the queue which handles passing CAN messages between threads x = SerialPortThread() x.setUpData(self.data) self.th = threading.Thread(target=x.getmessage) self.th.daemon = True self.th.start()
def openConnection(self, *args): #This function opens the thread which handles the input from the serial port #It only needs to be run once, it is run by connecting to the machine if not self.data.connectionStatus: #self.data.message_queue is the queue which handles passing CAN messages between threads x = SerialPortThread() x.setUpData(self.data) self.th=threading.Thread(target=x.getmessage) self.th.daemon = True self.th.start()
def openConnection(self, *args): # This function opens the thread which handles the input from the serial port if not self.data.connectionStatus: #self.data.ui_queue.put( # "Action: connectionStatus:_" + json.dumps({'status': 'disconnected', 'port': 'none'}) #) # the "_" facilitates the parse self.data.ui_queue1.put("Action", "connectionStatus", {'status': 'disconnected', 'port': 'none', 'fakeServoStatus': self.data.fakeServoStatus}) x = SerialPortThread() x.data = self.data self.th = threading.Thread(target=x.getmessage) self.th.daemon = True self.th.start() else: self.data.ui_queue1.put("Action", "connectionStatus", {'status': 'connected', 'port': self.data.comport, 'fakeServoStatus': self.data.fakeServoStatus})