def getDataFromServer(self): global threads global firstRun global threads requiredData = self.cBDataSelection.currentText() stopThread = measurementThreads.stopThread("Stop Thread") threads.append(stopThread) stopThread.start() for t in threads: t.join() print ("Join all Threads",threads) threads = [] #Initialisieren der Messung startThreading = measurementThreads.resetExitFlagThread("Start Threading") measurementThread = measurementThreads.measurementThread("Measurement Value: ",0.05,self.btc,requiredData,ringBuffString,ringBuffFloat) #guiThread = measurementThreads.guiThread("Update Gui",0.1,self.tlTextline,self.widget.canvas,ringBuffString,ringBuffFloat) threads.append(startThreading) threads.append(measurementThread) #threads.append(guiThread) # Start new Threads startThreading.start() measurementThread.start()
def disconnectFromServer(self): self.pbConnect.show() self.cBDataSelection.hide() self.pbClose.show() self.pbDisconnect.hide() global threads respond = self.btc.closeServerConnection() self.tlTextline.setText(respond) # Wait for all threads to com stopThread = measurementThreads.stopThread("Stop Thread") threads.append(stopThread) stopThread.start() for t in threads: t.join() print ("Exiting Main Thread") threads = []